<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>betweenGo &#187; Apache</title>
	<atom:link href="http://betweengo.com/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://betweengo.com</link>
	<description>We make Ruby on Rails easy.  We make ATG easy.</description>
	<lastBuildDate>Thu, 24 Jun 2010 19:42:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Unit Test for Threaded Logging</title>
		<link>http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/</link>
		<comments>http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/#comments</comments>
		<pubDate>Mon, 04 May 2009 17:18:45 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[threads]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=709</guid>
		<description><![CDATA[Brian Ploetz sent me this great unit test for threaded logging.  In it we are trying to find if a deadlock occurs.
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;

import junit.framework.TestCase;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Appender;
import org.apache.log4j.Logger;

/**
 * Unit test for the ThrottlingFilter in a multi-threaded environment
 */
public class ThrottlingFilterThreadUTest extends TestCase {

  private static final Log logger = LogFactory.getLog(ThrottlingFilterThreadUTest.class);

  [...]


Related posts:<ol><li><a href='http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/' rel='bookmark' title='Permanent Link: How to Log SQL on JBoss'>How to Log SQL on JBoss</a></li>
<li><a href='http://betweengo.com/2008/05/27/log4j-levels/' rel='bookmark' title='Permanent Link: Log4j levels'>Log4j levels</a></li>
<li><a href='http://betweengo.com/2008/06/10/static-import/' rel='bookmark' title='Permanent Link: Static Import'>Static Import</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a title="Brian Ploetz" href="http://www.linkedin.com/in/bploetz">Brian Ploetz</a> sent me this great unit test for threaded logging.  In it we are trying to find if a deadlock occurs.</p>
<pre>import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;

import junit.framework.TestCase;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Appender;
import org.apache.log4j.Logger;

/**
 * Unit test for the ThrottlingFilter in a multi-threaded environment
 */
public class ThrottlingFilterThreadUTest extends TestCase {

  private static final Log logger = LogFactory.getLog(ThrottlingFilterThreadUTest.class);

  private static ThreadMXBean threadMXBean;

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    threadMXBean = ManagementFactory.getThreadMXBean();
    logger.info("Thread contention monitoring supported: "
        + threadMXBean.isThreadContentionMonitoringSupported());
    logger.info("Thread contention monitoring enabled: "
        + threadMXBean.isThreadContentionMonitoringEnabled());
    threadMXBean.setThreadContentionMonitoringEnabled(true);
    logger.info("Thread contention monitoring enabled: "
        + threadMXBean.isThreadContentionMonitoringEnabled());
  }

  /**
   * Tests multiple threads using the same filter instance at the same time
   */
  public void testThreads() {
    Logger rootLogger = Logger.getRootLogger();
    assertNotNull(rootLogger);
    Appender fileAppender = rootLogger.getAppender("FILE");
    assertNotNull(fileAppender);
    ThrottlingFilter throttlingFilter = (ThrottlingFilter) fileAppender.getFilter();
    assertNotNull(throttlingFilter);

    ThreadGroup infoThreadGroup = new ThreadGroup("info-group");
    ThreadGroup errorThreadGroup = new ThreadGroup("error-group");
    Thread errorThread1 = new ErrorThread(errorThreadGroup, "error-thread-1");
    Thread infoThread1 = new InfoThread(infoThreadGroup, "info-thread-1");
    Thread errorThread2 = new ErrorThread(errorThreadGroup, "error-thread-2");
    Thread infoThread2 = new InfoThread(infoThreadGroup, "info-thread-2");
    infoThread1.start();
    errorThread1.start();
    errorThread2.start();
    infoThread2.start();

    while (true) {
      ThreadInfo[] threadInfos = threadMXBean.getThreadInfo(threadMXBean.getAllThreadIds());
      for (int i = 0; i &lt; threadInfos.length; i++) {
        ThreadInfo threadInfo = threadInfos[i];
        if (threadInfo != null &amp;&amp; threadInfo.getThreadState() == Thread.State.BLOCKED) {
          System.out.println("Thread '" + threadInfo.getThreadName()
              + "' is blocked on the monitor lock '" + threadInfo.getLockName()
              + "' held by thread '" + threadInfo.getLockOwnerName() + "'");
        }
      }

      if (!infoThread1.isAlive() &amp;&amp; !errorThread1.isAlive() &amp;&amp; !infoThread2.isAlive()
          &amp;&amp; !errorThread2.isAlive())
        break;
    }
  }

  public static class ErrorThread extends Thread {

    private static final Log logger = LogFactory.getLog(ErrorThread.class);

    public ErrorThread(ThreadGroup tg, String name) {
      super(tg, name);
    }

    public void run() {
      for (int i = 0; i &lt; 10; i++) {
        try {
          test(0);
        } catch (Exception e) {
          long start = System.currentTimeMillis();
          logger.error("Error!", e);
          long end = System.currentTimeMillis();
          System.out.println("Took " + (end-start) + "ms to log error");
        }
      }
    }

    // simulate large stack traces
    private void test(int i) {
      if (i &gt;= 500)
        throw new RuntimeException("D'OH!");
      test(i+1);
    }
  }

  public static class InfoThread extends Thread {

    private static final Log logger = LogFactory.getLog(InfoThread.class);

    public InfoThread(ThreadGroup tg, String name) {
      super(tg, name);
    }

    public void run() {
      for (int i = 0; i &lt; 100; i++) {
        logger.info("Hi!");
      }
    }
  }
}</pre>
<p>The log4j.xml test file.</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;

&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
    debug="false"&gt;

    &lt;!-- ================================= --&gt;
    &lt;!--           Appenders               --&gt;
    &lt;!-- ================================= --&gt;

    &lt;!-- A time/date based rolling file appender --&gt;
    &lt;appender name="FILE"
        class="org.apache.log4j.DailyRollingFileAppender"&gt;
        &lt;param name="File" value="server.log" /&gt;
        &lt;param name="Append" value="true" /&gt;

        &lt;!-- Rollover at midnight each day --&gt;
        &lt;param name="DatePattern" value="'.'yyyy-MM-dd" /&gt;

        &lt;layout class="org.apache.log4j.PatternLayout"&gt;
            &lt;!-- The default pattern: Date Priority [Category] Message\n --&gt;
            &lt;param name="ConversionPattern" value="%d %-5p [%c] %m%n" /&gt;
        &lt;/layout&gt;

        &lt;filter class="com.betweengo.log4j.ThrottlingFilter"&gt;
          &lt;param name="maxCountSameMessage" value="100"/&gt;
          &lt;param name="maxCountSavedMessages" value="100"/&gt;
          &lt;param name="waitInterval" value="60"/&gt;
        &lt;/filter&gt;
    &lt;/appender&gt;

    &lt;!-- ======================= --&gt;
    &lt;!-- Setup the Root category --&gt;
    &lt;!-- ======================= --&gt;

    &lt;root&gt;
        &lt;level value="INFO" /&gt;
        &lt;appender-ref ref="FILE" /&gt;
    &lt;/root&gt;

&lt;/log4j:configuration&gt;</pre>


<p>Related posts:<ol><li><a href='http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/' rel='bookmark' title='Permanent Link: How to Log SQL on JBoss'>How to Log SQL on JBoss</a></li>
<li><a href='http://betweengo.com/2008/05/27/log4j-levels/' rel='bookmark' title='Permanent Link: Log4j levels'>Log4j levels</a></li>
<li><a href='http://betweengo.com/2008/06/10/static-import/' rel='bookmark' title='Permanent Link: Static Import'>Static Import</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_rewrite to bypass security</title>
		<link>http://betweengo.com/2009/03/02/mod_rewrite-to-bypass-security/</link>
		<comments>http://betweengo.com/2009/03/02/mod_rewrite-to-bypass-security/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 16:21:40 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[HTTP Server]]></category>
		<category><![CDATA[Struts]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=447</guid>
		<description><![CDATA[Many Apache webserver installations use uriworkermap to configure requests are forwarded to Tomcat/JBoss and which are not.   This provides a certain level of security.  For example:
## APACHE RESOURCES (static files):
!/*.gif=myapp
!/*.html=myapp

## DISALLOW  (security-related filter):
!/*.jsp=myapp
!/*.xml=myapp

## TOMCAT RESOURCES:
/*.do=myapp
However if you dynamically generate your sitemap.xml or any other XML files using a servlet then this security will be a [...]


Related posts:<ol><li><a href='http://betweengo.com/2009/03/02/dynamically-generate-sitemapxml/' rel='bookmark' title='Permanent Link: Dynamically generate sitemap.xml'>Dynamically generate sitemap.xml</a></li>
<li><a href='http://betweengo.com/2008/08/15/turning-off-jsp-access/' rel='bookmark' title='Permanent Link: Turning off JSP access'>Turning off JSP access</a></li>
<li><a href='http://betweengo.com/2008/03/31/installing-apache-with-mod_rewrite-and-mod_proxy_balancer/' rel='bookmark' title='Permanent Link: Installing Apache 2.2 with mod_rewrite and mod_proxy_balancer'>Installing Apache 2.2 with mod_rewrite and mod_proxy_balancer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Many Apache webserver installations use <a title="The Apache Tomcat Connector - Reference Guide - uriworkermap.properties configuration" href="http://tomcat.apache.org/connectors-doc/reference/uriworkermap.html">uriworkermap</a> to configure requests are forwarded to Tomcat/JBoss and which are not.   This provides a certain level of security.  For example:</p>
<pre>## APACHE RESOURCES (static files):
!/*.gif=myapp
!/*.html=myapp

## DISALLOW  (security-related filter):
!/*.jsp=myapp
!/*.xml=myapp

## TOMCAT RESOURCES:
/*.do=myapp</pre>
<p>However if you <a title="Dynamically generate sitemap.xml" href="http://betweengo.com/2009/03/02/dynamically-generate-sitemapxml/">dynamically generate your sitemap.xml</a> or any other XML files using a servlet then this security will be a problem since the XML request will not make it to Tomcat/JBoss.  This is when mod_rewrite comes to the rescue.</p>
<p>You can set up <a title="Apache module mod_rewrite" href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">mod_rewrite</a> to rewrite the sitemap.xml request to be a sitemap.do request.</p>
<pre>RewriteRule ^/sitemap\.xml$ /sitemap.do [PT,L]</pre>
<p>Then you can <a title="Strust 1 - Welcome - Struts Config in a Nutshell" href="http://struts.apache.org/1.x/#Struts_Config_in_a_Nutshell">set up Struts</a> to forward this request to sitemap.xml.</p>
<pre>&lt;action path="/sitemap" forward="/sitemap.xml"/&gt;</pre>


<p>Related posts:<ol><li><a href='http://betweengo.com/2009/03/02/dynamically-generate-sitemapxml/' rel='bookmark' title='Permanent Link: Dynamically generate sitemap.xml'>Dynamically generate sitemap.xml</a></li>
<li><a href='http://betweengo.com/2008/08/15/turning-off-jsp-access/' rel='bookmark' title='Permanent Link: Turning off JSP access'>Turning off JSP access</a></li>
<li><a href='http://betweengo.com/2008/03/31/installing-apache-with-mod_rewrite-and-mod_proxy_balancer/' rel='bookmark' title='Permanent Link: Installing Apache 2.2 with mod_rewrite and mod_proxy_balancer'>Installing Apache 2.2 with mod_rewrite and mod_proxy_balancer</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/03/02/mod_rewrite-to-bypass-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turning off JSP access</title>
		<link>http://betweengo.com/2008/08/15/turning-off-jsp-access/</link>
		<comments>http://betweengo.com/2008/08/15/turning-off-jsp-access/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 17:51:34 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[HTTP Server]]></category>
		<category><![CDATA[JBoss]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=273</guid>
		<description><![CDATA[To turn off JSP access in your JBoss or other favorite application server add this to your web.xml.
&#60;!-- Restrict direct access to jsps --&#62;
&#60;security-constraint&#62;
  &#60;web-resource-collection&#62;
    &#60;web-resource-name&#62;you_cant_touch_this&#60;/web-resource-name&#62;
    &#60;url-pattern&#62;*.jsp&#60;/url-pattern&#62;
  &#60;/web-resource-collection&#62;
  &#60;auth-constraint/&#62;
&#60;/security-constraint&#62;
To prevent Apache from sending JSP requests to JBoss add the following to your configuration.
## DISALLOW FROM REACHING [...]


Related posts:<ol><li><a href='http://betweengo.com/2009/03/02/mod_rewrite-to-bypass-security/' rel='bookmark' title='Permanent Link: mod_rewrite to bypass security'>mod_rewrite to bypass security</a></li>
<li><a href='http://betweengo.com/2009/07/14/recurring-illegal-access-errors-in-jboss-when-running-atg/' rel='bookmark' title='Permanent Link: Recurring Illegal Access Errors in JBoss when running ATG'>Recurring Illegal Access Errors in JBoss when running ATG</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>To turn off JSP access in your JBoss or other favorite application server add this to your web.xml.</p>
<pre>&lt;!-- Restrict direct access to jsps --&gt;
&lt;security-constraint&gt;
  &lt;web-resource-collection&gt;
    &lt;web-resource-name&gt;you_cant_touch_this&lt;/web-resource-name&gt;
    &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
  &lt;/web-resource-collection&gt;
  &lt;auth-constraint/&gt;
&lt;/security-constraint&gt;</pre>
<p>To prevent Apache from sending JSP requests to JBoss add the following to your configuration.</p>
<pre>## DISALLOW FROM REACHING JBOSS (security-related filter):
!/*.jsp=name_of_your_app
!/*.xml=name_of_your_app</pre>


<p>Related posts:<ol><li><a href='http://betweengo.com/2009/03/02/mod_rewrite-to-bypass-security/' rel='bookmark' title='Permanent Link: mod_rewrite to bypass security'>mod_rewrite to bypass security</a></li>
<li><a href='http://betweengo.com/2009/07/14/recurring-illegal-access-errors-in-jboss-when-running-atg/' rel='bookmark' title='Permanent Link: Recurring Illegal Access Errors in JBoss when running ATG'>Recurring Illegal Access Errors in JBoss when running ATG</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/08/15/turning-off-jsp-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven Integration for Eclipse</title>
		<link>http://betweengo.com/2008/07/18/maven-integration-for-eclipse/</link>
		<comments>http://betweengo.com/2008/07/18/maven-integration-for-eclipse/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 15:50:18 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=211</guid>
		<description><![CDATA[Previously I was using an old Maven integration for Eclipse, version 0.0.11, which I got from http://m2eclipse.codehaus.org/update.  The plugin was horribly slow and seemed to sometimes interfere with my builds.
Today I upgraded to the latest, version 0.9.4, from http://m2eclipse.sonatype.org/update/ and things are moving much more smoothly.  You can learn more at Maven Integration for Eclipse.
In [...]


Related posts:<ol><li><a href='http://betweengo.com/2008/04/22/eclipse-does-not-understand-maven2_classpath_container/' rel='bookmark' title='Permanent Link: Eclipse does not understand MAVEN2_CLASSPATH_CONTAINER'>Eclipse does not understand MAVEN2_CLASSPATH_CONTAINER</a></li>
<li><a href='http://betweengo.com/2008/05/09/maven-assembly-shell-scripts-unix-lf/' rel='bookmark' title='Permanent Link: Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s'>Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s</a></li>
<li><a href='http://betweengo.com/2006/02/22/import-project-into-eclipse/' rel='bookmark' title='Permanent Link: Import A Project Into Eclipse'>Import A Project Into Eclipse</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Previously I was using an old Maven integration for Eclipse, version 0.0.11, which I got from <a title="http://m2eclipse.codehaus.org/update/" href="http://m2eclipse.codehaus.org/update/">http://m2eclipse.codehaus.org/update</a>.  The plugin was horribly slow and seemed to sometimes interfere with my builds.</p>
<p>Today I upgraded to the latest, version 0.9.4, from <a title="http://m2eclipse.sonatype.org/update/" href="http://m2eclipse.sonatype.org/update/">http://m2eclipse.sonatype.org/update/</a> and things are moving much more smoothly.  You can learn more at <a title="Maven Integration for Eclipse" href="http://m2eclipse.codehaus.org/">Maven Integration for Eclipse</a>.</p>
<p>In Windows &gt; Preferences &gt; Maven I only turned on Download Artifact Sources and Download Artifiact JavaDoc.  Download repository index updates on startup is on by default but I turned it off after receiving this advice from a fellow developer, <a title="Bill Crook - LinkedIn" href="http://www.linkedin.com/pub/1/a32/b70">Bill Crook</a>.</p>
<blockquote><p>It&#8217;s unclear to me how  the m2 plugin uses the indexes so I don&#8217;t think I can answer you. <img src='http://betweengo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Enabling it  causes the plugin to rescan the entire repository if i remember correctly. I  personally am not willing to have Eclipse do a full file scan of the local  repository each time i start for unknown reasons. if you don&#8217;t mind the incurred  overhead, go ahead and enable it!</p></blockquote>
<p>The Maven plugin has a nice dependency feature which <a title="Bill Crook" href="http://billcrook.com/">Bill Crook</a> explains well.</p>
<blockquote><p>There will come a time when you need to work on two projects simultaneously. Additionally, there will probably be a dependency from one project to another. The key to doing this effectively is understanding workspace resolution. Workspace resolution is a concept of the m2eclipse plugin. The way this works is that the plugin scans all projects in your workspace and analyzes the poms. Based on group and artifact ID&#8217;s the plugin will know if there are interdependencies between your projects. Once the plugin has successfully detected the dependency between projects, you can jump from one project source into another when jumping into methods (via control-click or F3).</p>
<p>There is one important caveat to this, versions. In addition to looking at group and artifact ID&#8217;s, the m2eclipse plugin will look at versions to determine if the project for a dependency is in the current workspace. Because of this you must make sure the versions match. Let&#8217;s take the example of projects A and B in your workspace. Assume A has a dependency on version 2.0.0.1 of B. Now, if the version of project B in your workspace is 3.0-SNAPSHOT, workspace resolution <strong>will NOT work</strong>. Can you figure out how to make this work? If you guessed, update the pom of project A to depend on 3.0-SNAPSHOT, you are correct. The moral of the story is be aware of versions when trying to get workspace resolution working.</p>
<p>You will know that workspace resolution is <em>not</em> functioning properly if you see duplicates of the same class when doing searches with control-shift-t. This behavior makes sense when you think about it as Eclipse sees two of these classes in your workspace. For example, continuing with projects A and B as above, let&#8217;s assume there is a class Foo in project B. Eclipse would find class Foo in project B source (as java source in your workspace) as well as in version 2.0.0.1 of B (as a class file in jar dependency).</p></blockquote>
<p>Now if someone would improve the Perforce plugin&#8230;</p>


<p>Related posts:<ol><li><a href='http://betweengo.com/2008/04/22/eclipse-does-not-understand-maven2_classpath_container/' rel='bookmark' title='Permanent Link: Eclipse does not understand MAVEN2_CLASSPATH_CONTAINER'>Eclipse does not understand MAVEN2_CLASSPATH_CONTAINER</a></li>
<li><a href='http://betweengo.com/2008/05/09/maven-assembly-shell-scripts-unix-lf/' rel='bookmark' title='Permanent Link: Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s'>Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s</a></li>
<li><a href='http://betweengo.com/2006/02/22/import-project-into-eclipse/' rel='bookmark' title='Permanent Link: Import A Project Into Eclipse'>Import A Project Into Eclipse</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/07/18/maven-integration-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Trace Level Debugging in JBoss</title>
		<link>http://betweengo.com/2008/07/05/enabling-trace-level-debugging-in-jboss/</link>
		<comments>http://betweengo.com/2008/07/05/enabling-trace-level-debugging-in-jboss/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 20:34:21 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Logging]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=208</guid>
		<description><![CDATA[In JBoss 4.0.4.GA it took me awhile to figure out how to enable trace level debugging.
Typically you could do something like this to enable trace level debugging for a category of classes.
&#60;category  name="com.betweengo.app"&#62;
  &#60;priority  value="TRACE"/&#62;
&#60;/category&#62;
However JBoss 4.0.4.GA has an older log4j implementation so you need to use JBoss&#8217;s custom TRACE level.
&#60;category  [...]


Related posts:<ol><li><a href='http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/' rel='bookmark' title='Permanent Link: How to Log SQL on JBoss'>How to Log SQL on JBoss</a></li>
<li><a href='http://betweengo.com/2010/01/28/enabling-non-xa-resources-in-jboss-4-2-with-atg/' rel='bookmark' title='Permanent Link: Enabling non-XA Resources in JBoss 4.2 with ATG'>Enabling non-XA Resources in JBoss 4.2 with ATG</a></li>
<li><a href='http://betweengo.com/2008/05/27/log4j-levels/' rel='bookmark' title='Permanent Link: Log4j levels'>Log4j levels</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In JBoss 4.0.4.GA it took me awhile to figure out how to enable trace level debugging.</p>
<p>Typically you could do something like this to enable trace level debugging for a category of classes.</p>
<pre>&lt;category  name="com.betweengo.app"&gt;
  &lt;priority  value="TRACE"/&gt;
&lt;/category&gt;</pre>
<p>However JBoss 4.0.4.GA has an older log4j implementation so you need to use JBoss&#8217;s custom TRACE level.</p>
<pre>&lt;category  name="com.betweengo.app"&gt;
  &lt;priority  value="TRACE" class="org.jboss.logging.XLevel"/&gt;
&lt;/category&gt;</pre>
<p>This is documented in the release notes for JBoss-4.2.1.GA.</p>
<blockquote><p>Since the latest log4j includes a trace level, there is no need to reference the custom jboss TRACE level in conf/jboss-log4j.xml configs, JBAS-4163.</p></blockquote>
<p>There is additional information on trace level debugging in the articles <a title="JBossWiki : JBossMessagingUser_Enabling_TRACE_logging_on_server" href="http://wiki.jboss.org/wiki/JBossMessagingUser_Enabling_TRACE_logging_on_server">Enabling TRACE logging on server </a>and <a title="JBoss.com - logging" href="http://www.jboss.com/developers/guides/logging">Using Logging</a>.</p>


<p>Related posts:<ol><li><a href='http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/' rel='bookmark' title='Permanent Link: How to Log SQL on JBoss'>How to Log SQL on JBoss</a></li>
<li><a href='http://betweengo.com/2010/01/28/enabling-non-xa-resources-in-jboss-4-2-with-atg/' rel='bookmark' title='Permanent Link: Enabling non-XA Resources in JBoss 4.2 with ATG'>Enabling non-XA Resources in JBoss 4.2 with ATG</a></li>
<li><a href='http://betweengo.com/2008/05/27/log4j-levels/' rel='bookmark' title='Permanent Link: Log4j levels'>Log4j levels</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/07/05/enabling-trace-level-debugging-in-jboss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven Profiles</title>
		<link>http://betweengo.com/2008/06/13/maven-profiles/</link>
		<comments>http://betweengo.com/2008/06/13/maven-profiles/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 22:07:00 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=197</guid>
		<description><![CDATA[Maven profiles are a pretty neat concept for organizing different settings for different builds.
Typically one sets them up in your settings.xml.  Projects will also have profiles in profiles.xml whose values you can override with your values in settings.xml.
A few observations I made about profiles.

Your profile is the conglomeration of all your active profiles in your [...]


Related posts:<ol><li><a href='http://betweengo.com/2008/07/18/maven-integration-for-eclipse/' rel='bookmark' title='Permanent Link: Maven Integration for Eclipse'>Maven Integration for Eclipse</a></li>
<li><a href='http://betweengo.com/2008/05/09/maven-assembly-shell-scripts-unix-lf/' rel='bookmark' title='Permanent Link: Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s'>Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s</a></li>
<li><a href='http://betweengo.com/2008/04/22/eclipse-does-not-understand-maven2_classpath_container/' rel='bookmark' title='Permanent Link: Eclipse does not understand MAVEN2_CLASSPATH_CONTAINER'>Eclipse does not understand MAVEN2_CLASSPATH_CONTAINER</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Maven <a title="Maven - Introduction to build profiles" href="http://maven.apache.org/guides/introduction/introduction-to-profiles.html">profiles</a> are a pretty neat concept for organizing different settings for different builds.</p>
<p>Typically one sets them up in your settings.xml.  Projects will also have profiles in profiles.xml whose values you can override with your values in settings.xml.</p>
<p>A few observations I made about profiles.</p>
<ol>
<li>Your profile is the conglomeration of all your active profiles in your settings.xml.</li>
<li>To activate other profile during a single maven execution, mvn -P profile1, profile2.</li>
</ol>


<p>Related posts:<ol><li><a href='http://betweengo.com/2008/07/18/maven-integration-for-eclipse/' rel='bookmark' title='Permanent Link: Maven Integration for Eclipse'>Maven Integration for Eclipse</a></li>
<li><a href='http://betweengo.com/2008/05/09/maven-assembly-shell-scripts-unix-lf/' rel='bookmark' title='Permanent Link: Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s'>Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s</a></li>
<li><a href='http://betweengo.com/2008/04/22/eclipse-does-not-understand-maven2_classpath_container/' rel='bookmark' title='Permanent Link: Eclipse does not understand MAVEN2_CLASSPATH_CONTAINER'>Eclipse does not understand MAVEN2_CLASSPATH_CONTAINER</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/06/13/maven-profiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stats on Dreamhost with WordPress</title>
		<link>http://betweengo.com/2008/06/03/stats-on-dreamhost-with-wordpress/</link>
		<comments>http://betweengo.com/2008/06/03/stats-on-dreamhost-with-wordpress/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 16:42:57 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[HTTP Server]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[dreamhost]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=189</guid>
		<description><![CDATA[On my WordPress blogs hosted by Dreamhost to get stats I needed to add this to the .htaccess file.
# BEGIN Stats
&#60;IfModule mod_rewrite.c&#62;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats&#124;failed_auth\.html).*$ [NC]
RewriteRule . - [L]
&#60;/IfModule&#62;
# END Stats
This is further explained in the Dreamhost Wiki page Making stats accessible with htaccess.
Dreamhost uses Analog to generate web statistics.  Other recommended AWStats [...]


Related posts:<ol><li><a href='http://betweengo.com/2006/03/17/wordpress-contact-e-mail-form/' rel='bookmark' title='Permanent Link: WordPress Contact E-Mail Form'>WordPress Contact E-Mail Form</a></li>
<li><a href='http://betweengo.com/2005/10/17/wordpress-and-gallery2/' rel='bookmark' title='Permanent Link: WordPress and Gallery2'>WordPress and Gallery2</a></li>
<li><a href='http://betweengo.com/2005/10/24/subversion-on-dreamhost/' rel='bookmark' title='Permanent Link: Subversion on Dreamhost'>Subversion on Dreamhost</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a title="Analog: WWW logfile analysis" href="http://www.analog.cx/"><img class="alignleft" style="border: 0pt none; float: left; margin-left: 15px; margin-right: 15px;" src="http://www.analog.cx/analogo.gif" alt="Analog: WWW logfile analysis" /></a>On my WordPress blogs hosted by Dreamhost to get stats I needed to add this to the .htaccess file.</p>
<pre># BEGIN Stats
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
RewriteRule . - [L]
&lt;/IfModule&gt;
# END Stats</pre>
<p>This is further explained in the Dreamhost Wiki page <a title="Making stats accessible with htaccess" href="http://wiki.dreamhost.com/Making_stats_accessible_with_htaccess">Making stats accessible with htaccess</a>.</p>
<p>Dreamhost uses <a title="Analog: WWW logfile analysis" href="http://www.analog.cx/">Analog</a> to generate web statistics.  Other recommended <a title="AWStats - Free log file analyzer for advanced statistics (GNU GPL)." href="http://awstats.sourceforge.net/">AWStats</a> which seems more powerful.  Maybe I&#8217;ll switch if I feel the need.</p>


<p>Related posts:<ol><li><a href='http://betweengo.com/2006/03/17/wordpress-contact-e-mail-form/' rel='bookmark' title='Permanent Link: WordPress Contact E-Mail Form'>WordPress Contact E-Mail Form</a></li>
<li><a href='http://betweengo.com/2005/10/17/wordpress-and-gallery2/' rel='bookmark' title='Permanent Link: WordPress and Gallery2'>WordPress and Gallery2</a></li>
<li><a href='http://betweengo.com/2005/10/24/subversion-on-dreamhost/' rel='bookmark' title='Permanent Link: Subversion on Dreamhost'>Subversion on Dreamhost</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/06/03/stats-on-dreamhost-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log4j levels</title>
		<link>http://betweengo.com/2008/05/27/log4j-levels/</link>
		<comments>http://betweengo.com/2008/05/27/log4j-levels/#comments</comments>
		<pubDate>Wed, 28 May 2008 03:09:02 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Logging]]></category>
		<category><![CDATA[log4j]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=186</guid>
		<description><![CDATA[I always forget which level is which in Log4j so I copied this from the JavaDoc for the Level class.



 static Level
ALL
The ALL has the lowest possible rank and is intended to      turn on all logging.


 static Level
DEBUG
The DEBUG Level designates fine-grained      informational events that [...]


Related posts:<ol><li><a href='http://betweengo.com/2008/07/05/enabling-trace-level-debugging-in-jboss/' rel='bookmark' title='Permanent Link: Enabling Trace Level Debugging in JBoss'>Enabling Trace Level Debugging in JBoss</a></li>
<li><a href='http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/' rel='bookmark' title='Permanent Link: Unit Test for Threaded Logging'>Unit Test for Threaded Logging</a></li>
<li><a href='http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/' rel='bookmark' title='Permanent Link: How to Log SQL on JBoss'>How to Log SQL on JBoss</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I always forget which level is which in <a title="Log4j 1.2" href="http://logging.apache.org/log4j/1.2/index.html">Log4j</a> so I copied this from the JavaDoc for the <a title="Level (Apache Log4j 1.2.15 API)" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a> class.</p>
<table border="1" cellspacing="0" cellpadding="3" width="100%">
<tbody>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code>static <a title="class in org.apache.log4j" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a></code></span></td>
<td><code><strong><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#ALL">ALL</a></strong></code><br />
The <code>ALL</code> has the lowest possible rank and is intended to      turn on all logging.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code>static <a title="class in org.apache.log4j" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a></code></span></td>
<td><code><strong><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#DEBUG">DEBUG</a></strong></code><br />
The <code>DEBUG</code> Level designates fine-grained      informational events that are most useful to debug an      application.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code>static <a title="class in org.apache.log4j" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a></code></span></td>
<td><code><strong><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#ERROR">ERROR</a></strong></code><br />
The <code>ERROR</code> level designates error events that      might still allow the application to continue running.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code>static <a title="class in org.apache.log4j" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a></code></span></td>
<td><code><strong><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#FATAL">FATAL</a></strong></code><br />
The <code>FATAL</code> level designates very severe error      events that will presumably lead the application to abort.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code>static <a title="class in org.apache.log4j" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a></code></span></td>
<td><code><strong><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#INFO">INFO</a></strong></code><br />
The <code>INFO</code> level designates informational messages      that highlight the progress of the application at coarse-grained      level.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code>static <a title="class in org.apache.log4j" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a></code></span></td>
<td><code><strong><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#OFF">OFF</a></strong></code><br />
The <code>OFF</code> has the highest possible rank and is      intended to turn off logging.</td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code>static <a title="class in org.apache.log4j" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a></code></span></td>
<td><code><strong><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#TRACE">TRACE</a></strong></code><br />
The <code>TRACE</code> Level designates finer-grained  informational events than the <code>DEBUG</code></td>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td width="1%" align="right" valign="top"><span> <code>static <a title="class in org.apache.log4j" href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html">Level</a></code></span></td>
<td><code><strong><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#WARN">WARN</a></strong></code><br />
The <code>WARN</code> level designates potentially harmful situations.</td>
</tr>
</tbody>
</table>


<p>Related posts:<ol><li><a href='http://betweengo.com/2008/07/05/enabling-trace-level-debugging-in-jboss/' rel='bookmark' title='Permanent Link: Enabling Trace Level Debugging in JBoss'>Enabling Trace Level Debugging in JBoss</a></li>
<li><a href='http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/' rel='bookmark' title='Permanent Link: Unit Test for Threaded Logging'>Unit Test for Threaded Logging</a></li>
<li><a href='http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/' rel='bookmark' title='Permanent Link: How to Log SQL on JBoss'>How to Log SQL on JBoss</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/05/27/log4j-levels/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Size of collection in a JSP/DSP page</title>
		<link>http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/</link>
		<comments>http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/#comments</comments>
		<pubDate>Thu, 15 May 2008 18:44:26 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[Struts]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=182</guid>
		<description><![CDATA[
(Photo: leaf pile by oeimah)
Sometimes in a JSP/DSP page you will want to get the size of a collection and unless you are within a Range, ForEach or similar droplet you won&#8217;t have access to this value.
Struts has a nice solution using the &#34; href=&#34;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&#34;&#62;&#34; href=&#34;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&#34;&#62;&#34; href=&#34;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&#34;&#62;&#60;bean:size&#62; tag.&#160; JSTL 1.1 has a nice solution using [...]


Related posts:<ol><li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='Permanent Link: ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
<li><a href='http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/' rel='bookmark' title='Permanent Link: Jumping to different parts of a page using a dropdown'>Jumping to different parts of a page using a dropdown</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/oeimah/4112247972/"><img title="leaf pile on Flickr" alt="leaf pile on Flickr" src="http://farm3.static.flickr.com/2496/4112247972_3bb40b80b3.jpg" /></a></p>
<p style="text-align: center">(Photo: <a title="leaf pile on Flickr" href="http://www.flickr.com/photos/oeimah/4112247972/">leaf pile</a> by <a title="Flickr: oeimah&#39;s photostream" href="http://www.flickr.com/photos/oeimah/">oeimah</a>)</p>
<p>Sometimes in a JSP/DSP page you will want to get the size of a collection and unless you are within a Range, ForEach or similar droplet you won&#8217;t have access to this value.</p>
<p>Struts has a nice solution using the <a title="&lt;bean:size&gt;" href="http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size">&quot; href=&quot;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&quot;&gt;&quot; href=&quot;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&quot;&gt;&quot; href=&quot;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&quot;&gt;&lt;bean:size&gt; tag</a>.&#160; JSTL 1.1 has a nice solution using the <a title="JSTL Function length" href="http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/length.fn.html">fn:length</a> function.</p>
<p>Here is an example of how to use Struts, DSPEL and JSTL to get the size of a collection.</p>
<pre>  &lt;dspel:getvalueof param=&quot;book.pages&quot; var=&quot;pages&quot;
                    vartype=&quot;java.util.Collection&quot;/&gt;
  &lt;bean:size id=&quot;numPages&quot; name=&quot;pages&quot;/&gt;
  Number of Pages: &lt;c:out value=&quot;${numPages}&quot;/&gt;
  Number of Pages: &lt;dspel:valueof value=&quot;${numPages}&quot;/&gt;</pre>
<p>
  <br />Here is an example of how to use JSTL 1.1 and DSPEL to get the size of a collection. </p>
<p></p>
<pre>  &lt;dspel:getvalueof param=&quot;book.pages&quot; var=&quot;pages&quot;
                    vartype=&quot;java.util.Collection&quot;/&gt;
  Number of Pages: &lt;c:out value=&quot;${fn:length(pages)}&quot;/&gt;</pre>


<p>Related posts:<ol><li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='Permanent Link: ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
<li><a href='http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/' rel='bookmark' title='Permanent Link: Jumping to different parts of a page using a dropdown'>Jumping to different parts of a page using a dropdown</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven Assembly Convert Shell Scripts to use UNIX LF&#8217;s</title>
		<link>http://betweengo.com/2008/05/09/maven-assembly-shell-scripts-unix-lf/</link>
		<comments>http://betweengo.com/2008/05/09/maven-assembly-shell-scripts-unix-lf/#comments</comments>
		<pubDate>Fri, 09 May 2008 19:52:19 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Perforce]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=180</guid>
		<description><![CDATA[In a previous post, Shell Scripts with Windows LF’s Fail in Latest Cygwin, I wrote about how to use Perforce to check out all files in UNIX format.  However if you use Eclipse then this solution will not work because Eclipse always inserts Windows LF&#8217;s in any line you insert into a file leading [...]


Related posts:<ol><li><a href='http://betweengo.com/2008/05/05/scripts-with-win-lfs-fail-cygwin/' rel='bookmark' title='Permanent Link: Shell Scripts with Windows LF&#8217;s Fail in Latest Cygwin'>Shell Scripts with Windows LF&#8217;s Fail in Latest Cygwin</a></li>
<li><a href='http://betweengo.com/2007/03/07/cygwin-bash-cannot-execute-dos-formatted-scripts/' rel='bookmark' title='Permanent Link: Cygwin Bash cannot execute DOS formatted scripts'>Cygwin Bash cannot execute DOS formatted scripts</a></li>
<li><a href='http://betweengo.com/2008/08/08/cygwin-bash-scripts-and-java/' rel='bookmark' title='Permanent Link: Cygwin Bash Scripts and Java'>Cygwin Bash Scripts and Java</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In a previous post, <a title="Shell Scripts with Windows LF’s Fail in Latest Cygwin" href="http://betweengo.com/cygwin/2008/05/05/scripts-with-win-lfs-fail-cygwin/">Shell Scripts with Windows LF’s Fail in Latest Cygwin</a>, I wrote about how to use Perforce to check out all files in UNIX format.  However if you use Eclipse then this solution will not work because Eclipse always inserts Windows LF&#8217;s in any line you insert into a file leading to a mess with files that have both UNIX and Windows LF&#8217;s.</p>
<p>However if you happen to use Maven to generate / copy your shell scripts to their target directories you can take advantage of the <a title="Maven Assembly Plugin - file" href="http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_file">lineEnding</a> property in the <a title="Maven Assembly Plugin" href="http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html">Assembly Director</a>.  If you specify the lineEnding property to be &#8220;unix&#8221; then the outputted shell scripts will be in UNIX format.  For example:</p>
<pre>&lt;file&gt;
  &lt;source&gt;src/main/scripts/foo.sh&lt;/source&gt;
  &lt;outputDirectory&gt;bin&lt;/outputDirectory&gt;
  &lt;lineEnding&gt;unix&lt;/lineEnding&gt;
&lt;/file&gt;</pre>


<p>Related posts:<ol><li><a href='http://betweengo.com/2008/05/05/scripts-with-win-lfs-fail-cygwin/' rel='bookmark' title='Permanent Link: Shell Scripts with Windows LF&#8217;s Fail in Latest Cygwin'>Shell Scripts with Windows LF&#8217;s Fail in Latest Cygwin</a></li>
<li><a href='http://betweengo.com/2007/03/07/cygwin-bash-cannot-execute-dos-formatted-scripts/' rel='bookmark' title='Permanent Link: Cygwin Bash cannot execute DOS formatted scripts'>Cygwin Bash cannot execute DOS formatted scripts</a></li>
<li><a href='http://betweengo.com/2008/08/08/cygwin-bash-scripts-and-java/' rel='bookmark' title='Permanent Link: Cygwin Bash Scripts and Java'>Cygwin Bash Scripts and Java</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/05/09/maven-assembly-shell-scripts-unix-lf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->