<?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; Java SE</title>
	<atom:link href="http://betweengo.com/category/java/se/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>Tue, 06 Dec 2011 14:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Programming Secure FTP in Java</title>
		<link>http://betweengo.com/2011/02/21/programming-secure-ftp-in-java/</link>
		<comments>http://betweengo.com/2011/02/21/programming-secure-ftp-in-java/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 16:00:00 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[jsch]]></category>
		<category><![CDATA[sftp]]></category>

		<guid isPermaLink="false">http://betweengo.com/2011/02/21/programming-secure-ftp-in-java/</guid>
		<description><![CDATA[Often server applications need to upload or download files using FTP.&#160; But in this age of increasing security awareness vendors are now asking this be done using SFTP (Secure FTP). Fortunately this is not difficult using the JSch (Java Secure Channel) library.&#160; The downloadable JSch archive includes numerous examples.&#160; I used the Sftp.java to implement [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2005/08/12/acc-not-connecting/' rel='bookmark' title='ACC not connecting'>ACC not connecting</a></li>
<li><a href='http://betweengo.com/2008/09/01/java-method-with-generic-return-type/' rel='bookmark' title='Java Method with Generic Return Type'>Java Method with Generic Return Type</a></li>
<li><a href='http://betweengo.com/2008/04/18/oracle-tns-listener-service-not-starting/' rel='bookmark' title='Oracle TNS Listener service not starting'>Oracle TNS Listener service not starting</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a title="Comes with built-in FTP server | Flickr" href="http://www.flickr.com/photos/mptre/5152486610/"><img style="margin: 0px 0px 0px 5px; display: inline; float: right" align="right" src="http://farm2.static.flickr.com/1399/5152486610_24681b6e36_m.jpg" /></a>Often server applications need to upload or download files using FTP.&#160; But in this age of increasing security awareness vendors are now asking this be done using SFTP (Secure FTP).</p>
<p>Fortunately this is not difficult using the <a title="JSch - Java Secure Channel" href="http://www.jcraft.com/jsch/">JSch (Java Secure Channel) library</a>.&#160; The downloadable JSch archive includes numerous examples.&#160; I used the <tt>Sftp.java</tt> to implement SFTP for my server application.</p>
<p>Starting a connection to an SFTP server using JSch is somewhat simple.</p>
<pre>JSch jsch = new JSch();

// start session
session = jsch.getSession(username, host);

// specify our own user info to accept secure connection to FTP server
UserInfo ui = new MyUserInfo(host);
session.setUserInfo(ui);

// set password
session.setPassword(password);

// connect
session.connect();

// get SFTP channel
Channel channel = session.openChannel(&quot;sftp&quot;);
channel.connect();
schannel = (ChannelSftp) channel;</pre>
<p>The trick is getting past confirmation of the authenticity of the host. I do this my creating my own <tt>UserInfo</tt> implementation, <tt>MyUserInfo</tt>, which knows about the host I am connecting to. The only method I implement is the <tt>promptYesNo</tt> method which simply checks if the message is asking about the host I want to connect to. </p>
<pre>protected MyUserInfo(final String pKnownHost) {
    this.mKnownHost = pKnownHost;
}

@Override
public boolean promptYesNo(final String pMessage) {
    // message looks like this &quot;The authenticity of host 'foo.com' can't be established...&quot;
    final int start = pMessage.indexOf(&quot;'&quot;) + 1;
    final int end = pMessage.indexOf(&quot;'&quot;, start);
    final String host = pMessage.substring(start, end);

    // is the host a known host?
    return this.mKnownHost.equals(host);
}</pre>
<p>Now uploading is trivial.</p>
<pre>schannel.put(src, dest);</pre>
<p>For further reading please see <a title="ftp - Java: What is the best way to SFTP a file from a server - Stack Overflow" href="http://stackoverflow.com/questions/14617/java-what-is-the-best-way-to-sftp-a-file-from-a-server">Java: What is the best way to SFTP a file from a server</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2011%2F02%2F21%2Fprogramming-secure-ftp-in-java%2F&amp;title=Programming%20Secure%20FTP%20in%20Java" id="wpa2a_2"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2005/08/12/acc-not-connecting/' rel='bookmark' title='ACC not connecting'>ACC not connecting</a></li>
<li><a href='http://betweengo.com/2008/09/01/java-method-with-generic-return-type/' rel='bookmark' title='Java Method with Generic Return Type'>Java Method with Generic Return Type</a></li>
<li><a href='http://betweengo.com/2008/04/18/oracle-tns-listener-service-not-starting/' rel='bookmark' title='Oracle TNS Listener service not starting'>Oracle TNS Listener service not starting</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2011/02/21/programming-secure-ftp-in-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>URLEncoder.encode is Deprecated So What Do I Use for Encoding?</title>
		<link>http://betweengo.com/2009/10/31/urlencoder-encode-is-deprecated-so-what-do-i-use-for-encoding/</link>
		<comments>http://betweengo.com/2009/10/31/urlencoder-encode-is-deprecated-so-what-do-i-use-for-encoding/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 18:39:54 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[deprecated]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/10/31/urlencoder-encode-is-deprecated-so-what-do-i-use-for-encoding/</guid>
		<description><![CDATA[(Photo: The Surface by Daniel*1977) URLEncoder.encode(String url) is deprecated.&#160; Java wants you to use URLEncoder.encode(String url, String enc).&#160; But what do you put for the encoding parameter?&#160; I always forget which is the whole point of this post. URLEncoder.encode(url, &#34;UTF-8&#34;); Also on Windows if you want you can do: URLEncoder.encode(url, &#34;Cp1252&#34;); For further reading please [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/03/17/encode-uri/' rel='bookmark' title='Encode URI'>Encode URI</a></li>
<li><a href='http://betweengo.com/2009/03/02/dynamically-generate-sitemapxml/' rel='bookmark' title='Dynamically generate sitemap.xml'>Dynamically generate sitemap.xml</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/didmyself/3978834571/"><img title="The Surface on Flickr" alt="The Surface on Flickr" src="http://farm3.static.flickr.com/2476/3978834571_3e2528811f.jpg" /></a></p>
<p style="text-align: center">(Photo: <a title="The Surface on Flickr" href="http://www.flickr.com/photos/didmyself/3978834571/">The Surface</a> by <a title="Flickr: Daniel*1977&#39;s photostream" href="http://www.flickr.com/photos/didmyself/">Daniel*1977</a>)</p>
<p><a title="URLEncoder.encode(String url)" href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLEncoder.html#encode%28java.lang.String%29">URLEncoder.encode(String url)</a> is deprecated.&#160; Java wants you to use <a title="URLEncoder.encode(String url, String enc)" href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLEncoder.html#encode%28java.lang.String,%20java.lang.String%29">URLEncoder.encode(String url, String enc)</a>.&#160; But what do you put for the encoding parameter?&#160; I always forget which is the whole point of this post. <img src='http://betweengo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<pre>URLEncoder.encode(url, &quot;UTF-8&quot;);</pre>
<p>Also on Windows if you want you can do:</p>
<pre>URLEncoder.encode(url, &quot;Cp1252&quot;);</pre>
<p>For further reading please see <a title="default encoding of a jvm" href="http://www.velocityreviews.com/forums/t124404-default-encoding-of-a-jvm.html">default encoding of a jvm</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F10%2F31%2Furlencoder-encode-is-deprecated-so-what-do-i-use-for-encoding%2F&amp;title=URLEncoder.encode%20is%20Deprecated%20So%20What%20Do%20I%20Use%20for%20Encoding%3F" id="wpa2a_4"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/03/17/encode-uri/' rel='bookmark' title='Encode URI'>Encode URI</a></li>
<li><a href='http://betweengo.com/2009/03/02/dynamically-generate-sitemapxml/' rel='bookmark' title='Dynamically generate sitemap.xml'>Dynamically generate sitemap.xml</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/10/31/urlencoder-encode-is-deprecated-so-what-do-i-use-for-encoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using ResourceBundle and MessageFormat for Error Messages</title>
		<link>http://betweengo.com/2009/09/07/using-resourcebundle-and-messageformat-for-error-messages/</link>
		<comments>http://betweengo.com/2009/09/07/using-resourcebundle-and-messageformat-for-error-messages/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 12:00:00 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MessageFormat]]></category>
		<category><![CDATA[ResourceBundle]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/09/04/using-resourcebundle-and-messageformat-for-error-messages/</guid>
		<description><![CDATA[When generating error messages, two Java utility classes, ResourceBundle and MessageFormat, are extremely practical and powerful.&#160; From the ResourceBundle JavaDoc: Resource bundles contain locale-specific objects. When your program needs a locale-specific resource, a String for example, your program can load it from the resource bundle that is appropriate for the current user&#8217;s locale. In this [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2006/03/20/want-to-disable-windows-error-reporting/' rel='bookmark' title='HOWTO: Disable Windows Error Reporting?'>HOWTO: Disable Windows Error Reporting?</a></li>
<li><a href='http://betweengo.com/2008/05/05/color-code-outlook-messages/' rel='bookmark' title='Color Code Outlook Messages'>Color Code Outlook Messages</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When generating error messages, two Java utility classes, <a title="ResourceBundle (Java Platform SE 6)" href="http://java.sun.com/javase/6/docs/api/java/util/ResourceBundle.html">ResourceBundle</a> and <a title="MessageFormat (Java Platform SE 6)" href="http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html">MessageFormat</a>, are extremely practical and powerful.&#160; From the ResourceBundle JavaDoc:</p>
<blockquote><p>Resource bundles contain locale-specific objects. When your program needs a locale-specific resource, a <a title="String (Java Platform SE 6)" href="http://java.sun.com/javase/6/docs/api/java/lang/String.html"><code>String</code></a> for example, your program can load it from the resource bundle that is appropriate for the current user&#8217;s locale. In this way, you can write program code that is largely independent of the user&#8217;s locale isolating most, if not all, of the locale-specific information in resource bundles. </p>
<p>This allows you to write programs that can: </p>
<ul>
<li>be easily localized, or translated, into different languages </li>
<li>handle multiple locales at once </li>
<li>be easily modified later to support even more locales </li>
</ul>
</blockquote>
<p>And from the MessageFormat JavaDoc:</p>
<blockquote><p><code>MessageFormat</code> provides a means to produce concatenated messages in a language-neutral way. Use this to construct messages displayed for end users. </p>
<p><code>MessageFormat</code> takes a set of objects, formats them, then inserts the formatted strings into the pattern at the appropriate places. </p>
</blockquote>
<p>This is an example of an error message resource bundle, <tt>ErrorMessagesResources.properties</tt>.</p>
<pre>userAlreadyExists=A user already exists with the name {0}.
passwordInvalid=Please enter a valid password.</pre>
<p>This is an example of how you would use this resource bundle.</p>
<pre>protected static final ResourceBundle resourceBundle =
    ResourceBundle.getBundle(&quot;com.betweengo.ErrorMessageResources&quot;);

public boolean handleLogin(DynamoHttpServletRequest pReq, DynamoHttpServletResponse pRes) {

  ...

  // user already exists
  String errMsg1 = resourceBundle.getString(&quot;userAlreadyExists&quot;);
  errMsg1 = MessageFormat.format(errMsg1, userName);

  ...

  // password invalid
  String errMsg2 = resourceBundle.getString(&quot;passwordInvalid&quot;);

  ...
}</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F09%2F07%2Fusing-resourcebundle-and-messageformat-for-error-messages%2F&amp;title=Using%20ResourceBundle%20and%20MessageFormat%20for%20Error%20Messages" id="wpa2a_6"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2006/03/20/want-to-disable-windows-error-reporting/' rel='bookmark' title='HOWTO: Disable Windows Error Reporting?'>HOWTO: Disable Windows Error Reporting?</a></li>
<li><a href='http://betweengo.com/2008/05/05/color-code-outlook-messages/' rel='bookmark' title='Color Code Outlook Messages'>Color Code Outlook Messages</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/09/07/using-resourcebundle-and-messageformat-for-error-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enums in Java</title>
		<link>http://betweengo.com/2009/09/02/enums-in-java/</link>
		<comments>http://betweengo.com/2009/09/02/enums-in-java/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 17:00:00 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[enums]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/09/01/enums-in-java/</guid>
		<description><![CDATA[(Photo: Slide-together : now with cards by fdecomite) Enums are highly useful data types introduced in Java SE 5.0.  Though I love using them I often forget the exact syntax so this post is to remind me later how to use it. public enum Example { FOO,BAR } // create one using its name Example [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/06/12/covariant-return-types/' rel='bookmark' title='Covariant Return Types in Java'>Covariant Return Types in Java</a></li>
<li><a href='http://betweengo.com/2008/03/12/computing-basics-interview-questions/' rel='bookmark' title='Computing Basics Interview Questions'>Computing Basics Interview Questions</a></li>
<li><a href='http://betweengo.com/2007/03/28/printing-out-an-array/' rel='bookmark' title='Printing out an array'>Printing out an array</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/fdecomite/3611388781/"><img title="Slide-together : now with cards on Flickr" src="http://farm4.static.flickr.com/3303/3611388781_0110324b5f.jpg" alt="Slide-together : now with cards on Flickr" /></a><br />
(Photo: <a title="Slide-together : now with cards on Flickr" href="http://www.flickr.com/photos/fdecomite/3611388781/">Slide-together : now with cards</a> by <a title="Flickr: fdecomite's Photostream" href="http://www.flickr.com/photos/fdecomite/">fdecomite</a>)</p>
<p><a title="Enum (Java 2 SE Platform 5.0)" href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html">Enums</a> are highly useful data types introduced in <a title="J2SE 5.0" href="http://java.sun.com/j2se/1.5.0/">Java SE 5.0</a>.  Though I love using them I often forget the exact syntax so this post is to remind me later how to use it.</p>
<pre>public enum Example {
  FOO,BAR
}

// create one using its name
Example myExample = Example.valueOf(“bar”.toUpperCase());

// if statement
if (myExample == Example.FOO) System.out.println(“FOO!”);

// switch statement
switch (myExample) {
  case FOO: System.out.println(“FOO!”);
  case BAR: System.out.println(“BAR!”);
}

// output as String using name
System.out.println(myExample.name());
</pre>
<p>For further reading please see Java’s <a title="Enums" href="http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html">Enums guide</a> and <a title="Enum Types (The Java™ Tutorials &gt; Learning the Java Language &gt; Classes and Objects)" href="http://java.sun.com/docs/books/tutorial/java/javaOO/enum.html">Enum Types (The Java™ Tutorials &gt; Learning the Java Language &gt; Classes and Objects)</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F09%2F02%2Fenums-in-java%2F&amp;title=Enums%20in%20Java" id="wpa2a_8"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/06/12/covariant-return-types/' rel='bookmark' title='Covariant Return Types in Java'>Covariant Return Types in Java</a></li>
<li><a href='http://betweengo.com/2008/03/12/computing-basics-interview-questions/' rel='bookmark' title='Computing Basics Interview Questions'>Computing Basics Interview Questions</a></li>
<li><a href='http://betweengo.com/2007/03/28/printing-out-an-array/' rel='bookmark' title='Printing out an array'>Printing out an array</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/09/02/enums-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/' rel='bookmark' title='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='Log4j levels'>Log4j levels</a></li>
<li><a href='http://betweengo.com/2007/02/07/accessing-javabeans-getters-and-setters/' rel='bookmark' title='Accessing JavaBean&#8217;s Getters and Setters'>Accessing JavaBean&#8217;s Getters and Setters</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><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F05%2F04%2Funit-test-for-threaded-logging%2F&amp;title=Unit%20Test%20for%20Threaded%20Logging" id="wpa2a_10"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2006/04/04/howto-log-sql-on-jboss/' rel='bookmark' title='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='Log4j levels'>Log4j levels</a></li>
<li><a href='http://betweengo.com/2007/02/07/accessing-javabeans-getters-and-setters/' rel='bookmark' title='Accessing JavaBean&#8217;s Getters and Setters'>Accessing JavaBean&#8217;s Getters and Setters</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>Encode URI</title>
		<link>http://betweengo.com/2009/03/17/encode-uri/</link>
		<comments>http://betweengo.com/2009/03/17/encode-uri/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 21:14:56 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=683</guid>
		<description><![CDATA[To encode an URI you can simply use Java&#8217;s URLEncoder&#8217;s encode method which has been available since JDK 1.4. String encodedUri; try { encodedUri = URLEncoder.encode(uri, "UTF-8"); } catch (UnsupportedEncodingException exc) { // this should never happen logger.warn("UTF-8 is not a supported encoding? Not encoding for now...", exc); encodedUri = uri; } Related posts: URLEncoder.encode [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/10/31/urlencoder-encode-is-deprecated-so-what-do-i-use-for-encoding/' rel='bookmark' title='URLEncoder.encode is Deprecated So What Do I Use for Encoding?'>URLEncoder.encode is Deprecated So What Do I Use for Encoding?</a></li>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2009/02/26/sleep/' rel='bookmark' title='Sleep'>Sleep</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>To encode an URI you can simply use Java&#8217;s <a title="URLEncoder (Java 2 Platform SE v1.4.2)" href="http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLEncoder.html#encode(java.lang.String,%20java.lang.String)">URLEncoder&#8217;s encode</a> method which has been available since JDK 1.4.</p>
<pre>String encodedUri;
  try {
    encodedUri = URLEncoder.encode(uri, "UTF-8");
  }
  catch (UnsupportedEncodingException exc) {
    // this should never happen
    logger.warn("UTF-8 is not a supported encoding?  Not encoding for now...", exc);
    encodedUri = uri;
  }</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F03%2F17%2Fencode-uri%2F&amp;title=Encode%20URI" id="wpa2a_12"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/10/31/urlencoder-encode-is-deprecated-so-what-do-i-use-for-encoding/' rel='bookmark' title='URLEncoder.encode is Deprecated So What Do I Use for Encoding?'>URLEncoder.encode is Deprecated So What Do I Use for Encoding?</a></li>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2009/02/26/sleep/' rel='bookmark' title='Sleep'>Sleep</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/03/17/encode-uri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sleep</title>
		<link>http://betweengo.com/2009/02/26/sleep/</link>
		<comments>http://betweengo.com/2009/02/26/sleep/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 21:30:13 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=443</guid>
		<description><![CDATA[I always forget how to sleep or wait in Java though it&#8217;s quite easy, just use the static method Thread.sleep. For example:     // sleep the filter's wait interval     try {       Thread.sleep(filter.getWaitInterval() * 1000);     }     catch (InterruptedException exc) {       logger.error("unexpected interrupt", exc);     } Sun has a tutorial calling Pausing [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/03/17/encode-uri/' rel='bookmark' title='Encode URI'>Encode URI</a></li>
<li><a href='http://betweengo.com/2005/09/29/schedule-tasks/' rel='bookmark' title='How to schedule tasks or perform tasks repeatedly'>How to schedule tasks or perform tasks repeatedly</a></li>
<li><a href='http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/' rel='bookmark' title='Unit Test for Threaded Logging'>Unit Test for Threaded Logging</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I always forget how to sleep or wait in Java though it&#8217;s quite easy, just use the static method <a title="Thread.sleep(long)" href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long)">Thread.sleep</a>.</p>
<p>For example:</p>
<pre>    // sleep the filter's wait interval
    try {
      Thread.sleep(filter.getWaitInterval() * 1000);
    }
    catch (InterruptedException exc) {
      logger.error("unexpected interrupt", exc);
    }</pre>
<p>Sun has a tutorial calling <a title="Pausing Execution with Sleep" href="http://java.sun.com/docs/books/tutorial/essential/concurrency/sleep.html">Pausing Execution with Sleep</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F02%2F26%2Fsleep%2F&amp;title=Sleep" id="wpa2a_14"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/03/17/encode-uri/' rel='bookmark' title='Encode URI'>Encode URI</a></li>
<li><a href='http://betweengo.com/2005/09/29/schedule-tasks/' rel='bookmark' title='How to schedule tasks or perform tasks repeatedly'>How to schedule tasks or perform tasks repeatedly</a></li>
<li><a href='http://betweengo.com/2009/05/04/unit-test-for-threaded-logging/' rel='bookmark' title='Unit Test for Threaded Logging'>Unit Test for Threaded Logging</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/02/26/sleep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do Not Return From a Try Block</title>
		<link>http://betweengo.com/2009/01/29/do-not-return-from-a-try-block/</link>
		<comments>http://betweengo.com/2009/01/29/do-not-return-from-a-try-block/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 17:54:44 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=399</guid>
		<description><![CDATA[In Peter Hagar&#8217;s book, Practical Java, he recommends that you do not return from a try block.  This is because the finally block may change the return value. Traditionally, programmers think that when they execute a return statement they immediately leave the method they are executing.  In Java, this is no longer true with the [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/06/12/covariant-return-types/' rel='bookmark' title='Covariant Return Types in Java'>Covariant Return Types in Java</a></li>
<li><a href='http://betweengo.com/2008/09/01/java-method-with-generic-return-type/' rel='bookmark' title='Java Method with Generic Return Type'>Java Method with Generic Return Type</a></li>
<li><a href='http://betweengo.com/2008/09/01/effective-java-collections/' rel='bookmark' title='Effective Java Collections'>Effective Java Collections</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/0201616467?ie=UTF8&amp;tag=frankkimsride-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0201616467"><img class="size-full wp-image-402 alignright" title="Practical Java(TM) Programming Language Guide (Addison-Wesley Professional Computing Series)" src="http://betweengo.com/wp-content/uploads/2009/01/practical-java.jpg" alt="Practical Java(TM) Programming Language Guide (Addison-Wesley Professional Computing Series)" width="128" height="160" /></a>In Peter Hagar&#8217;s book, <a title="Practical Java(TM) Programming Language Guide (Addison-Wesley Professional Computing Series)" href="http://www.amazon.com/gp/product/0201616467?ie=UTF8&amp;tag=frankkimsride-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0201616467">Practical Java</a>, he recommends that you do not return from a try block.  This is because the finally block may change the return value.</p>
<blockquote><p>Traditionally, programmers think that when they execute a return statement they immediately leave the method they are executing.  In Java, this is no longer true with the usage of <tt>finally</tt>&#8230;</p>
<p>To avoid this pitfall, be sure you do not issue a <tt>return</tt>, <tt>break</tt> or <tt>continue</tt> statement inside of a <tt>try</tt> block.  If you cannot avoid this, be sure the existence of a <tt>finally</tt> does not change the return value of the method.  This particular problem can arise during maintenance of your code, even with careful design and implementation.  Good comments and careful code reviews ward it off.</p>
<p><a href="http://books.google.com/books?id=iWPeqljHNcoC&amp;pg=PA79">Practical Java Programming Language &#8230; &#8211; Google Book Search</a></p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F01%2F29%2Fdo-not-return-from-a-try-block%2F&amp;title=Do%20Not%20Return%20From%20a%20Try%20Block" id="wpa2a_16"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/06/12/covariant-return-types/' rel='bookmark' title='Covariant Return Types in Java'>Covariant Return Types in Java</a></li>
<li><a href='http://betweengo.com/2008/09/01/java-method-with-generic-return-type/' rel='bookmark' title='Java Method with Generic Return Type'>Java Method with Generic Return Type</a></li>
<li><a href='http://betweengo.com/2008/09/01/effective-java-collections/' rel='bookmark' title='Effective Java Collections'>Effective Java Collections</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/01/29/do-not-return-from-a-try-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL.equals and hashCode make blocking Internet connections</title>
		<link>http://betweengo.com/2009/01/15/urlequals-and-hashcode-make-blocking-internet-connections/</link>
		<comments>http://betweengo.com/2009/01/15/urlequals-and-hashcode-make-blocking-internet-connections/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 15:03:45 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=396</guid>
		<description><![CDATA[Who knew that something as innocent as java.net.URL.equals and hashCode would make blocking Internet connections? The javadoc of URL.equals says: &#8220;Since hosts comparison requires name resolution, this operation is a blocking operation.&#8221;, but who reads the documentation of equals?  There is a general contract around equals.  Joshua Bloch writes in Effective Java: &#8220;Don&#8217;t write an [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2005/09/14/java-filenotfoundexception-for-valid-url/' rel='bookmark' title='java.io.FileNotFoundException for valid URL'>java.io.FileNotFoundException for valid URL</a></li>
<li><a href='http://betweengo.com/2009/08/11/javascript-invalid-argument-internet-explorer-only/' rel='bookmark' title='JavaScript Invalid Argument in Internet Explorer Only'>JavaScript Invalid Argument in Internet Explorer Only</a></li>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Who knew that something as innocent as java.net.URL.equals and hashCode would make blocking Internet connections?</p>
<blockquote><p>The javadoc of <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html#equals%28java.lang.Object%29">URL.equals</a> says: &#8220;Since hosts comparison requires name resolution, this operation is a blocking operation.&#8221;, but who reads the documentation of equals?  There is a general contract around equals.  Joshua Bloch writes in <a href="http://java.sun.com/docs/books/effective/">Effective Java</a>: &#8220;Don&#8217;t write an equals that relies on unreliable resources&#8221; (<a href="http://java.sun.com/developer/Books/effectivejava/Chapter3.pdf">Chapter 3, page 34</a>). Hey Sun, as far as I know, the Internet is not reliable <img src='http://betweengo.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a href="http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html">Eclipse and Java Blog by Michael Scharf: java.net.URL.equals and hashCode make (blocking) Internet connections&#8230;.</a></p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F01%2F15%2Furlequals-and-hashcode-make-blocking-internet-connections%2F&amp;title=URL.equals%20and%20hashCode%20make%20blocking%20Internet%20connections" id="wpa2a_18"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2005/09/14/java-filenotfoundexception-for-valid-url/' rel='bookmark' title='java.io.FileNotFoundException for valid URL'>java.io.FileNotFoundException for valid URL</a></li>
<li><a href='http://betweengo.com/2009/08/11/javascript-invalid-argument-internet-explorer-only/' rel='bookmark' title='JavaScript Invalid Argument in Internet Explorer Only'>JavaScript Invalid Argument in Internet Explorer Only</a></li>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/01/15/urlequals-and-hashcode-make-blocking-internet-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ServletException root cause</title>
		<link>http://betweengo.com/2008/12/30/servletexception-root-cause/</link>
		<comments>http://betweengo.com/2008/12/30/servletexception-root-cause/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 21:46:20 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Java SE]]></category>
		<category><![CDATA[j2ee]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=380</guid>
		<description><![CDATA[Java&#8217;s Throwable class defines the getCause() method for accessing the cause of the exception.  This method returns a Throwable object which itself could have a cause.  By traversing down this chain you can find the root cause of an exception. However for some unknown reason in ServletException the getRootCause() method was added.  Therefore when trying [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/03/02/dynamically-generate-sitemapxml/' rel='bookmark' title='Dynamically generate sitemap.xml'>Dynamically generate sitemap.xml</a></li>
<li><a href='http://betweengo.com/2007/02/06/accessing-class-from-static-method-within-class/' rel='bookmark' title='Accessing the class from a static method which the class owns'>Accessing the class from a static method which the class owns</a></li>
<li><a href='http://betweengo.com/2009/03/02/mod_rewrite-to-bypass-security/' rel='bookmark' title='mod_rewrite to bypass security'>mod_rewrite to bypass security</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Java&#8217;s <a title="Throwable (Java 2 Platform SE 5.0)" href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Throwable.html">Throwable</a> class defines the <a title="Throwable getCause()" href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Throwable.html#getCause()">getCause()</a> method for accessing the cause of the exception.  This method returns a Throwable object which itself could have a cause.  By traversing down this chain you can find the root cause of an exception.</p>
<p>However for some unknown reason in <a title="ServletException (Java EE 5)" href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletException.html">ServletException</a> the <a title="ServletException getRootCause()" href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletException.html#getRootCause()">getRootCause()</a> method was added.  Therefore when trying to determine the root cause of an exception in a J2EE environment one has to check what type of exception you have.  I do this in the following code.</p>
<pre>  /**
   * Logs all the nested exceptions for the specified exception.
   *
   * @param ex the exception
   */
  protected void logNestedExceptions(Throwable ex) {
    int count = 1;
    Throwable cause = getCause(ex);
    while (cause != null) {
      logger.error("Nested Exception " + count, cause);
      cause = getCause(cause);
      count++;
    }
  }

  /**
   * Gets the cause of the exception.
   *
   * @param ex the exception
   * @return the cause
   */
  protected Throwable getCause(Throwable ex) {
    Throwable cause;
    if (ex instanceof ServletException) {
      ServletException sex = (ServletException) ex;
      cause = sex.getRootCause();
    }
    else {
      cause = ex.getCause();
    }
    return cause;
  }</pre>
<p>Finally you need to configure web.xml to use your SiteMap servlet.</p>
<pre>&lt;servlet&gt;
    &lt;servlet-name&gt;sitemap&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.betweengo.servlet.SiteMap&lt;/servlet-class&gt;
&lt;/servlet&gt;

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;sitemap&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/sitemap.xml&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2008%2F12%2F30%2Fservletexception-root-cause%2F&amp;title=ServletException%20root%20cause" id="wpa2a_20"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/03/02/dynamically-generate-sitemapxml/' rel='bookmark' title='Dynamically generate sitemap.xml'>Dynamically generate sitemap.xml</a></li>
<li><a href='http://betweengo.com/2007/02/06/accessing-class-from-static-method-within-class/' rel='bookmark' title='Accessing the class from a static method which the class owns'>Accessing the class from a static method which the class owns</a></li>
<li><a href='http://betweengo.com/2009/03/02/mod_rewrite-to-bypass-security/' rel='bookmark' title='mod_rewrite to bypass security'>mod_rewrite to bypass security</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/12/30/servletexception-root-cause/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! -->
