<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Mike`s Blog - Java</title>
    <link>http://www.java-community.de/</link>
    <description>Keep it simple, stupid!</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Consolas</title>
    <link>http://www.java-community.de/archives/142-Consolas.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/142-Consolas.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=142</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=142</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;a href=&quot;http://hivelogic.com/articles/top-10-programming-fonts&quot;&gt;Dan&lt;/a&gt; writes about it, &lt;a href=&quot;http://www.smashingmagazine.com/2010/01/18/25-new-high-quality-free-fonts/&quot;&gt;Sven &amp;amp; Vitaly&lt;/a&gt; are writing about it, &lt;a href=&quot;http://www.codinghorror.com/blog/archives/000356.html&quot;&gt;Jeff&lt;/a&gt;, &lt;a href=&quot;http://www.hanselman.com/blog/UsingConsolasAsTheWindowsConsoleFont.aspx&quot;&gt;Scott&lt;/a&gt; and &lt;a href=&quot;http://www.furrygoat.com/2005/08/07/longhorn-fonts/&quot;&gt;Steve&lt;/a&gt; found it years ago and are probably using it ever since. Many &lt;a href=&quot;http://stackoverflow.com/questions/4689/recommended-fonts-for-programming-closed&quot;&gt;StackOverflow&lt;/a&gt; users do it as well. So why don&#039;t I?&lt;br /&gt;
&lt;br /&gt;
Well, now I did and so far, it&#039;s promosing.&lt;br /&gt;
I switched &lt;b&gt;from Courier New to Consolas&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Besides gaining some more space, it really looks much nicer.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- s9ymdb:129 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;557&quot; height=&quot;360&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/ConsolasCourierNewComparison3.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
But compare for yourself:&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/ConsolasCourierNewComparison.png&#039;&gt;&lt;!-- s9ymdb:128 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;62&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/ConsolasCourierNewComparison.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Consolas is a commercial font and if you&#039;re on Windows and have any of the Microsoft products installed, chances are that you already have Consolas installed on your system. If you don&#039;t, check out the other programming fonts features on &lt;a href=&quot;http://www.smashingmagazine.com/2010/01/18/25-new-high-quality-free-fonts/&quot;&gt;Smashing Magazines&lt;/a&gt; articles.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sat, 23 Jan 2010 15:27:12 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/142-guid.html</guid>
    
</item>
<item>
    <title>Tracing with JDK Logging</title>
    <link>http://www.java-community.de/archives/141-Tracing-with-JDK-Logging.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/141-Tracing-with-JDK-Logging.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=141</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=141</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Imagine you&#039;re writing a small test case to check out some &lt;a href=&quot;http://ibatis.apache.org/&quot;&gt;new library or version&lt;/a&gt; or cool new technology. &lt;br /&gt;
&lt;br /&gt;
You&#039;re eager to try out that stuff, learn how it works and how to use it.&lt;br /&gt;
But, unfortunately, &lt;strong&gt;something goes wrong&lt;/strong&gt; and you see the following:&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/ConsoleLogging0.PNG&#039;&gt;&lt;!-- s9ymdb:125 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;590&quot; height=&quot;201&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/ConsoleLogging0.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Exactly, &lt;strong&gt;you see nothing&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
You didn&#039;t quite read the quick start tutorial carefully and you must have missed something at the configuration file or at the code. You&#039;re not sure - all you get is a mysterious exception or the code just doesn&#039;t do anything visible, as it does here. At this point, &lt;strong&gt;you just want it to print out what&#039;s going on, anything&lt;/strong&gt; - you would like to have some fine-grained logging output on your console.&lt;br /&gt;
&lt;br /&gt;
You know it&#039;s a pain to set up all that logging facility stuff correctly and your loved pre-configured &lt;tt&gt;log4j.xml&lt;/tt&gt; with all the handy shortcuts is on the other machine. Okay, all you needed was just the whole debug output of that library to get it to know better and see what&#039;s going wrong.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
The project already has commons-logging on it&#039;s classpath, but gladly no implementation, so it&#039;s using JDK Logging as a backend. &lt;a href=&quot;http://www.slf4j.org/&quot;&gt;Commons-logging should die anyway.&lt;/a&gt; &lt;a href=&quot;http://wiki.apache.org/commons/Logging/UndeployMemoryLeak&quot;&gt;Really.&lt;/a&gt; &lt;a href=&quot;http://www.mhaller.de/archives/140-Memory-leaks-et-alii.html&quot;&gt;I mean it.&lt;/a&gt;. You can see that it&#039;s using JDK Logging since the console output is two-line formatted like the following snippet. The name of the logger is the adapter used to bridge between Commons-Logging and JDK Logging, and in this case it&#039;s &lt;a href=&quot;http://ibatis.apache.org/&quot;&gt;iBatis 3&lt;/a&gt; &lt;tt&gt;JakartaCommonsLoggingImpl&lt;/tt&gt;.

&lt;pre&gt;
16.01.2010 16:20:27 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl debug
FEIN: PooledDataSource forcefully closed/removed all connections.
16.01.2010 16:20:27 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl debug
FEIN: PooledDataSource forcefully closed/removed all connections.
&lt;/pre&gt;

&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
Now, back to the example which is currently not printing out anything. To get decent logging output to your console with standard JDK logging, you either have to create a &lt;tt&gt;logging.properties&lt;/tt&gt; and fill it with some obscure properties like &lt;tt&gt;.handlers&lt;/tt&gt; and anyway you don&#039;t know how to configure that correctly. &lt;strong&gt;Isn&#039;t there anywhere a good and quick to find example for that?&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
I started using this code, which seems to be the simplest possible way of getting something to the console quickly.&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;
Logger rootLogger = LogManager.getLogManager().getLogger(&quot;&quot;);
Handler handler = new ConsoleHandler();
handler.setLevel(Level.ALL);
rootLogger.addHandler(handler);
rootLogger.setLevel(Level.ALL);
&lt;/pre&gt;&lt;br /&gt;
As you can see, &lt;strong&gt;there&#039;s some output now&lt;/strong&gt;.&lt;br /&gt;
But it&#039;s red (System.err stream) and there are too many newlines for my taste.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
It uses the root logger, identified by the empty string &lt;tt&gt;(&quot;&quot;)&lt;/tt&gt;, adds a Handler, which is responsible for printing the log messages to the console. Other Handlers write the log messages to the file system or send it over the wire. The Level is the log level, which determines which log messages are being sent to the Handler and which are ignored. For example, you can set it to &lt;tt&gt;INFO&lt;/tt&gt;, so only Info, Warning, Error-level log messages are being printed. Log messages of level Debug and Trace are being ignored.
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/ConsoleLogging1.PNG&#039;&gt;&lt;!-- s9ymdb:126 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;608&quot; height=&quot;203&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/ConsoleLogging1.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Since &lt;strong&gt;I don&#039;t like the output being spread over two lines&lt;/strong&gt; (it makes it reading much harder, especially if your output is tabular like like the iBatis output for &lt;tt&gt;java.sql&lt;/tt&gt; statements. So I ended up with something like this, to format the lines into a single line and get it to print out on System output console instead of System error:&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;
Logger logger = LogManager.getLogManager().getLogger(&quot;&quot;);
class RedirectingConsoleHandler extends ConsoleHandler {
	public RedirectingConsoleHandler(OutputStream target) {
		super();
		setOutputStream(target);
	}
}
;
Handler handler = new RedirectingConsoleHandler(System.out);
handler.setLevel(Level.ALL);
// handler.setFormatter(new XMLFormatter());
Formatter newFormatter = new Formatter() {

	@Override
	public String format(LogRecord record) {
		return String.format(&quot;%tT %-40.40s %-8.8s %s\n&quot;, new Date(),
				record.getLoggerName(), record.getLevel().getLocalizedName(),
				formatMessage(record));
	}
};
handler.setFormatter(newFormatter);
logger.addHandler(handler);
logger.setLevel(Level.ALL);
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
This code will &lt;strong&gt;redirect the output&lt;/strong&gt; of the Logging facility to a configure stream, in this case the &lt;tt&gt;System.out&lt;/tt&gt; stream. That&#039;s the &lt;tt&gt;RedirectingConsoleHandler&lt;/tt&gt; class is for. The anonymous &lt;tt&gt;Formatter&lt;/tt&gt; class will format the log message, e.g. add a timestamp, the name of the logger, on which level it was logged and the actual log message of the log record and &lt;strong&gt;only use one single line&lt;/strong&gt;. The output looks much more how I like it:&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/ConsoleLogging2.PNG&#039;&gt;&lt;!-- s9ymdb:127 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;654&quot; height=&quot;203&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/ConsoleLogging2.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;(Yeah, i know the SQL statements are truncated at the example screenshot. But in modern times, with larger screens, it&#039;s &lt;strong&gt;no problem since the consoles are much broader than the space available on my blog&lt;/strong&gt;)&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Note: this is only used for testing, not for production, not for performance measurements, not for audit logging. This kind of logging is only meant for technical debug tracing. Logging is among the Top10 unknown performance killers in enterprise applications.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sat, 16 Jan 2010 16:02:01 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/141-guid.html</guid>
    
</item>
<item>
    <title>Memory leaks et alii</title>
    <link>http://www.java-community.de/archives/140-Memory-leaks-et-alii.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/140-Memory-leaks-et-alii.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=140</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=140</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;div class=&quot;serendipity_imageComment_center&quot; style=&quot;width: 400px&quot;&gt;&lt;div class=&quot;serendipity_imageComment_img&quot;&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/Articles/Java/PrevXWSTimerThreadNotCancelled2.png&#039;&gt;&lt;!-- s9ymdb:115 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;400&quot; height=&quot;276&quot;  src=&quot;http://www.java-community.de/uploads/Articles/Java/PrevXWSTimerThreadNotCancelled2.png&quot; alt=&quot;Leaky web application&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;serendipity_imageComment_txt&quot;&gt;Leaky web application&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
One of the most common problems in building enterprise web applications are leaks. A leak is consumption of a resource by a program where the program is unable to release the resource. Leaks come in various types, such as&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;Memory leaks&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Thread and ThreadLocal leaks&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;ClassLoader leaks&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;System resource leaks&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Connection leaks&lt;/li&gt;&lt;br /&gt;
&lt;/ul&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/140-Memory-leaks-et-alii.html#extended&quot;&gt;Continue reading &quot;Memory leaks et alii&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 30 Dec 2009 14:30:15 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/140-guid.html</guid>
    
</item>
<item>
    <title>Per-unit-test profiling</title>
    <link>http://www.java-community.de/archives/138-Per-unit-test-profiling.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/138-Per-unit-test-profiling.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=138</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=138</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    As a preparation for long-term performance measurements, (sometimes called &lt;a href=&quot;http://lmgtfy.com/?q=Continuous+Performance+Management&quot;&gt;Continuous Performance Management&lt;/a&gt; or CPM), I tried to automate the creation of &lt;a href=&quot;http://www.ej-technologies.com/products/jprofiler/overview.html&quot;&gt;JProfiler&lt;/a&gt; profiling snapshots and, along the way, came up with the following side product: &lt;strong&gt;Automated per-test method profiling&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
Basically, the idea is to go from here:&lt;br /&gt;
&lt;p&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/JUnitJProfilerMySQL1.PNG&#039;&gt;&lt;!-- s9ymdb:88 --&gt;&lt;img class=&quot;serendipity_image_left&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/JUnitJProfilerMySQL1.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;to here&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/JUnitJProfilerMySQL6.PNG&#039;&gt;&lt;!-- s9ymdb:93 --&gt;&lt;img class=&quot;serendipity_image_left&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/JUnitJProfilerMySQL6.PNG&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;&lt;i&gt;&quot;What&#039;s so great about this?&quot;&lt;/i&gt;, you wonder?&lt;/p&gt;&lt;br /&gt;
Read the &lt;a href=&quot;http://www.java-community.de/archives/138-Per-unit-test-profiling.html&quot;&gt;full article&lt;/a&gt; for fancy screenshots and code snippets.&lt;br /&gt;
&lt;br /&gt;
(Btw, the test cases are due to &lt;a href=&quot;http://stackoverflow.com/questions/1672415/charat-or-substring-which-is-faster&quot;&gt;this question&lt;/a&gt;. Usually, i don&#039;t do String performance tests &lt;img src=&quot;http://www.java-community.de/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/138-Per-unit-test-profiling.html#extended&quot;&gt;Continue reading &quot;Per-unit-test profiling&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 16 Nov 2009 23:01:55 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/138-guid.html</guid>
    
</item>
<item>
    <title>Top10 programming controversial</title>
    <link>http://www.java-community.de/archives/136-Top10-programming-controversial.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/136-Top10-programming-controversial.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=136</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=136</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    There&#039;s a Stackoverflow question about controversial programming opinions:&lt;br /&gt;
The top ten as voted by the SO community:&lt;br /&gt;
&lt;br /&gt;
1. The only &quot;best practice&quot; you should be using all the time is &lt;strong&gt;Use Your Brain&lt;/strong&gt;&lt;br /&gt;
2. Most comments in code are in fact a pernicious form of &lt;strong&gt;code duplication&lt;/strong&gt;&lt;br /&gt;
3. Programmers who don&#039;t code in their spare time for fun, will &lt;strong&gt;never become as good&lt;/strong&gt; as those that do&lt;br /&gt;
4. &lt;strong&gt;Not all programmers are created equal&lt;/strong&gt;&lt;br /&gt;
5. &lt;strong&gt;XML is highly overrated&lt;/strong&gt;&lt;br /&gt;
6. &lt;strong&gt;&quot;Googling it&quot;&lt;/strong&gt; is okay!&lt;br /&gt;
7. I fail to understand why people think that &lt;strong&gt;Java&lt;/strong&gt; is absolutely the &lt;strong&gt;best &quot;first&quot; programming&lt;/strong&gt; language to be taught in universities&lt;br /&gt;
8. If you &lt;strong&gt;only&lt;/strong&gt; know *one language*, no matter how well you know it, you&#039;re &lt;strong&gt;not a great programmer&lt;/strong&gt;&lt;br /&gt;
9. &lt;strong&gt;Performance does matter&lt;/strong&gt;&lt;br /&gt;
10. &lt;strong&gt;The Business Apps farce&lt;/strong&gt; (You have to &lt;a href=&quot;http://stackoverflow.com/questions/406760/whats-your-most-controversial-programming-opinion/406825#406825&quot;&gt;read it&lt;/a&gt; to understand)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 04 Nov 2009 11:02:37 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/136-guid.html</guid>
    
</item>
<item>
    <title>Where have all the threads gone?</title>
    <link>http://www.java-community.de/archives/133-Where-have-all-the-threads-gone.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/133-Where-have-all-the-threads-gone.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=133</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=133</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Recently, we got a nasty error in the log file:&lt;br /&gt;
&lt;pre&gt;
java.lang.OutOfMemoryError: unable to create new native thread
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Although we had specified &lt;code&gt;-XX:HeapDumpOnOutOfMemoryError&lt;/code&gt;, this does not include dumping the heap to disk when the heap is not involved in an OutOfMemoryError. In this case, the JVM was unable to create new threads as the limit of threads was reached.&lt;br /&gt;
&lt;br /&gt;
So, the question is: &lt;b&gt;How many threads can be created?&lt;/b&gt;&lt;br /&gt;
The answer is, as usual: &lt;b&gt;It depends!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/threads-memory.png&#039;&gt;&lt;!-- s9ymdb:82 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;110&quot; height=&quot;80&quot; style=&quot;float: right; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/threads-memory.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/133-Where-have-all-the-threads-gone.html#extended&quot;&gt;Continue reading &quot;Where have all the threads gone?&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 06 Jul 2009 15:37:04 +0200</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/133-guid.html</guid>
    
</item>
<item>
    <title>My Own Twitter Client</title>
    <link>http://www.java-community.de/archives/130-My-Own-Twitter-Client.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/130-My-Own-Twitter-Client.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=130</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=130</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Using &lt;a href=&quot;http://yusuke.homeip.net/twitter4j/&quot;&gt;twitter4j&lt;/a&gt;, it&#039;s pretty easy to hack together a new &lt;a href=&quot;https://twitter.com/&quot;&gt;Twitter&lt;/a&gt; desktop client. What I wanted to do is to have search capabilities and have all the tweets in a local database, so I could have a look and work with the messages people write even when i&#039;m offline (which never happens anyway, but just in case).&lt;br /&gt;
&lt;br /&gt;
So, taking &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;Eclipse RCP&lt;/a&gt;, munching it with twitter4j, adding a bit of &lt;a href=&quot;http://db.apache.org/derby/&quot;&gt;Apache Derby&lt;/a&gt; and other stuff, I ended up with the following prototype in a couple of hours:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- s9ymdb:80 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;526&quot; height=&quot;389&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/sometwitter1.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
It has a &lt;b&gt;virtual table&lt;/b&gt;, so it loads tweets on-demand from the local database when you scroll down. It only reloads the latest 20 tweets from Twitter.com in online mode. There is an offline-mode to decrease the amount of network bandwidth and service utilization. Twitter is already pretty slow. The client &lt;b&gt;caches all the profile images&lt;/b&gt; for faster loading. It displays the time of the tweet and &lt;b&gt;highlights URLs&lt;/b&gt;. I had a feature in it which &lt;b&gt;resolves shortened URLs&lt;/b&gt; and displays the real ones on hover, but i disabled it as I&#039;ve got problems displaying a nice hover. Hover&#039;s in Eclipse RCP/SWT/JFace just don&#039;t look very nice, compared to all the new Web 2.0 or Mac designs found in modern apps today.&lt;br /&gt;
&lt;br /&gt;
What other features could be put into yet-another-twitter-client? Tag clouds? URL clouds? Charts? Google Maps? Automatic translations like Babelfish?&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sun, 17 May 2009 22:01:31 +0200</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/130-guid.html</guid>
    
</item>
<item>
    <title>In-Memory Databases</title>
    <link>http://www.java-community.de/archives/127-In-Memory-Databases.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/127-In-Memory-Databases.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=127</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=127</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    For testing and demo installation purposes, or for in-memory data aggregation operations, it may be suitable to use a &quot;nearly full-blown&quot; database. They&#039;re called in-memory databases and there are some implementation for the Java platform which are used since years:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;a href=&quot;http://www.hsqldb.org/&quot;&gt;hsqldb&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
One of the first 100% Java implementations of a SQL relational database management system. Like all the others, it can be run from a persistent file system or run in-memory. It&#039;s fast, it has a very low footprint and it can be embedded in any Java application. Hsqldb was my favourite for years to use in unit tests and integration tests. It can also read and write CSV files.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;a href=&quot;http://www.h2database.com/&quot;&gt;H2Database&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
The successor of hsqldb is H2. It&#039;s better documented, performs even better and has more options. There&#039;s even a web console where you can work with the data in the in-memory database like you can do with phpMyAdmin. Great thing. I&#039;m currently using H2 at home and at work.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;a href=&quot;http://blogs.sun.com/kah/entry/derby_10_5_preview_in&quot;&gt;Derby&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
Derby, the Java database, now also supports the in-memory protocol. That&#039;s great to hear and an additional argument for switching to Derby as the default implementation for databases in embedded versions or for demo installations.&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 05 May 2009 21:58:48 +0200</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/127-guid.html</guid>
    
</item>
<item>
    <title>Monitoring code quality</title>
    <link>http://www.java-community.de/archives/126-Monitoring-code-quality.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/126-Monitoring-code-quality.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=126</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=126</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://sonar.codehaus.org/&#039; target=&quot;_blank&quot;&gt;&lt;!-- s9ymdb:78 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;100&quot; height=&quot;54&quot; style=&quot;float: right; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/sonar-blackonwhite.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;I&#039;ve been looking for tools to measure and visualize code quality for some time now. Every once in a while, there&#039;s some tool which aggregates results from quality measurements and monitoring tools like &lt;a href=&quot;http://pmd.sourceforge.net/&quot;&gt;PMD&lt;/a&gt;, &lt;a href=&quot;http://findbugs.sourceforge.net/&quot;&gt;Findbugs&lt;/a&gt;, &lt;a href=&quot;http://checkstyle.sourceforge.net/&quot;&gt;Checkstyle&lt;/a&gt; etc. but I haven&#039;t yet found something which attracted my interest.&lt;br /&gt;
&lt;br /&gt;
Read on to find out about Codehaus&#039; Sonar.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;serendipity_imageComment_center&quot; style=&quot;width: 320px&quot;&gt;&lt;div class=&quot;serendipity_imageComment_img&quot;&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&quot;http://www.java-community.de/archives/126-Monitoring-code-quality.html&quot;&gt;&lt;!-- s9ymdb:73 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;320&quot; height=&quot;182&quot;  src=&quot;http://www.java-community.de/uploads/Sonar6_Small.png&quot; alt=&quot;Codehaus Sonar for code quality showing Hotspots&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;serendipity_imageComment_txt&quot;&gt;Codehaus Sonar for code quality&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/126-Monitoring-code-quality.html#extended&quot;&gt;Continue reading &quot;Monitoring code quality&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 26 Apr 2009 13:35:02 +0200</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/126-guid.html</guid>
    
</item>
<item>
    <title>Java Class Popularity</title>
    <link>http://www.java-community.de/archives/125-Java-Class-Popularity.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/125-Java-Class-Popularity.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=125</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=125</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Taken from a heap dump of a JBoss Application Server with some applications deployed, i&#039;ve look at the number of objects in the heap and compiled a &#039;popularity list&#039; accordingly:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;java.util&lt;/b&gt;&lt;br /&gt;
1. ArrayList&lt;br /&gt;
2. HashMap&lt;br /&gt;
3. TreeMap&lt;br /&gt;
4. Vector&lt;br /&gt;
5. Hashtable&lt;br /&gt;
6. LinkedList&lt;br /&gt;
7. HashSet&lt;br /&gt;
8. &lt;a href=&quot;http://java.sun.com/javase/6/docs/api/java/util/WeakHashMap.html&quot;&gt;WeakHashMap&lt;/a&gt;&lt;br /&gt;
9. TreeSet&lt;br /&gt;
&lt;br /&gt;
Read on to see the full list. I&#039;ve marked some classes which I find interesting enough to have a second look on them. Know your library.&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/125-Java-Class-Popularity.html#extended&quot;&gt;Continue reading &quot;Java Class Popularity&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 17 Apr 2009 08:00:00 +0200</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/125-guid.html</guid>
    
</item>
<item>
    <title>Date ranges in Lucene</title>
    <link>http://www.java-community.de/archives/119-Date-ranges-in-Lucene.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/119-Date-ranges-in-Lucene.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=119</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=119</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    Lucene is a &lt;i&gt;very efficient and fast&lt;/i&gt; Java search engine. Once indexed, any object can be found by looking for attribute matches. An object in Lucene is called &lt;b&gt;Document&lt;/b&gt; and its attributes are called &lt;b&gt;Field&lt;/b&gt;s. Lucene uses &lt;b&gt;Query&lt;/b&gt; and &lt;b&gt;Filter&lt;/b&gt; objects to narrow down the search to what the user wants to find. A Query makes the amount of data to be searched smaller while a Filter is used for more fine-grained control over what a search result shall include. Queries are more memory-hungry than filters, but for the usual use cases, both are very good.&lt;br /&gt;
&lt;br /&gt;
In this post, I&#039;d like to show how you can search for &lt;b&gt;Date and Time ranges&lt;/b&gt;, for example modification dates of files. I&#039;d like to find all files on my local file system which were modified in April 2009.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/119-Date-ranges-in-Lucene.html#extended&quot;&gt;Continue reading &quot;Date ranges in Lucene&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 04 Apr 2009 13:23:59 +0200</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/119-guid.html</guid>
    
</item>
<item>
    <title>Extending SQuirreL with plugins</title>
    <link>http://www.java-community.de/archives/111-Extending-SQuirreL-with-plugins.html</link>
            <category>Java</category>
            <category>SQL</category>
    
    <comments>http://www.java-community.de/archives/111-Extending-SQuirreL-with-plugins.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=111</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=111</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;a href=&quot;http://www.squirrelsql.org/&quot;&gt;SQuirreL&lt;/a&gt; is a 100% pure-Java implementation of a generic SQL client. You can browse and analyse any database which provides a JDBC driver. You can execute any kind of SQL statements. SQuirreL provides a plugin mechanism to hook in additional features. The default installation comes with a lot of plugins, for example MySQL-specific plugins, code completion, data import plugins and more.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.flickr.com/photos/mhaller1979/3335269794/&quot; title=&quot;Squirrel: I&#039;m watching you! von mhaller1979 bei Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3595/3335269794_ca8ea76e08_m.jpg&quot; width=&quot;240&quot; height=&quot;157&quot; alt=&quot;Squirrel: I&#039;m watching you!&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In this article, I&#039;d like to show you how to write your own plugin for SQuirreL and what you need to do to set up your development environment. I&#039;ll implement two features for indexing tables and their content into an &lt;a href=&quot;http://lucene.apache.org/&quot;&gt;Apache Lucene&lt;/a&gt; index and to make it searchable using full-text search.&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/111-Extending-SQuirreL-with-plugins.html#extended&quot;&gt;Continue reading &quot;Extending SQuirreL with plugins&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 07 Mar 2009 16:33:16 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/111-guid.html</guid>
    
</item>
<item>
    <title>XML Schema Validation done right</title>
    <link>http://www.java-community.de/archives/110-XML-Schema-Validation-done-right.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/110-XML-Schema-Validation-done-right.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=110</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=110</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    To validate an XML document against an XSD Schema, Java 5 offers standard functionality with the built-in JAXP API. To do that, first create the Schema object as follows:&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;
URL resource = getClass().getResource( SCHEMA_FILE );
SchemaFactory factory = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI );
Schema schema = factory.newSchema( resource );
&lt;/pre&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/110-XML-Schema-Validation-done-right.html#extended&quot;&gt;Continue reading &quot;XML Schema Validation done right&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 04 Mar 2009 13:06:49 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/110-guid.html</guid>
    
</item>
<item>
    <title>Dynamic Applications</title>
    <link>http://www.java-community.de/archives/102-Dynamic-Applications.html</link>
            <category>Java</category>
            <category>Selfmade</category>
            <category>Work</category>
    
    <comments>http://www.java-community.de/archives/102-Dynamic-Applications.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=102</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=102</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    What are Dynamic Applications?&lt;br /&gt;
&lt;br /&gt;
It&#039;s the software-way of &lt;b&gt;putting the business people back in charge&lt;/b&gt;. Today, changes to enterprise business software takes ages to get into production. Endless analyze-redesign-implement-test-deploy cycles affecting multiple stakeholders: IT, QA, vendors and of course the sponsor.&lt;br /&gt;
&lt;br /&gt;
How would it feel if the first three stakeholders could be removed from the process, once the application has been finalized in its initial state? How about giving the sponsor or business department the ability to &lt;b&gt;adapt and change applications on their own&lt;/b&gt;? How about giving them the &lt;b&gt;ability to change complex business logic&lt;/b&gt;, fine-tune parameters and model work flow to reflect the reality when and as soon as it changes?&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/102-Dynamic-Applications.html#extended&quot;&gt;Continue reading &quot;Dynamic Applications&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 16 Feb 2009 00:15:00 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/102-guid.html</guid>
    
</item>
<item>
    <title>Dumb Annotations</title>
    <link>http://www.java-community.de/archives/100-Dumb-Annotations.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/100-Dumb-Annotations.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=100</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=100</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    I just read the article about the new &lt;a href=&quot;http://java.dzone.com/articles/an-overview-servlet-30&quot;&gt;Java Servlet 3.0 Specification over at dZone&lt;/a&gt; when it once again struck me: Annotations!&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/100-Dumb-Annotations.html#extended&quot;&gt;Continue reading &quot;Dumb Annotations&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 22 Jan 2009 10:57:02 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/100-guid.html</guid>
    
</item>

</channel>
</rss>