<?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>KYRIAKOS ANASTASAKIS - ΚΥΡΙΑΚΟΣ ΑΝΑΣΤΑΣΑΚΗΣ &#187; java</title>
	<atom:link href="http://kyriakos.anastasakis.net/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://kyriakos.anastasakis.net</link>
	<description></description>
	<lastBuildDate>Wed, 28 Dec 2011 08:42:23 +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>org.htmlparser &#8220;Memory Leak&#8221;?</title>
		<link>http://kyriakos.anastasakis.net/2011/06/27/org-htmlparser-memory-leak/</link>
		<comments>http://kyriakos.anastasakis.net/2011/06/27/org-htmlparser-memory-leak/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 22:49:40 +0000</pubDate>
		<dc:creator>Kyriakos Anastasakis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[import_linkedin]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://kyriakos.anastasakis.net/?p=286</guid>
		<description><![CDATA[I have developed a component in Java that requires an HTML parser. The component goes through around 2000 webpages and gets some data. It was quite easy to implement it using the org.htmlParser (http://htmlparser.sourceforge.net/). Even though some of the webpages are quite big (some of a size of up to a few hunders of MBs) [...]]]></description>
			<content:encoded><![CDATA[<p>I have developed a component in Java that requires an HTML parser. The component goes through around 2000 webpages and gets some data.</p>
<p>It was quite easy to implement it using the org.htmlParser (<a href="http://htmlparser.sourceforge.net/" target="_blank">http://htmlparser.sourceforge.net/</a>). Even though some of the webpages are quite big (some of a size of up to a few hunders of MBs) the memory of the component seemed to grow inexplicably leading to a Java heap out of memory error. I spent a good deal of time trying to figure out the source of the leak thinking it was my code. After a few attempts to identify the problem, I used the IMB Support Assistant workbench and took a heap dump using the command:</p>
<p><code>jmap -dump:format=b,file=heap.bin processID<br />
</code></p>
<p>I was able to identify a lot of Finalizer objects referencing the org.htmlParser.lexer. This looks like a memory leak, where the garbage collector can&#8217;t collect the objects properly?</p>
<p>Well.. the fact of the matter is I haven&#8217;t spent an enormous amount of time reading the documentation and/or source code of the project.  It seems there is a <em>close() </em>method that can be called on the Page reference of the lexer and I haven&#8217;t used it. So, at the end of my method that does the parsing I added:</p>
<p><code>parser.getLexer().getPage().close();<br />
parser.setInputHTML("");</code></p>
<p>The first statement closes the Page object. I added the second statement just to be on the safe side, even though it&#8217;s probably redundant.</p>
<p>And the &#8220;Memory Leak&#8221; seems to have vanished&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://kyriakos.anastasakis.net/2011/06/27/org-htmlparser-memory-leak/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Visual Editor on Eclipse Helios</title>
		<link>http://kyriakos.anastasakis.net/2010/11/13/installing-visual-editor-on-eclipse-helios/</link>
		<comments>http://kyriakos.anastasakis.net/2010/11/13/installing-visual-editor-on-eclipse-helios/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 13:59:43 +0000</pubDate>
		<dc:creator>Kyriakos Anastasakis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://kyriakos.anastasakis.net/?p=260</guid>
		<description><![CDATA[I recently wanted to install Visual Editor on Eclipse Helios. Apparently there is an nice way, which works like a charm for me. For more details you can have a look here: http://sourceforge.jp/projects/tmdmaker/wiki/VisualEditor1.4.0ForHelios]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to install Visual Editor on Eclipse Helios. Apparently there is an nice way, which works like a charm for me. For more details you can have a look here: <a href="http://sourceforge.jp/projects/tmdmaker/wiki/VisualEditor1.4.0ForHelios">http://sourceforge.jp/projects/tmdmaker/wiki/VisualEditor1.4.0ForHelios</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kyriakos.anastasakis.net/2010/11/13/installing-visual-editor-on-eclipse-helios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Must have Eclipse plugins</title>
		<link>http://kyriakos.anastasakis.net/2009/10/14/must-have-eclipse-plugins/</link>
		<comments>http://kyriakos.anastasakis.net/2009/10/14/must-have-eclipse-plugins/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 19:51:07 +0000</pubDate>
		<dc:creator>Kyriakos Anastasakis</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://kyriakos.anastasakis.net/?p=204</guid>
		<description><![CDATA[From time to time I develop something on Eclipse. Apart from the usual Eclipse operations (build and test) that I do with the Eclipse Ant and JUnit plugins (they ship with Eclipse for Java), I also wanted to carry out some dependency analysis on existing code. Of course JDepend is the obvious option, but I [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time I develop something on Eclipse. Apart from the usual Eclipse operations (build and test) that I do with the Eclipse Ant and JUnit plugins (they ship with Eclipse for Java), I also wanted to carry out some dependency analysis on existing code. Of course JDepend is the obvious option, but I found a nice article from IBM that suggests some additional plugins that help the coder carry out day to day tasks such as Complexity monitoring and Coding standard analysis.</p>
<p>The following is a summary of the plugins proposed by the article. Of course all of them are opensource/free.</p>
<table border="1">
<tbody>
<tr>
<td><strong>Tool</strong></td>
<td><strong>Purpose</strong></td>
<td><strong>URL for Eclipse plugin</strong></td>
</tr>
<tr>
<td>CheckStyle</td>
<td>Coding standard analysis</td>
<td>http://eclipse-cs.sourceforge.net/update/</td>
</tr>
<tr>
<td>Coverlipse</td>
<td>Test code coverage</td>
<td>http://coverlipse.sf.net/update</td>
</tr>
<tr>
<td>CPD</td>
<td>Copy/Paste detection</td>
<td>http://pmd.sourceforge.net/eclipse/</td>
</tr>
<tr>
<td>JDepend</td>
<td>Package dependency analysis</td>
<td>http://andrei.gmxhome.de/eclipse/</td>
</tr>
<tr>
<td>Metrics</td>
<td>Complexity monitoring</td>
<td>http://metrics.sourceforge.net/update</td>
</tr>
</tbody>
</table>
<p>The full IBM article can be found here: <a href="http://www.ibm.com/developerworks/java/library/j-ap01117/" target="_blank">http://www.ibm.com/developerworks/java/library/j-ap01117/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kyriakos.anastasakis.net/2009/10/14/must-have-eclipse-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exception using XMLConfiguration</title>
		<link>http://kyriakos.anastasakis.net/2009/02/23/exception-using-xmlconfiguration/</link>
		<comments>http://kyriakos.anastasakis.net/2009/02/23/exception-using-xmlconfiguration/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 14:01:36 +0000</pubDate>
		<dc:creator>Kyriakos Anastasakis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[UML2Alloy]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[import_linkedin]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://kyriakos.anastasakis.net/?p=157</guid>
		<description><![CDATA[I tried using the Apache XMLConfiguration to save the settings of an application I am developing to XML format. When I used it with Java 1.5 it all worked perfectly; however if I tried using it with Java 1.6 I was getting the following exception. Exception in thread "main" java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getXmlStandalone()Z at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(Unknown Source) at [...]]]></description>
			<content:encoded><![CDATA[<p>I tried using the <a href="http://commons.apache.org/configuration/" target="_blank">Apache XMLConfiguration</a> to save the settings of an application I am developing to XML format. When I used it with Java 1.5 it all worked perfectly; however if I tried using it with Java 1.6 I was getting the following exception.</p>
<p><span style="font-family: Courier; font-size: small;"><code><br />
Exception in thread "main" java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getXmlStandalone()Z<br />
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(Unknown Source)<br />
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)<br />
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)<br />
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)<br />
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)<br />
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)<br />
at org.apache.commons.configuration.XMLConfiguration.save(XMLConfiguration.java:880)<br />
at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration$FileConfigurationDelegate.save(AbstractHierarchicalFileConfiguration.java:454)<br />
at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:546)<br />
at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:513)<br />
at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:491)<br />
at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:403)<br />
at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.save(AbstractHierarchicalFileConfiguration.java:199)<br />
</code></span></p>
<p>After doing some search on google I found that this can be a problem with the xerces XML library (xercesImpl.jar). Checking the 3rd party libraries I am using in my project, I found a library that was using and distributing an earlier version of xercesImpl.jar.</p>
<p>I downloaded the latest version (2.91) of xercesImpl.jar from the Apache xerces project (<a href="http://xerces.apache.org/mirrors.cgi#binary" target="_blank">http://xerces.apache.org/mirrors.cgi#binary</a>) and replaced in the 3rd party library I was using the xercesImpl.jar file with the one I downloaded. Now everything seems to work fine, even in Java 1.6.  <img src='http://kyriakos.anastasakis.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://kyriakos.anastasakis.net/2009/02/23/exception-using-xmlconfiguration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log4j result in JTextPane</title>
		<link>http://kyriakos.anastasakis.net/2007/12/31/log4j-result-in-jtextpane/</link>
		<comments>http://kyriakos.anastasakis.net/2007/12/31/log4j-result-in-jtextpane/#comments</comments>
		<pubDate>Mon, 31 Dec 2007 19:50:29 +0000</pubDate>
		<dc:creator>Kyriakos Anastasakis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JTextPane]]></category>
		<category><![CDATA[log4j]]></category>

		<guid isPermaLink="false">http://kyriakos.anastasakis.net/blog/2007/12/31/log4j-result-in-jtextpane/</guid>
		<description><![CDATA[I recently wanted to redirect the output of Log4j to a JTextPane, so as to output messages to the JTextPane using a different color depending on the severity. I spent some time searching for information and I quickly put together a small example. The following screenshot shows the output. The source code is available here.]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to redirect the output of Log4j to a JTextPane, so as to output messages to the JTextPane using a different color depending on the severity.</p>
<p>I spent some time searching for information and I quickly put together a small example. The following screenshot shows the output.</p>
<p><a href="http://kyriakos.anastasakis.net/blog/wp-content/uploads/2007/12/screenshot.jpg" target="_blank" title="screenshot.jpg"><img src="http://kyriakos.anastasakis.net/blog/wp-content/uploads/2007/12/screenshot.thumbnail.jpg" alt="screenshot.jpg" height="128" width="169" /></a></p>
<p><a href="http://kyriakos.anastasakis.net/blog/wp-content/uploads/2007/12/jtextpaneappender.zip" title="jtextpaneappender"></a></p>
<h3><strong>The <a href="http://kyriakos.anastasakis.net/blog/wp-content/uploads/2007/12/jtextpaneappender.zip" title="jtextpaneappender">source code is available here.</a></strong></h3>
]]></content:encoded>
			<wfw:commentRss>http://kyriakos.anastasakis.net/2007/12/31/log4j-result-in-jtextpane/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

