<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-37306137</id><updated>2021-02-18T09:53:03.349+01:00</updated><category term="Java"/><category term="agile"/><category term="buzz"/><category term="solution"/><category term="Scrum"/><category term="concurrency"/><category term="lean"/><category term="tutorial"/><category term="management"/><category term="principles"/><category term="certificate"/><category term="debug"/><category term="maven"/><category term="video"/><category term="book review"/><category term="testing"/><category term="unit testing"/><category term="commercial"/><category term="quality"/><category term="Eclipse"/><category term="deadlock"/><category term="leadership"/><category term="postcard"/><category term="tool"/><category term="AJAX"/><category term="Spring"/><category term="documentation"/><category term="gc"/><category term="presentation"/><category term="tdd"/><category term="windows"/><category term="TIBCO"/><category term="XP"/><category term="communication"/><category term="jvm"/><category term="struts"/><category term="team"/><category term="CSM"/><category term="JFreeChart"/><category term="Mylyn"/><category term="Wiki"/><category term="XBean"/><category term="Xerces"/><category term="artifactory"/><category term="bug"/><category term="code coverage"/><category term="collections"/><category term="continuum"/><category term="customer"/><category term="done"/><category term="final"/><category term="interview"/><category term="knowledge"/><category term="maintenance"/><category term="mock"/><category term="mock objects"/><category term="optimization"/><category term="performance"/><category term="po polsku"/><category term="refactoring"/><category term="requirements"/><category term="review"/><category term="selenium"/><category term="success story"/><category term="synchronizers"/><category term="training"/><category term="velocity"/><category term="waste"/><title type='text'>From Java to Java EE</title><subtitle type='html'>This blog is dedicated to all Java developers. I&#39;m trying to present my everyday problems I encounter developing complicated systems and my solutions to these problems. Java EE topics are also covered (JMS, JAAS, JCE, TIBCO EMS, Tomcat, etc.) This blog extends it&#39;s subject range also to Agile Software Development frameworks like Scrum and XP (eXtreme Programming).</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.bielu.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>147</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-37306137.post-8560225923952177898</id><published>2014-06-04T11:43:00.001+02:00</published><updated>2014-06-04T11:44:42.480+02:00</updated><title type='text'>Wildfly and Resteasy are missing support for FastInfoset collection and map...</title><content type='html'>so, if you have a REST resource returning a java.util.List or a java.util.Map, like:  &lt;pre class=&quot;java:nogutter&quot; name=&quot;code&quot;&gt;&lt;br /&gt;@Path(&quot;people&quot;)&lt;br /&gt;@Produces({&quot;application/fastinfoset&quot;})&lt;br /&gt;@Consumes({&quot;*/*&quot;})&lt;br /&gt;public class SomeResource {&lt;br /&gt;  &lt;br /&gt;  @GET&lt;br /&gt;  public List&amp;lt;SomeType&amp;gt; getAll() {&lt;br /&gt;  ...&lt;br /&gt;    &lt;br /&gt;  // and / or&lt;br /&gt;&lt;br /&gt;  @GET&lt;br /&gt;  @Path(&quot;/map&quot;)&lt;br /&gt;  public Map&amp;lt;String, SomeType&amp;gt; getMap() {&lt;br /&gt;  ...&lt;br /&gt;&lt;/pre&gt; and you try to access it (e.g. &lt;code&gt;curl -H &quot;Accept: application/fastinfoset&quot; http://localhost:8080/.../resources/map&lt;/code&gt;) you will see &lt;p/&gt;&lt;code&gt;&lt;font color=&quot;red&quot;&gt;Could not find MessageBodyWriter for response object of type: java.util.ArrayList of media type: application/fastinfoset&lt;/font&gt;&lt;/code&gt; &lt;p/&gt; or &lt;p/&gt; &lt;code&gt;&lt;font color=&quot;red&quot;&gt;Could not find MessageBodyWriter for response object of type: java.util.LinkedHashMap of media type: application/fastinfoset&lt;/font&gt;&lt;/code&gt; Unfortunately &lt;a href=&quot;http://jboss.org/resteasy&quot;&gt;Resteasy&lt;/a&gt; &quot;forgot&quot; to implement two following classes:  &lt;pre class=&quot;java:nogutter&quot; name=&quot;code&quot;&gt;&lt;br /&gt;@Provider&lt;br /&gt;@Consumes(&quot;application/*+fastinfoset&quot;)&lt;br /&gt;@Produces(&quot;application/*+fastinfoset&quot;)&lt;br /&gt;public class FastInfosetCollectionProvider extends org.jboss.resteasy.plugins.providers.jaxb.CollectionProvider {&lt;br /&gt;  @Override&lt;br /&gt;  protected boolean suppressExpandEntityExpansion() {&lt;br /&gt;    return false;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;pre class=&quot;java:nogutter&quot; name=&quot;code&quot;&gt;&lt;br /&gt;@Provider&lt;br /&gt;@Consumes(&quot;application/*+fastinfoset&quot;)&lt;br /&gt;@Produces(&quot;application/*+fastinfoset&quot;)&lt;br /&gt;public class FastInfosetMapProvider extends org.jboss.resteasy.plugins.providers.jaxb.MapProvider {&lt;br /&gt;  @Override&lt;br /&gt;  protected boolean suppressExpandEntityExpansion() {&lt;br /&gt;    return false;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; I already sent my &lt;a href=&quot;https://github.com/resteasy/Resteasy/pull/506&quot;&gt;pull request&lt;/a&gt;, but in case it is never merged, you just have to provide two classes I showed above to make it work.</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/8560225923952177898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=8560225923952177898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/8560225923952177898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/8560225923952177898'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2014/06/wildfly-and-resteasy-are-missing.html' title='Wildfly and Resteasy are missing support for FastInfoset collection and map...'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7828377578332565392</id><published>2014-05-27T10:29:00.001+02:00</published><updated>2014-05-27T14:04:59.385+02:00</updated><title type='text'>How to convert broken FastInfoset stream into XML?</title><content type='html'>Have you ever received a broken FastInfoset (FI) stream? Or maybe, your logging infrastructure is truncating the logs so FI messages are incomplete? If you try this piece of code: &lt;pre class=&quot;java:nogutter&quot; name=&quot;code&quot;&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import org.xml.sax.InputSource;&lt;br /&gt;import org.xml.sax.SAXException;&lt;br /&gt;import org.xml.sax.XMLReader;&lt;br /&gt;&lt;br /&gt;import com.sun.org.apache.xml.internal.serialize.OutputFormat;&lt;br /&gt;import com.sun.org.apache.xml.internal.serialize.XMLSerializer;&lt;br /&gt;import com.sun.org.apache.xml.internal.serializer.Method;&lt;br /&gt;import com.sun.xml.internal.fastinfoset.sax.SAXDocumentParser;&lt;br /&gt;&lt;br /&gt;public class FiDecoder {&lt;br /&gt;&lt;br /&gt;  public static void main(String[] args) throws IOException, SAXException {&lt;br /&gt;    XMLReader saxReader = new SAXDocumentParser();&lt;br /&gt;    OutputFormat format = new OutputFormat(Method.XML, null, false);&lt;br /&gt;    format.setOmitXMLDeclaration(true);&lt;br /&gt;    XMLSerializer handler = new XMLSerializer(System.out, format);&lt;br /&gt;    saxReader.setContentHandler(handler);&lt;br /&gt;    saxReader.parse(new InputSource(System.in));&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;on a broken FI stream (e.g. &lt;a href=&quot;https://github.com/pbielicki/storage/raw/master/FastInfoset/PersonMap-broken.fi&quot;&gt;PersonMap-broken.fi&lt;/a&gt;) you will see just an exception, no XML in the standard output. The problem is that the internal buffer hold by XMLSerializer has not been flushed yet and in case of error it is just dropped. It&#39;s a problem for small FI documents where buffer has no chance to be filled up before EOF or invalid FI character.  Fortunately there is a simple solution. You just need to extend XMLSerializer and handle error case correctly: &lt;pre class=&quot;java:nogutter&quot; name=&quot;code&quot;&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.PrintStream;&lt;br /&gt;&lt;br /&gt;import org.xml.sax.ErrorHandler;&lt;br /&gt;import org.xml.sax.SAXException;&lt;br /&gt;import org.xml.sax.SAXParseException;&lt;br /&gt;&lt;br /&gt;import com.sun.org.apache.xml.internal.serialize.OutputFormat;&lt;br /&gt;import com.sun.org.apache.xml.internal.serialize.XMLSerializer;&lt;br /&gt;&lt;br /&gt;public class XmlAutoFlushHandler extends XMLSerializer implements ErrorHandler {&lt;br /&gt;&lt;br /&gt;  public XmlAutoFlushHandler(PrintStream out, OutputFormat format) {&lt;br /&gt;    super(out, format);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  @Override&lt;br /&gt;  public void fatalError(SAXParseException exception) throws SAXException {&lt;br /&gt;    try {&lt;br /&gt;      _printer.flush();&lt;br /&gt;    } catch (IOException e) {&lt;br /&gt;      throw new IllegalStateException(&quot;unable to flush the stream&quot;, e);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  //remainder omitted&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Finally you have to slightly modify FiDecoder class: &lt;pre class=&quot;java:nogutter&quot; name=&quot;code&quot;&gt;&lt;br /&gt;    XmlAutoFlushHandler handler = new XmlAutoFlushHandler(System.out, format);&lt;br /&gt;    saxReader.setContentHandler(handler);&lt;br /&gt;    saxReader.setErrorHandler(handler);&lt;br /&gt;    try {&lt;br /&gt;      saxReader.parse(new InputSource(System.in));&lt;br /&gt;    } catch (IOException | SAXException e) {&lt;br /&gt;      // I don&#39;t care&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;Done!  Now when you try PersonMap-broken.fi, you will see incomplete XML (which is correct) and no exception.</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/7828377578332565392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=7828377578332565392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7828377578332565392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7828377578332565392'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2014/05/how-to-convert-broken-fastinfoset.html' title='How to convert broken FastInfoset stream into XML?'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-3757170553025281056</id><published>2013-12-09T17:00:00.000+01:00</published><updated>2013-12-09T17:00:07.609+01:00</updated><title type='text'>CXF / Spring integration using @Configuration annotation</title><content type='html'>If you develop JAX-WS services and run outside of Java EE container (that supports e.g. @WebService annotation) you probably use Apache CXF. If you want to integrate your services with CDI (again, outside of Java EE container), you probably use CXF / Spring integration - &lt;a href=&quot;http://cxf.apache.org/docs/writing-a-service-with-spring.html&quot;&gt;http://cxf.apache.org/docs/writing-a-service-with-spring.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This works fine, but the problem is if you want to use exclusively annotations and you don&#39;t use XML-base Spring configuration.&lt;br /&gt;&lt;br /&gt;There is a solution - so far my own: &lt;a href=&quot;https://issues.apache.org/jira/browse/CXF-5448&quot;&gt;https://issues.apache.org/jira/browse/CXF-5448&lt;/a&gt; but I opened a discussion on CXF dev mailing list to check if it could be integrated in CXF source code:&amp;nbsp; &lt;a href=&quot;http://mail-archives.apache.org/mod_mbox/cxf-dev/201312.mbox/%3c1386597934463-5737561.post@n5.nabble.com%3e&quot;&gt;mail thread&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you have another solution, comments or feedback please use CXF dev list.</content><link rel="related" href="http://cxf.apache.org/docs/writing-a-service-with-spring.html" title="CXF / Spring integration using @Configuration annotation"/><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/3757170553025281056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=3757170553025281056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3757170553025281056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3757170553025281056'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2013/12/cxf-spring-integration-using.html' title='CXF / Spring integration using @Configuration annotation'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-5792186882721770458</id><published>2012-08-01T11:48:00.000+02:00</published><updated>2012-08-01T16:05:28.315+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Lombok - cool stuff, worth trying!</title><content type='html'>A friend of mine just shared with me &lt;a href=&quot;http://projectlombok.org/&quot;&gt;Project Lombok&lt;/a&gt; (weird name but I guessed correctly that it&#39;s something Thai ;) As I understand the goal of this project is to minimize boilerplate Java code (like getters, setters, constructors, etc.) Very good idea!&lt;br /&gt;&lt;br /&gt;The only question that bothers me is if it&#39;s easily possible to override any behavior (e.g. setters) without the need of resigning from Lombok auto-generatin for the rest of class&#39; elements...&lt;br /&gt;&lt;br /&gt;Anyway - it&#39;s really worth trying!</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/5792186882721770458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=5792186882721770458' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/5792186882721770458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/5792186882721770458'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2012/08/lombok-cool-stuff-worth-trying.html' title='Lombok - cool stuff, worth trying!'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-1769814418240469912</id><published>2012-03-07T10:06:00.000+01:00</published><updated>2012-08-01T16:04:11.416+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="testing"/><title type='text'>Byteman - use it when Mockito can&#39;t help</title><content type='html'>&lt;a href=&quot;http://www.jboss.org/byteman&quot;&gt;Byteman&lt;/a&gt; is a really cool stuff with which you could simulate JVM or OS behavior hardly possible to mock using mocking library (like Mockito). Read the full exaple (really short with no fluff) here: &lt;a href=&quot;http://theholyjava.wordpress.com/2012/02/25/cool-tools-fault-injection-into-unit-tests-with-jboss-byteman-easier-testing-of-error-handling/&quot;&gt;http://theholyjava.wordpress.com/2012/02/25/cool-tools-fault-injection-into-unit-tests-with-jboss-byteman-easier-testing-of-error-handling/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/1769814418240469912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=1769814418240469912' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/1769814418240469912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/1769814418240469912'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2012/03/byteman-use-it-when-mockito-cant-help.html' title='Byteman - use it when Mockito can&#39;t help'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-3918862151662821730</id><published>2012-01-05T14:11:00.005+01:00</published><updated>2012-01-05T14:18:37.135+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><title type='text'>Errata to Maven2 → Maven3 migration</title><content type='html'>In the section &lt;b&gt;Cobertura plugin and Maven3&lt;/b&gt; of &lt;a href=&quot;http://blog.bielu.com/2011/12/maven2-maven3-migration-real-life.html&quot;&gt;&quot;Maven2 → Maven3 migration - real life example&quot;&lt;/a&gt; article I made a mistake that resulted in reporting a bug that does not exist.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&lt;executions&gt;&lt;br /&gt;  &lt;execution&gt;&lt;br /&gt;    &lt;phase&gt;package&lt;/phase&gt;&lt;br /&gt;    &lt;goals&gt;&lt;br /&gt;      &lt;goal&gt;clean&lt;/goal&gt;&lt;br /&gt;      &lt;goal&gt;check&lt;/goal&gt;&lt;br /&gt;    &lt;/goals&gt;&lt;br /&gt;  &lt;/execution&gt;&lt;br /&gt;&lt;/executions&gt;&lt;br /&gt;&lt;/pre&gt;should be changed to:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&lt;executions&gt;&lt;br /&gt;  &lt;execution&gt;&lt;br /&gt;    &lt;id&gt;clean&lt;/id&gt;&lt;br /&gt;    &lt;phase&gt;clean&lt;/phase&gt;&lt;br /&gt;    &lt;goals&gt;&lt;br /&gt;      &lt;goal&gt;clean&lt;/goal&gt;&lt;br /&gt;    &lt;/goals&gt;&lt;br /&gt;  &lt;/execution&gt;&lt;br /&gt;  &lt;execution&gt;&lt;br /&gt;    &lt;id&gt;package&lt;/id&gt;&lt;br /&gt;    &lt;phase&gt;package&lt;/phase&gt;&lt;br /&gt;    &lt;goals&gt;&lt;br /&gt;      &lt;goal&gt;check&lt;/goal&gt;&lt;br /&gt;    &lt;/goals&gt;&lt;br /&gt;  &lt;/execution&gt;&lt;br /&gt;&lt;/executions&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Both goals &lt;tt&gt;instrument&lt;/tt&gt; and &lt;tt&gt;check&lt;/tt&gt; must never be in the same execution because &lt;tt&gt;check&lt;/tt&gt; depends on &lt;tt&gt;instrument&lt;/tt&gt; and calls it itself. So, in my example goal &lt;tt&gt;instrument&lt;/tt&gt; was executed twice every time and it cause a lot of problems - many of them are still magic for me e.g. compilation error saying that &lt;tt&gt;...HasBeenInstrumented&lt;/tt&gt; class cannot be identified blah, blah, blah, even though &quot;buggy&quot; source code was untouched and did not use this Cobertura class. Anyway &lt;a href=&quot;https://jira.codehaus.org/browse/MCOBERTURA-155&quot;&gt;MCOBERTURA-155&lt;/a&gt; is a non-issue.</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/3918862151662821730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=3918862151662821730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3918862151662821730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3918862151662821730'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2012/01/errata-to-maven2-maven3-migration.html' title='Errata to Maven2 → Maven3 migration'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7185389367322304305</id><published>2011-12-15T10:43:00.005+01:00</published><updated>2012-01-05T14:10:56.530+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><title type='text'>Maven2 → Maven3 migration - real life example</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; float: left;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-2grWoTLeoFc/Tumws1OmI-I/AAAAAAAAVW0/E-P2KdN1dSY/Maven_logo.gif&quot; width=&quot;200&quot; /&gt;&lt;/div&gt;Couple of months after &lt;a href=&quot;http://blog.bielu.com/2011/07/jdk-7-is-finally-out.html&quot;&gt;JDK 7 release&lt;/a&gt; I decided to update my projects to build on both new JDK and Maven3 (Maven2 previously). From JDK 7 I was expecting nothing new as the codebase of our projects should be migrated step by step as soon as the Ops start supporting new application servers that could run on Java 7. More important things were expected from Maven3, namely we wanted to shorten build time, that we already optimized by 20% using Maven2 by smart initialization of our unit tests (but that&#39;s another story). In this post I will explain what I had to change to make this happen.&lt;br /&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;Status quo ante&lt;/h2&gt;Our projects have pretty standard build options, no homemade plugins or execution paths, etc. Just couple of standard plugins with standard configuration.&lt;br /&gt;&lt;br /&gt;During each build of multi-project Maven setup, Jenkins (currently 1.422) runs additionally &lt;a href=&quot;http://maven.apache.org/plugins/maven-checkstyle-plugin/&quot;&gt;CheckStyle&lt;/a&gt;, &lt;a href=&quot;http://mojo.codehaus.org/cobertura-maven-plugin/&quot;&gt;Cobertura&lt;/a&gt; and &lt;a href=&quot;http://mojo.codehaus.org/findbugs-maven-plugin/&quot;&gt;FindBugs&lt;/a&gt; plugins. CheckStyle and Cobertura are actually run twice, once during &lt;tt&gt;package&lt;/tt&gt; to see if nobody wrote any crap, and second time during reports generation.&lt;br /&gt;&lt;br /&gt;After the reports are generated everything travels to our projects website (run on Tomcat) via WebDAV protocol (oh, yeah! good old WebDAV).&lt;br /&gt;&lt;br /&gt;Every time someone commits a change Jenkins runs &lt;b&gt;&lt;tt&gt;mvn -e --batch-mode clean package site-deploy&lt;/tt&gt;&lt;/b&gt; and we&#39;re all happy.&lt;br /&gt;&lt;h2&gt;First run&lt;/h2&gt;Ok, let&#39;s change to Maven3 now. It should be easy. This is what I thought - &quot;just change &lt;tt&gt;MAVEN_HOME&lt;/tt&gt; and run the same stuff i.e. &lt;tt&gt;mvn ...&lt;/tt&gt;&quot;. Well, ... it worked but besides couple of warnings it did not finish successfully.&lt;br /&gt;&lt;br /&gt;Warnings, first (they are easy): Maven3 does not like if you don&#39;t provide version with plugin group and artifact ID, so this was my first change. I found all newest stable versions of plugins we use and added &lt;tt&gt;&amp;lt;version&amp;gt;&lt;/tt&gt; tag everywhere.&lt;br /&gt;&lt;br /&gt;Warnings disappeared but I still had errors. CheckStyle and Cobertura plugins were reporting style and coverage errors. It means that plugins were not configured correctly because they were executed but they did not load our settings.&lt;br /&gt;&lt;br /&gt;Main problem was that in our pom.xml we defined that we want to use plugins within:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&lt;build&gt;&lt;br /&gt;  &lt;plugins&gt;&lt;br /&gt;  ...&lt;br /&gt;  &lt;/plugins&gt;&lt;br /&gt;&lt;/build&gt;&lt;br /&gt;&lt;/pre&gt;section but the configuration was set in &lt;tt&gt;&amp;lt;reporting&amp;gt;&lt;/tt&gt; section.&lt;br /&gt;This caused Maven3 not to read plugin setup during the build - and as I mentioned before we do check the style and code coverage during the build, not only during the report generation.&lt;br /&gt;&lt;h2&gt;Fixing the build for Maven3&lt;/h2&gt;In Maven3 if you want to have some specific configuration to be take in to account during the build you have to put it in the &lt;tt&gt;&amp;lt;build&amp;gt;&lt;/tt&gt; section. If you want the same config to be take into account during report generation you have to copy-paste it into &lt;tt&gt;&amp;lt;reporting&amp;gt;&lt;/tt&gt; section, simple.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Cobertura plugin and Maven3&lt;/b&gt;&lt;br /&gt;The biggest change had to be applied to Cobertura. In my Maven2 pom.xml we had:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&lt;executions&gt;&lt;br /&gt;  &lt;execution&gt;&lt;br /&gt;    &lt;phase&gt;package&lt;/phase&gt;&lt;br /&gt;    &lt;goals&gt;&lt;br /&gt;      &lt;goal&gt;clean&lt;/goal&gt;&lt;br /&gt;      &lt;goal&gt;check&lt;/goal&gt;&lt;br /&gt;    &lt;/goals&gt;&lt;br /&gt;  &lt;/execution&gt;&lt;br /&gt;&lt;/executions&gt;&lt;br /&gt;&lt;/pre&gt;and it had to be changed to: (&lt;b&gt;not valid, see &lt;a href=&quot;http://blog.bielu.com/2012/01/errata-to-maven2-maven3-migration.html&quot;&gt;errata&lt;/a&gt;&lt;/b&gt;)&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&lt;executions&gt;&lt;br /&gt;  &lt;execution&gt;&lt;br /&gt;    &lt;id&gt;clean&lt;/id&gt;&lt;br /&gt;    &lt;phase&gt;clean&lt;/phase&gt;&lt;br /&gt;    &lt;goals&gt;&lt;br /&gt;      &lt;goal&gt;clean&lt;/goal&gt;&lt;br /&gt;    &lt;/goals&gt;&lt;br /&gt;  &lt;/execution&gt;&lt;br /&gt;  &lt;execution&gt;&lt;br /&gt;    &lt;id&gt;package&lt;/id&gt;&lt;br /&gt;    &lt;phase&gt;package&lt;/phase&gt;&lt;br /&gt;    &lt;goals&gt;&lt;br /&gt;      &lt;goal&gt;instrument&lt;/goal&gt;&lt;br /&gt;      &lt;goal&gt;check&lt;/goal&gt;&lt;br /&gt;    &lt;/goals&gt;&lt;br /&gt;  &lt;/execution&gt;&lt;br /&gt;&lt;/executions&gt;&lt;br /&gt;&lt;/pre&gt;but... it did not solve all of the issues...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Cobertura plugin v2.5.1 bug in Maven3&lt;/b&gt;&lt;br /&gt;(&lt;b&gt;not valid, see &lt;a href=&quot;http://blog.bielu.com/2012/01/errata-to-maven2-maven3-migration.html&quot;&gt;errata&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;Cobertura plugin has some problems with Maven3 that were not present in Maven2 - check my bug report in Cobertura Maven Plugin JIRA site: &lt;a href=&quot;https://jira.codehaus.org/browse/MCOBERTURA-155&quot;&gt;MCOBERTURA-155&lt;/a&gt;&lt;br /&gt;I provided a patch with workaround that works for me.&lt;br /&gt;&lt;br /&gt;After all of these changes I was able to run &lt;tt&gt;mvn clean package&lt;/tt&gt; &lt;b&gt;Yeah!&lt;/b&gt;&lt;br /&gt;&lt;h2&gt;Maven3 = site-deploy 3.0&lt;/h2&gt;Another warning I saw during the build was Maven3 asking to use &lt;tt&gt;maven-site-plugin&lt;/tt&gt; version 3.x. Let&#39;s start with the fact that I had to add the following in the &lt;tt&gt;&amp;lt;build&amp;gt;&amp;lt;plugins&amp;gt;&lt;/tt&gt; section:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&lt;plugin&gt;&lt;br /&gt;  &lt;groupid&gt;org.apache.maven.plugins&lt;/groupId&gt;&lt;br /&gt;  &lt;artifactid&gt;maven-site-plugin&lt;/artifactId&gt;&lt;br /&gt;  &lt;version&gt;3.0&lt;/version&gt;&lt;br /&gt;&lt;/plugin&gt;&lt;br /&gt;&lt;/pre&gt;I had some problems generating the site but they seem to disappeared automagically so I will ignore them.&lt;br /&gt;&lt;h2&gt;Maven3 = No WebDAV support&lt;/h2&gt;In each of our pom.xml we have the following:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&lt;distributionmanagement&gt;&lt;br /&gt;  &lt;repository&gt;&lt;br /&gt;    &lt;id&gt;artifactory.internal&lt;/id&gt;&lt;br /&gt;    &lt;name&gt;Internal Release Repository&lt;/name&gt;&lt;br /&gt;    &lt;url&gt;dav:http://${artifactory}/libs-releases/&lt;/url&gt;&lt;br /&gt;  &lt;/repository&gt;&lt;br /&gt;  &lt;site&gt;&lt;br /&gt;    &lt;id&gt;website&lt;/id&gt;&lt;br /&gt;    &lt;url&gt;dav:${project.url}&lt;/url&gt;&lt;br /&gt;  &lt;/site&gt;&lt;br /&gt;&lt;/distributionManagement&gt;&lt;br /&gt;&lt;/pre&gt;Everything is ok but note the protocol i.e. &lt;tt&gt;dav:&lt;/tt&gt;. It is not supported out-of-the-box in Maven3, so you have to add and extension in the &lt;tt&gt;&amp;lt;build&amp;gt;&lt;/tt&gt; section:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&lt;extensions&gt;&lt;br /&gt;    &lt;extension&gt;&lt;br /&gt;      &lt;groupid&gt;org.apache.maven.wagon&lt;/groupId&gt;&lt;br /&gt;      &lt;artifactid&gt;wagon-webdav-jackrabbit&lt;/artifactId&gt;&lt;br /&gt;      &lt;version&gt;2.1&lt;/version&gt;&lt;br /&gt;    &lt;/extension&gt;&lt;br /&gt;  &lt;/extensions&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Side-effect changes&lt;/h2&gt;As a side effect I updated &lt;a href=&quot;http://jenkins-ci.org/&quot;&gt;Jenkins CI&lt;/a&gt; to the newest version 1.422, and also &lt;a href=&quot;http://www.jfrog.com/products.php&quot;&gt;Artifactory&lt;/a&gt; to version 2.4.2.&lt;br /&gt;&lt;h2&gt;Was it worth?&lt;/h2&gt;I spent one whole day on this migration but it was worth IMHO. For all the migrated projects we saw build time saving from &lt;b&gt;25%&lt;/b&gt; up to &lt;b&gt;45%&lt;/b&gt; (!!!) depending on the size of the project (of course, you may notice different figures).&lt;br /&gt;&lt;br /&gt;Before the change our projects were built using JDK 1.6.0_23 and Maven 2.2.1, after the change we use JDK 1.7.0_1 and Maven 3.0.3.&lt;br /&gt;&lt;br /&gt;I&#39;m pretty happy with the change, and you?</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/7185389367322304305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=7185389367322304305' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7185389367322304305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7185389367322304305'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2011/12/maven2-maven3-migration-real-life.html' title='Maven2 &amp;rarr; Maven3 migration - real life example'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-2grWoTLeoFc/Tumws1OmI-I/AAAAAAAAVW0/E-P2KdN1dSY/s72-c/Maven_logo.gif" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-3179665691927578724</id><published>2011-12-05T08:04:00.004+01:00</published><updated>2011-12-05T08:12:26.226+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gc"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="jvm"/><title type='text'>FW: Garbage collection in HotSpot JVM</title><content type='html'>There is an excellent new post from Alexey Ragozin on JVM Garbage Collector: &lt;br /&gt;&lt;a href=&quot;http://www.dzone.com/links/r/garbage_collection_in_hotspot_jvm.html&quot;&gt;http://www.dzone.com/links/r/garbage_collection_in_hotspot_jvm.html&lt;/a&gt;. &lt;br /&gt;He posted almost all basics you should know about different types of GCs, how to enable them in HotSpot JVM and most importantly when to enable them.&lt;br /&gt;&lt;br /&gt;Just go there and read it!</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/3179665691927578724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=3179665691927578724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3179665691927578724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3179665691927578724'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2011/12/fw-garbage-collection-in-hotspot-jvm.html' title='FW: Garbage collection in HotSpot JVM'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7551358432526531021</id><published>2011-11-25T09:43:00.006+01:00</published><updated>2011-12-09T08:43:12.610+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bug"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="jvm"/><title type='text'>HotSpot  (64bit server) hangs on socket read (JVM 1.7 bug?) - updated</title><content type='html'>&lt;div style=&quot;float: left;&quot;&gt;&lt;a href=&quot;http://www.clker.com/clipart-3337.html&quot;&gt;&lt;img src=&quot;http://www.clker.com/cliparts/c/3/b/d/1194985428453820625bug_nicu_buculei_01.svg.hi.png&quot; style=&quot;margin-right: 5px; width: 150px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div align=&quot;center&quot; style=&quot;font-size: xx-small;&quot;&gt;Picture (c) Clker.com&lt;/div&gt;&lt;/div&gt;Few days ago I started working on some maven-based project (Java 1.7.0) on my new laptop (with Windows 7 64bit installed) and I noticed that very often Maven 3 was stuck downloading JARs from the internet even though my internet connection was fine. I started investigating this issue and after checking thread dump and binary dump (DMP) I think I found a bug in HotSpot for 64bit Windows.&lt;br /&gt;&lt;br /&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;It&#39;s quite strange but any Java application using &lt;tt&gt;java.net.DualStackPlainSocketImpl&lt;/tt&gt; (from rt.jar) class - JVM hangs on native &lt;tt&gt;socket0(boolean stream, boolean v6Only)&lt;/tt&gt; method.&lt;br /&gt;&lt;br /&gt;Here is an excerpt from the thread dump from my problematic Java app:&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;text:nogutter&quot;&gt;&quot;main&quot; prio=6 tid=0x0000000001d3b000 nid=0x6ec runnable [0x00000000020df000]&lt;br /&gt;java.lang.Thread.State: RUNNABLE&lt;br /&gt;&lt;font color=red&gt;at java.net.SocketInputStream.socketRead0(Native Method)&lt;/font&gt;&lt;br /&gt;at java.net.SocketInputStream.read(SocketInputStream.java:150)&lt;br /&gt;at java.net.SocketInputStream.read(SocketInputStream.java:121)&lt;br /&gt;at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)&lt;br /&gt;at java.io.BufferedInputStream.read(BufferedInputStream.java:334)&lt;br /&gt;- locked &lt;0x00000000eb31e490&gt; (a java.io.BufferedInputStream)&lt;br /&gt;at sun.net.www.MeteredStream.read(MeteredStream.java:134)&lt;br /&gt;- locked &lt;0x00000000eb321280&gt; (a sun.net.www.http.KeepAliveStream)&lt;br /&gt;at java.io.FilterInputStream.read(FilterInputStream.java:133)&lt;br /&gt;at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2968)&lt;br /&gt;at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)&lt;br /&gt;at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)&lt;br /&gt;at java.io.BufferedInputStream.read(BufferedInputStream.java:334)&lt;br /&gt;- locked &lt;0x00000000eb2fcc08&gt; (a java.io.BufferedInputStream)&lt;br /&gt;at java.io.FilterInputStream.read(FilterInputStream.java:107)&lt;br /&gt;at io.DownloadJar.main(DownloadJar.java:20)&lt;br /&gt;&lt;br /&gt;Locked ownable synchronizers:&lt;br /&gt;- None&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is what I got from Win Debug Diagnostic Tool when I analyzed full memory / process image:&lt;br /&gt;&lt;blockquote&gt;The following threads in java.dmp are waiting on data to be returned from another server via WinSock.&lt;br /&gt;&lt;br /&gt;&lt;font color=red&gt;The call to WinSock originated from net!Java_java_net_SocketInputStream_socketRead0+160 ( 1 ) 5,56% of threads blocked&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Ensure that any remote server this application may be calling is functioning properly and there are no network issues between the two servers. If the problem continues, please contact the application vendor for further assistance &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Below you can find a source code of this simple app causing the problem (imports omitted):&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;java:nogutter&quot;&gt;// netty-3.2.6.Final.jar from maven repository&lt;br /&gt;URL url = new URL(&quot;http://tinyurl.com/cg43cju&quot;);&lt;br /&gt;try (BufferedInputStream in = new BufferedInputStream(url.openStream());&lt;br /&gt;    BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(&quot;netty.jar&quot;))) {&lt;br /&gt;   &lt;br /&gt; byte[] buf = new byte[2048];&lt;br /&gt; int len = 0;&lt;br /&gt; int total = 0;&lt;br /&gt; while ((len = in.read(buf)) &gt; -1) {&lt;br /&gt;  total += len;&lt;br /&gt;  System.out.println(total / 1024 + &quot;KB&quot;);&lt;br /&gt;  out.write(buf, 0, len);&lt;br /&gt; }&lt;br /&gt;} catch (IOException e) {&lt;br /&gt; e.printStackTrace();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This problem occurs very often (almost every time) and it&#39;s quite easy to reproduce (at least on my machine).&lt;br /&gt;&lt;br /&gt;You would suggest to check my internet connection but it&#39;s fine. I&#39;m able to download this JAR (or anything else) with no problems at all.&lt;br /&gt;&lt;br /&gt;What is &lt;b&gt;EXTREMELY&lt;/b&gt; weird is that if I run the very same byte code on HotSpot installed on Ubuntu that runs on VirtualBox on my Windows, it &lt;b&gt;WORKS FINE 100%&lt;/b&gt; of time. WTF? I think it proves there is no problem with my network interface or connection but with HotSpot implementation for 64bit Windows?&lt;br /&gt;&lt;br /&gt;If you encountered problems like this and know how to fix it, please let me know.&lt;br /&gt;&lt;br /&gt;BTW. I already posted a bug report to Oracle but it&#39;s pending - I will provide a link here when it becomes public.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;UPDATE&lt;/b&gt;&lt;br /&gt;Bug link: &lt;a href=&quot;http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7115226&quot;&gt;7115226&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/7551358432526531021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=7551358432526531021' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7551358432526531021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7551358432526531021'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2011/11/hotspot-64bit-server-hangs-on-socket.html' title='HotSpot  (64bit server) hangs on socket read (JVM 1.7 bug?) - updated'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-511321628761757049</id><published>2011-11-23T08:09:00.002+01:00</published><updated>2011-11-23T08:18:06.836+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gc"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="performance"/><title type='text'>GC and preformance tuning for Tomcat (from VMware)</title><content type='html'>Coming back to my previous post &lt;a href=&quot;http://blog.bielu.com/2011/11/be-aware-of-your-gc.html&quot;&gt;&quot;Beware of your GC&quot;&lt;/a&gt;: just yesterday Daniel Mikusa from VMware published his post &lt;a href=&quot;http://www.tomcatexpert.com/blog/2011/11/22/performance-tuning-jvm-running-tomcat&quot;&gt;&quot;Performance Tuning the JVM for Running Apache Tomcat&quot;&lt;/a&gt; which adds some more interesting information complementing my post. You could find &quot;Selecting a Collector&quot; section specifically interesting e.g.:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;When you specify the option to run the concurrent collector, it is important to realize that garbage collection will happen concurrently with the application. This means that garbage collection will consume some of the processor resources that would have otherwise been available to the application. On systems with a large number of processors, this is typically not a problem. However, if your system has only one or two processors then you will likely want to enable the &lt;tt&gt;-XX:+CMSIncrementalMode&lt;/tt&gt; option. This option enables incremental mode for the collector, which instructs the collector to periodically yield the processor back to the application and essentially prevents the collector from running for too long.&lt;/blockquote&gt;&lt;br /&gt;Enjoy!</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/511321628761757049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=511321628761757049' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/511321628761757049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/511321628761757049'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2011/11/gc-and-preformance-tuning-for-tomcat.html' title='GC and preformance tuning for Tomcat (from VMware)'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7045869401540399294</id><published>2011-11-18T17:00:00.006+01:00</published><updated>2011-12-09T08:47:43.413+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debug"/><category scheme="http://www.blogger.com/atom/ns#" term="gc"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Be aware of your GC</title><content type='html'>&lt;div style=&quot;float: left;&quot;&gt;&lt;img src=&quot;http://farm1.static.flickr.com/29/53178920_88c95482c2_o.jpg&quot; style=&quot;margin-right: 5px; width: 250px;&quot; /&gt;&lt;/div&gt;When you&#39;re learning Java and later developing your applications you usually tend to not to worry about the memory management - we have garbage collector after all, so what&#39;s to worry about. Surprisingly you should worry about memory in your Java applications as it&#39;s not that difficult to introduce memory leak after all. &lt;a name=&#39;more&#39;&gt;&lt;/a&gt;You should worry about memory also in order to minimize pause time GC infers, and to use CPU to process your client&#39;s requests instead of cleaning your memory. It all depends on your non-functional requirements of latency, throughput, etc. (which can be tuned with some VM settings, not changing any applicative code)&lt;br /&gt;&lt;br /&gt;There are two (at least) perspectives of memory management and GC in Java:&lt;br /&gt;&lt;table&gt;&lt;tr&gt; &lt;td valign=top&gt;&lt;b&gt;1.&lt;/b&gt;&lt;/td&gt;&lt;td&gt;You should be careful while developing you application and make sure not to cache any objects. In other words do not be afraid of using &lt;tt&gt;new&lt;/tt&gt; in Java - creating objects in Java is extremely fast and cheap (e.g. comparing to C++) as physical memory is already allocated - more in &lt;a href=&quot;http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html&quot;&gt;http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html&lt;/a&gt; short article&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=top&gt;&lt;b&gt;2.&lt;/b&gt;&lt;/td&gt;&lt;td&gt;You should be aware of GC tuning options that can match your concrete application - and this is what I will address in this post.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;Usually you have two options while tuning GC: either you limit number of global collections (young + tenured generations), or limit max pause of garbage collection (thus increasing number of collections). You have plenty of options and quite exhaustive list can be found at &lt;a href=&quot;http://aragozin.blogspot.com/2011/09/hotspot-jvm-garbage-collection-options.html&quot;&gt;Alexey Ragozin Blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You should start analyzing your application under heavy load by enabling GC logging first:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;plain:nogutter&quot;&gt;-Xloggc:/opt/java/logs/gc.log&lt;br /&gt;-verbose:gc&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After running your application (Server HotSpot 1.6.0_23-b05) you should see at least one line like this:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;plain:nogutter&quot;&gt;8.847: [GC 138240K-&gt;4866K(501248K), 0.0148485 secs]&lt;br /&gt;&lt;/pre&gt;which says that 8.8 sec after VM startup there was a young generation collection that freed memory from 138240K used to 4866K with total mem available of 501248K and that garbage collection took ~15ms.&lt;br /&gt;&lt;br /&gt;I recommend you adding also two following VM options:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;plain:nogutter&quot;&gt;-XX:+PrintGCDetails&lt;br /&gt;-XX:+PrintGCDateStamps&lt;br /&gt;&lt;/pre&gt;that will result in such GC log line:&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;2011-11-18T16:36:04.513+0100: -0.813: [GC [PSYoungGen: 13824K-&gt;1376K(16128K)] 13824K-&gt;1376K(48896K), 0.0030416 secs] [Times: user=0.05 sys=0.01, real=0.02 secs] &lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;Here you basically have more details about what happened i.e. that young generation was collected indeed and more importantly you have timestamps that are critical if you&#39;re running GC logs in production environment and simply time elapsed from VM startup says absolutely nothing.&lt;br /&gt;&lt;br /&gt;When you start some heavy load of your application GC log might start looking more like this:&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;2011-11-18T16:37:51.472+0100: 99.088: [GC [PSYoungGen: 17338K-&gt;573K(17600K)] 49913K-&gt;33167K(50368K), 0.0011993 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] &lt;br /&gt;2011-11-18T16:37:51.800+0100: 100.780: [GC [PSYoungGen: 17341K-&gt;547K(17600K)] 49935K-&gt;33165K(50368K), -1.3929204 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] &lt;br /&gt;2011-11-18T16:37:52.097+0100: 99.670: [GC [PSYoungGen: 17315K-&gt;512K(17664K)] 49933K-&gt;33193K(50432K), 0.0011831 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] &lt;br /&gt;2011-11-18T16:37:52.097+0100: 99.671: [Full GC [PSYoungGen: 512K-&gt;0K(17664K)] [PSOldGen: 32680K-&gt;13582K(32768K)] 33193K-&gt;13582K(50432K) [PSPermGen: 29382K-&gt;29382K(58880K)], 1.5108144 secs] [Times: user=0.11 sys=0.00, real=0.13 secs] &lt;br /&gt;2011-11-18T16:37:52.503+0100: 100.066: [GC [PSYoungGen: 16896K-&gt;557K(17664K)] 30478K-&gt;14140K(50432K), 0.0015381 secs] [Times: user=0.05 sys=0.00, real=0.02 secs] &lt;br /&gt;2011-11-18T16:37:52.800+0100: 100.337: [GC [PSYoungGen: 17453K-&gt;501K(17664K)] 31036K-&gt;14188K(50432K), 0.0011944 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] &lt;br /&gt;2011-11-18T16:37:53.206+0100: 100.656: [GC [PSYoungGen: 17397K-&gt;402K(17344K)] 31084K-&gt;14117K(50112K), 0.0009709 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] &lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;You can notice that on 99.671 sec from the VM startup there was a Full GC executed. It means that the old generation was full.&lt;br /&gt;&lt;br /&gt;Now it&#39;s time for you to play with some settings like &lt;tt&gt;-XX:NewSize&lt;/tt&gt;, &lt;tt&gt;-XX:MaxNewSize&lt;/tt&gt;, &lt;tt&gt;-XX:SurvivorRatio&lt;/tt&gt; and others to see what&#39;s the best compromise between the max pause time and the number of GC pauses.&lt;br /&gt;&lt;br /&gt;It&#39;s also time to play with different types of GC. You still have to test &lt;tt&gt;-XX:+UseConcMarkSweepGC&lt;/tt&gt;, &lt;tt&gt;-XX:+UseParNewGC&lt;/tt&gt; and &lt;tt&gt;-XX:+UseG1GC&lt;/tt&gt;. Be careful with the last option as if you use JVM version 6.x you have to combine it together with &lt;tt&gt;-XX:+UnlockExperimentalVMOptions&lt;/tt&gt; as &lt;i&gt;&quot;Garbage-First Garbage Collector (or G1 GC for short) is a new GC that is being introduced in the Java HotSpot VM in JDK 7. An experimental version of G1 has also been released in Java SE 6 Update 14. G1 is the long-term replacement for HotSpot&#39;s low-latency Concurrent Mark-Sweep GC (widely referred to as CMS)&quot;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IMPORTANT:&lt;/b&gt; there is no golden formula for correct and optimal settings / GC implementation. It really depends on your application (sometimes you would need to re-implement some parts to help GC), traffic, given memory (remember than on 32-bit machines max heap size is 4GB and it could be insufficient for some applications), number of cores, etc. But most of all it&#39;s your application that drives GC behavior. Be careful and optimize your GC setting with production settings, not to have unpleasant surprises on launch date :)&lt;br /&gt;&lt;br /&gt;Note on HotSpot&#39;s GC on Windows: it sucks because many times I can get negative GC time in logs like &#39;-1.3917690 secs&#39; which is not very helpful for analysis. After some playing with GC logs I&#39;m not sure times given there can be trusted at all - what a pity.&lt;br /&gt;&lt;br /&gt;In the next post I will explain what monitoring / analyzing tools you can use to monitor you application in runtime as well analyze GC logs offline.</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/7045869401540399294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=7045869401540399294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7045869401540399294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7045869401540399294'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2011/11/be-aware-of-your-gc.html' title='Be aware of your GC'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-4714645967770725990</id><published>2011-07-29T14:50:00.005+02:00</published><updated>2011-10-14T10:03:13.504+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="buzz"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Java 7 - it&#39;s here</title><content type='html'>&lt;a href=&quot;http://java.oracle.com&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-1sv37ssoF1M/TjKsckYw-0I/AAAAAAAAUGA/AEMS6sLnOOs/s600/java7.png&quot; width=&quot;490&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/4714645967770725990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=4714645967770725990' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/4714645967770725990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/4714645967770725990'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2011/07/java-7-its-here.html' title='Java 7 - it&#39;s here'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-1sv37ssoF1M/TjKsckYw-0I/AAAAAAAAUGA/AEMS6sLnOOs/s72-c/java7.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-3142055972241907327</id><published>2011-07-22T08:10:00.002+02:00</published><updated>2011-07-22T08:42:59.614+02:00</updated><title type='text'>JDK 7 is finally out...</title><content type='html'>&lt;div style=&quot;float: left;&quot;&gt;&lt;img src=&quot;http://www.kellycode.com/blogImages/java-duke-logo.png&quot; style=&quot;margin-right: 5px; width: 120px;&quot; /&gt;&lt;/div&gt;...well, not yet but it will be in few days (&lt;a href=&quot;http://www.readwriteweb.com/hack/2010/11/java7-release-date.php&quot;&gt;Oracle Announces Release Date for Java 7&lt;/a&gt;). After &lt;a href=&quot;http://en.wikipedia.org/wiki/Java_version_history#Java_SE_7&quot;&gt;Wikipedia&lt;/a&gt; &quot;Java 7 (codename Dolphin) is an upcoming major update to Java, it has been launched on July 7 of 2011 and &lt;b&gt;will be made available on July 28, 2011.&lt;/b&gt;&quot;&lt;br /&gt;&lt;br /&gt;Here&#39;s the list of new features Java 7 will bring (consult &lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/&quot;&gt;JDK 7 project page&lt;/a&gt; for more details):&lt;br /&gt;&lt;br /&gt;Features are listed in order, more or less, from lowest to highest in the overall JDK software stack.&lt;br /&gt;&lt;br /&gt;&lt;table class=&quot;features&quot; summary=&quot;features&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#vm&quot;&gt;vm&lt;/a&gt;&lt;/td&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f353&quot;&gt;JSR 292: Support for dynamically-typed languages (InvokeDynamic)&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa535991&quot;&gt;Strict class-file checking&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#lang&quot;&gt;lang&lt;/a&gt;&lt;/td&gt;  &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f618&quot;&gt;JSR 334: Small language enhancements (Project Coin)&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#core&quot;&gt;core&lt;/a&gt;&lt;/td&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f352&quot;&gt;Upgrade class-loader architecture&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f584&quot;&gt;Method to close a URLClassLoader&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f515&quot;&gt;Concurrency and collections updates&lt;br /&gt;(jsr166y)&lt;/a&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#i18n&quot;&gt;i18n&lt;/a&gt;&lt;/td&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f497&quot;&gt;Unicode 6.0&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa535895&quot;&gt;Locale enhancement&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa538265&quot;&gt;Separate user locale and user-interface&lt;br /&gt;locale&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#ionet&quot;&gt;ionet&lt;/a&gt;&lt;/td&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f250&quot;&gt;JSR 203: More new I/O APIs for the Java platform (NIO.2)&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa537814&quot;&gt;NIO.2 filesystem provider for zip/jar&lt;br /&gt;archives&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f405&quot;&gt;SCTP (Stream Control Transmission Protocol)&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f639&quot;&gt;SDP (Sockets Direct Protocol)&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa535996&quot;&gt;Use the Windows Vista IPv6 stack&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa534339&quot;&gt;TLS 1.2&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#sec&quot;&gt;sec&lt;/a&gt;&lt;/td&gt;  &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f73&quot;&gt;Elliptic-curve cryptography (ECC)&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#jdbc&quot;&gt;jdbc&lt;/a&gt;&lt;/td&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa539110&quot;&gt;JDBC 4.1&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#client&quot;&gt;client&lt;/a&gt;&lt;/td&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f653&quot;&gt;XRender pipeline for Java 2D&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt;  &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f650&quot;&gt;Create new platform APIs for 6u10 graphics features&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f244&quot;&gt;Nimbus look-and-feel for Swing&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f652&quot;&gt;Swing JLayer component&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa99999&quot;&gt;Gervill sound synthesizer&lt;/a&gt; &lt;span class=&quot;new&quot;&gt;[NEW]&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#web&quot;&gt;web&lt;/a&gt;&lt;/td&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#f568&quot;&gt;Update the XML stack&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#mgmt&quot;&gt;mgmt&lt;/a&gt;&lt;/td&gt; &lt;td class=&quot;group&quot;&gt;&lt;a href=&quot;http://openjdk.java.net/projects/jdk7/features/#fa530068&quot;&gt;Enhanced MBeans&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;For me one of the most interesting changes are &lt;a href=&quot;http://openjdk.java.net/projects/coin/&quot;&gt;&quot;Small language enhancements&quot;&lt;/a&gt; that come from project Coin.&lt;br /&gt;The goal of Project Coin is to determine what set of small&lt;br /&gt;language changes should be added to JDK 7. That list is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Strings in switch&lt;/li&gt;&lt;li&gt;Binary integral literals and underscores in numeric literals&lt;/li&gt;&lt;li&gt;Multi-catch and more precise rethrow&lt;/li&gt;&lt;li&gt;Improved type inference for generic instance creation&lt;br /&gt;(diamond)&lt;/li&gt;&lt;li&gt;&lt;code&gt;try&lt;/code&gt;-with-resources statement&lt;/li&gt;&lt;li&gt;Simplified varargs method invocation&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;All Java developers have waited for this moment since December 2006 when JDK 6 was released. It was the longest and the most painful release in Java history. It took almost five years to do it while for previous versions the period between releases was more or less two years. Of course, five years waiting for new Java was the effect of many factors like problems of Sun (eventually bought by Oracle), making JDK an open source project and thus opening a pandora&#39;s box of non-open source licenses, etc.&lt;br /&gt;&lt;br /&gt;But it&#39;s finally here.&lt;br /&gt;&lt;br /&gt;Now we&#39;ll wait for JDK 8 with lambda expressions that were supposed to be delivered in version 7 but actually it&#39;s good that JDK guys decided to postpone some features to finally release it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;big&gt;Enjoy and celebrate the new JDK 7.&lt;/big&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/3142055972241907327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=3142055972241907327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3142055972241907327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3142055972241907327'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2011/07/jdk-7-is-finally-out.html' title='JDK 7 is finally out...'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-7177285473773502180</id><published>2011-03-13T15:44:00.005+01:00</published><updated>2011-12-09T08:48:52.991+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="book review"/><category scheme="http://www.blogger.com/atom/ns#" term="buzz"/><category scheme="http://www.blogger.com/atom/ns#" term="commercial"/><title type='text'>JBoss AS 5 Performance Tuning - book review</title><content type='html'>&lt;div style=&quot;float: left;&quot;&gt;&lt;a href=&quot;https://www.packtpub.com/jboss-5-performance-tuning/book&quot;&gt;&lt;img src=&quot;http://bielu.com/blog/jboss_as_performance_tuning.jpg&quot; style=&quot;margin-right: 5px; width: 150px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div align=&quot;center&quot; style=&quot;font-size: xx-small;&quot;&gt;Picture (c) Packt Publishing&lt;/div&gt;&lt;/div&gt;Some time ago I received a new book from &lt;a href=&quot;http://www.packtpub.com/&quot;&gt;Packt Publishing&lt;/a&gt; i.e. &lt;a href=&quot;https://www.packtpub.com/jboss-5-performance-tuning/book&quot;&gt;&quot;JBoss AS 5 Performance Tuning&quot;&lt;/a&gt;. This book couldn&#39;t reach me at a better time - few weeks ago my team was also releasing a new software, web application deployed in JBoss 5.x. Let me just write that this books was very useful in this critical time.&lt;br /&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;Before I start let me just mention that I’m experienced Java and Java EE developer and have worked with JBoss server before. This means that I know how to develop, deploy and monitor web applications in this application server. I also know how to monitor, profile and tune memory as well as performance using JMeter, VisualVM and VisualGC. Despite that, this book gave me even more detailed information and knowledge. With this book I was able to take another look at Java Virtual Machine settings, Garbage Collector settings as well as more advanced JBoss settings.&lt;br /&gt;&lt;br /&gt;Let’s start the review here - first of all I’d like to say that the author &lt;a href=&quot;https://www.packtpub.com/authors/profiles/francesco-marchioni&quot;&gt;Francesco Marchioni&lt;/a&gt; met my expectations about this book. You can really learn how to monitor and tune JVM, GC and JBoss but you will not learn how to write good and stable Java EE applications. This book is for people who want to know how to find memory leaks, performance bottlenecks, weak points in their applications, how to fix them programatically as well as with help of settings on different levels. You can easily check all topics covered by this book here &lt;a href=&quot;https://www.packtpub.com/toc/jboss-5-performance-tuning-table-contents&quot;&gt;Table of Contents&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.packtpub.com/jboss-5-performance-tuning/book&quot;&gt;&quot;JBoss AS 5 Performance Tuning&quot;&lt;/a&gt; is a very useful and pragmatic book. Francesco uses the same standard (open source/ free) tools as most of Java developers i.e. VisualVM, VisualGC, JMeter and Eclipse Test and Performance Tools Platform (TPTP). He explains why and how to use them and gives concrete examples. &lt;br /&gt;&lt;br /&gt;You can read this book from cover to cover or just use it as an encyclopedia and read only the chapters you think could be useful for you. I have to mention a very important information here. &lt;b&gt;Even though this book is named &quot;JBoss AS 5 ...&quot; it is very useful even if you use any other application/web server. Some of the chapters will be useless (especially those dedicated for JBoss ;) but many information in this book is very generic to the Java EE platform.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This book is for experienced Java developers and architects but also for developers who would like to think out of their programming box and to see what problems their code might cause in production and how to solve them and avoid similar issues in the future. You can spend a lot of money for professional training on this subject but maybe you should buy this book before to learn techniques and ideas presented by Francesco.&lt;br /&gt;&lt;br /&gt;What I like and don&#39;t like at the same time in this book is that the language is quite &quot;hard-core&quot;. It means that you really need to spend couple of years developing and deploying production code before you can take this book in your hands. This limits the potential audience significantly but on the other hand limits the size of the book as the author does not have to (or want to) explain every little detail that you as a Java developer should know.&lt;br /&gt;&lt;br /&gt;To summarize I think &lt;a href=&quot;https://www.packtpub.com/jboss-5-performance-tuning/book&quot;&gt;&quot;JBoss AS 5 Performance Tuning&quot;&lt;/a&gt; is a really good book one and meets the goals set but the author in 100%. This book is definitely worth it&#39;s price as by reading it and applying knowledge from it you could save a lot of money spent for unnecessary hardware resources that could become redundant after correctly tuning JVM/JBoss or you application.&lt;br /&gt;&lt;br /&gt;Good job guys - I like this book!</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/7177285473773502180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=7177285473773502180' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7177285473773502180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/7177285473773502180'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2011/03/jboss-as-5-performance-tuning-book.html' title='JBoss AS 5 Performance Tuning - book review'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-2182077108861056411</id><published>2010-08-18T08:24:00.001+02:00</published><updated>2010-08-18T08:24:51.297+02:00</updated><title type='text'>Java Best Practices – Vector vs ArrayList vs HashSet</title><content type='html'>Interesting article on Java ArrayList, Vector and HashSet performance comparison:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.javacodegeeks.com/2010/08/java-best-practices-vector-arraylist.html&quot;&gt;Java Code Geeks: Java Best Practices – Vector vs ArrayList vs HashSet&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/2182077108861056411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=2182077108861056411' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/2182077108861056411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/2182077108861056411'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2010/08/java-best-practices-vector-vs-arraylist.html' title='Java Best Practices – Vector vs ArrayList vs HashSet'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-4039711765113330049</id><published>2010-05-07T12:53:00.000+02:00</published><updated>2010-05-07T12:53:30.272+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="book review"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Do NOT write books this way! &quot;Wicket in Action&quot; case.</title><content type='html'>&lt;div style=&quot;float: left&quot;&gt;&lt;img src=&quot;http://ecx.images-amazon.com/images/I/41BHF8SI1aL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg&quot; style=&quot;margin: 0px 5px 5px 0px; width: 250px;&quot; /&gt;&lt;div style=&quot;font-size: xx-small&quot; align=&quot;center&quot;&gt;Copyright (c) Amazon.com&lt;/div&gt;&lt;/div&gt;I&#39;ve been just reading quite a good book on Apache Wicket from Martijn Dashorst and Eelco Hillenius and I got really pissed off at some point. I&#39;ve always loved &quot;... in Action&quot; series because of its language, attitude to teaching the subject and quality of the material. I&#39;ve had the same feelings with current book i.e. &quot;Wicket in Action&quot; until page 219 where authors were presenting advanced custom component creation and under one of the listings they wrote: &quot;an elaborate explanation of it (the listing) is outside the scope of this book&quot;. WTF? &lt;br /&gt;&lt;br /&gt;How can a writer put something like this in his book? If you think the example is too difficult for the scope of current book don&#39;t show it at all! You could also redirect readers to the other resources like: &quot;detailed explanation of this concept can be found at ...&quot;. But writing &quot;an elaborate explanation of it is outside the scope of this book&quot; is just stupid and frivolous! I pay for the book to have explanations of difficult and complicated subjects - not to read that it&#39;s out of the scope (show external resources!).&lt;br /&gt;&lt;br /&gt;Anyway, the book is quite good, but more and more examples in the second half of it are getting blur and need more explanations (maybe better metaphor than a bit artificial &quot;lasagne&quot;?)&lt;br /&gt;&lt;br /&gt;I hope the authors will make an effort and upgrade the content of this book to the newest Wicket release 1.4.x that introduced Java generics and refactored many classes (e.g. validators).</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/4039711765113330049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=4039711765113330049' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/4039711765113330049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/4039711765113330049'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2010/05/do-not-write-books-this-way-wicket-in.html' title='Do NOT write books this way! &quot;Wicket in Action&quot; case.'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-5858245486695744176</id><published>2010-04-26T13:57:00.011+02:00</published><updated>2011-12-09T08:49:45.435+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="concurrency"/><category scheme="http://www.blogger.com/atom/ns#" term="debug"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>When multithreading / multitasking your application doesn&#39;t help...</title><content type='html'>&lt;div style=&quot;float: left&quot;&gt;&lt;a href=&quot;http://www.formula1.com/gallery/race/2010/826/&quot;&gt;&lt;img src=&quot;http://www.formula1.com/wi/597x478/sutton/2010/d10mal1471.jpg&quot; style=&quot;margin: 0px 5px 5px 0px; width: 250px;&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;font-size: xx-small&quot; align=&quot;center&quot;&gt;Copyright (c) &lt;a href=&quot;http://www.formula1.com&quot;&gt;Formula 1&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;Last week we spotted some behaviors of our system that could be improved significantly. In some specific cases our system is sending multiple &lt;b&gt;independent&lt;/b&gt; requests to the underlying subsystems and it is sending them sequentially i.e. is waiting for the first response before sending second request etc. &lt;a name=&#39;more&#39;&gt;&lt;/a&gt;This would not be any problem if this specific processing didn&#39;t take more than 30 seconds (which is our system&#39;s hard timeout).&lt;br /&gt;&lt;br /&gt;First thought was to send all the independent requests simultaneously and to collect responses. This way if each request / response action takes 5 seconds and we have 10 such actions we could get all responses in ~5 seconds, not in over 50. Assumption here is that such processing will take utmost only the time necessary for the longest task to complete. Of course ~5 seconds also depends on thread creation / allocation from the pool overhead but usually could be neglected (we assume that this time is at least order of magnitude lower than time necessary for task to complete). &lt;br /&gt;&lt;br /&gt;The best overview of the problem and the solution I&#39;m writing here can be found in my older post &lt;a href=&quot;http://blog.bielu.com/2008/11/java-concurrency-is-easy-combining.html&quot;&gt;Combining Callable or Runnable with Future and FutureTask&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;java:nogutter&quot;&gt;List&amp;lt;String&amp;gt; urls = new ArrayList&amp;lt;String&amp;gt;() {{&lt;br /&gt;  add(&quot;http://www.java2jee.blogspot.com&quot;);&lt;br /&gt;  add(&quot;http://www.yahoo.com&quot;);&lt;br /&gt;  add(&quot;http://www.msdn.com&quot;);&lt;br /&gt;  add(&quot;http://c2.com/xp/ExtremeProgrammingRoadmap.html&quot;);&lt;br /&gt;  add(&quot;http://apache.org/&quot;);&lt;br /&gt;  add(&quot;http://sourceforge.net/&quot;);&lt;br /&gt;}};&lt;br /&gt;List&amp;lt;Future&amp;lt;Integer&amp;gt;&amp;gt; futures = &lt;br /&gt;  new ArrayList&amp;lt;Future&amp;lt;Integer&amp;gt;&amp;gt;(urls.size());&lt;br /&gt;&lt;br /&gt;final ExecutorService service = &lt;br /&gt;  Executors.newFixedThreadPool(1);&lt;br /&gt;&lt;br /&gt;long start = System.nanoTime();&lt;br /&gt;for (String url : urls) {&lt;br /&gt;  // compile error - create this task first&lt;br /&gt;  futures.add(service.submit(new ProcessUrlTask(url)));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;long result = 0;&lt;br /&gt;for (Future&amp;lt;Integer&amp;gt; future : futures) {&lt;br /&gt;  result += future.get();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;If you manipulate number of threads &lt;tt&gt;Executors.newFixedThreadPool(1)&lt;/tt&gt; you will see performance boost - default value 1 means that all URLs are processed sequentially.&lt;br /&gt;&lt;br /&gt;Coming back to our system - I basically did the same, I created shared thread pool, processing task that was sending request and was waiting for the response, updated unit tests (actually nothing changed here). What was my surprise when I discovered that this &quot;improvement&quot; actually didn&#39;t have any effect! Processing time was the same even though thread creation took ~0ms:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;plain:nogutter&quot;&gt;16:34:04,738 DEBUG[pool-19-thread-5] ...&lt;br /&gt;16:34:04,741 DEBUG[pool-19-thread-2] ...&lt;br /&gt;16:34:04,741 DEBUG[pool-19-thread-8] ...&lt;br /&gt;16:34:04,741 DEBUG[pool-19-thread-7] ...&lt;br /&gt;16:34:04,741 DEBUG[pool-19-thread-3] ...&lt;br /&gt;16:34:04,741 DEBUG[pool-19-thread-6] ...&lt;br /&gt;16:34:04,741 DEBUG[pool-19-thread-1] ...&lt;br /&gt;16:34:04,741 DEBUG[pool-19-thread-4] ...&lt;br /&gt;&lt;/pre&gt;The detail I haven&#39;t mentioned yet is that messages that were supposed to be sent in multiple threads were sent using fancy middleware Java library our team doesn&#39;t develop. But more about it later...&lt;br /&gt;&lt;br /&gt;My improvement sucks because it didn&#39;t shorten time necessary for request processing - still didn&#39;t know why. So, I started my local Tomcat, sent original SOAP request and watched the logs. What I spotted was in fact sequential message send / receive behavior. How is it possible if messages were being sent from different threads? There must be some lock in the middleware library!&lt;br /&gt;This was not so sure and I needed proof before communicating anything to the management. I used my secret weapon i.e. &lt;a href=&quot;http://blog.bielu.com/2009/07/visual-vm-java-tool-you-were-waiting.html&quot;&gt;Visual VM&lt;/a&gt;. In fact I connected to the JVM on which Tomcat server was running and started the test again. During the test I dumped threads and here&#39;s what I got:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;plain:nogutter&quot;&gt;Full thread dump Java HotSpot(TM) Server VM (14.2-b01 mixed mode):&lt;br /&gt;&lt;br /&gt;&quot;pool-2-thread-8&quot; prio=6 tid=0x289ab000 nid=0x1690 in Object.wait() [0x2a92f000]&lt;br /&gt;   java.lang.Thread.State: WAITING (on object monitor)&lt;br /&gt; at java.lang.Object.wait(Native Method)&lt;br /&gt; - waiting on &lt;0x25c34b78&gt; (a java.lang.Object)&lt;br /&gt; at java.lang.Object.wait(Object.java:485)&lt;br /&gt; at company.utils.Mutex.lock(Mutex.java:41)&lt;br /&gt; - locked &lt;0x25c34b78&gt; (a java.lang.Object)&lt;br /&gt; ...&lt;br /&gt; at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)&lt;br /&gt; at java.util.concurrent.FutureTask.run(FutureTask.java:138)&lt;br /&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)&lt;br /&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)&lt;br /&gt; at java.lang.Thread.run(Thread.java:619)&lt;br /&gt;&lt;br /&gt;   Locked ownable synchronizers:&lt;br /&gt; - &lt;0x24ecfea0&gt; (a java.util.concurrent.locks.ReentrantLock$NonfairSync)&lt;br /&gt;&lt;br /&gt;&quot;pool-2-thread-7&quot; prio=6 tid=0x29913400 nid=0x1670 in Object.wait() [0x2a8df000]&lt;br /&gt;   java.lang.Thread.State: WAITING (on object monitor)&lt;br /&gt; at java.lang.Object.wait(Native Method)&lt;br /&gt; - waiting on &lt;0x24fa2558&gt; (a company.lib.Transaction)&lt;br /&gt; at java.lang.Object.wait(Object.java:485)&lt;br /&gt; at company.lib.Transaction.waitForCompletion(Transaction.java:530)&lt;br /&gt; - locked &lt;0x24fa2558&gt; (a company.lib.Transaction)&lt;br /&gt; ...&lt;br /&gt; at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)&lt;br /&gt; at java.util.concurrent.FutureTask.run(FutureTask.java:138)&lt;br /&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)&lt;br /&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)&lt;br /&gt; at java.lang.Thread.run(Thread.java:619)&lt;br /&gt;&lt;br /&gt;   Locked ownable synchronizers:&lt;br /&gt; - &lt;0x24ecfb50&gt; (a java.util.concurrent.locks.ReentrantLock$NonfairSync)&lt;br /&gt;&lt;br /&gt;&quot;pool-2-thread-6&quot; prio=6 tid=0x293ffc00 nid=0x1674 in Object.wait() [0x2a88f000]&lt;br /&gt;   java.lang.Thread.State: WAITING (on object monitor)&lt;br /&gt; at java.lang.Object.wait(Native Method)&lt;br /&gt; - waiting on &lt;0x25c34b78&gt; (a java.lang.Object)&lt;br /&gt; at java.lang.Object.wait(Object.java:485)&lt;br /&gt; at company.utils.Mutex.lock(Mutex.java:41)&lt;br /&gt; - locked &lt;0x25c34b78&gt; (a java.lang.Object)&lt;br /&gt;&lt;br /&gt;... remainder omitted&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Conclusions: middleware library used to send messages is &quot;queuing&quot; all the messages - if I can write &quot;queue&quot; about basic Java monitor lock (inside &lt;tt&gt;company.utils.Mutex.lock()&lt;/tt&gt; method):&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;java:nogutter&quot;&gt;synchronized(lock) {&lt;br /&gt; while(locked) {&lt;br /&gt;   lock.wait();&lt;br /&gt; } &lt;br /&gt; locked = true;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;And the lock was the current session object - it means that if I want to use 5 different threads to send messages simultaneously I have to create 5 different sessions (which in turn means that I have to log in to the system five times with the same credentials). This is additional memory and performance overhead we can&#39;t accept at this time. Not to mention our questions why session in this middleware does not allow us to send messages from many threads at the same time?&lt;br /&gt;&lt;br /&gt;At this moment we abandoned improving this part of the system - it&#39;s hardly possible with current middleware implementation.</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/5858245486695744176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=5858245486695744176' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/5858245486695744176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/5858245486695744176'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2010/04/when-multithreading-your-application.html' title='When multithreading / multitasking your application doesn&#39;t help...'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-6634821089577839590</id><published>2010-03-08T13:00:00.004+01:00</published><updated>2014-02-03T10:53:05.582+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Mylyn"/><category scheme="http://www.blogger.com/atom/ns#" term="video"/><title type='text'>How to create Mylyn Connector Plugin - part 1</title><content type='html'>Quite recently I struggled with my company&#39;s internal bug tracker, especially lack of Mylyn integration in Eclipse. The easiest way to make it work was just to develop it :) I started with &lt;a href=&quot;http://wiki.eclipse.org/Mylyn_Integrator_Reference&quot;&gt;Mylyn/Integrator Reference&lt;/a&gt; but as usual Eclipse documentation sucks (I used to develop a lot of SWT/JFace applications and the best documentation I found was outside of Eclipse). It&#39;s too short, too shallow and most of all written by/to people who knows Mylyn APIs and architecture quite well. As far as I understand someone who wants just to integrate Mylyn with some bug tracker doesn&#39;t have to have this kind of knowledge, but I also understand that Mylyn guys don&#39;t really have time for stuff like this.&lt;br /&gt;&lt;br /&gt;Anyway, I also found very short tutorial (&lt;a href=&quot;http://jvliet.blogspot.com/2007/02/creating-mylar-connector-plugin-for.html&quot;&gt;http://jvliet.blogspot.com/2007/02/creating-mylar-connector-plugin-for.html&lt;/a&gt;) explaining in a bit more details how to create Eclipse PDT project etc. But this tutorial doesn&#39;t explain all the tiny details that made me spend many hours wondering HTF it should all work together.&lt;br /&gt;&lt;br /&gt;In this short series of posts I&#39;ll try to give you much simpler tutorial (for morons like me) how to start new Mylyn Connector Plugin even if you&#39;re new to Eclipse Plug-in Development. &lt;b&gt;I&#39;ll save your time!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;OK - let&#39;s start. First video shows how to checkout Eclipse Mylyn and Trac packages (only packages required for connector development reference). In all tutorials authors say that you should take Trac Connector as example but they never point to concrete CVS repository and CVSROOT directory. I do:&lt;br /&gt;&lt;br /&gt;&lt;iframe width=&quot;470&quot; height=&quot;400&quot; src=&quot;//www.youtube.com/embed/oWdhrJogcG8&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Second video shows how to create new Mylyn connector project and make it visible in the new Mylyn Connection wizard (I took icons from Trac for simplicity - you can/should use your own). All steps in this tutorial are MANDATORY - if you miss something I&#39;m 99.9% sure it will not work: &lt;br /&gt;&lt;br /&gt;&lt;iframe width=&quot;470&quot; height=&quot;400&quot; src=&quot;//www.youtube.com/embed/F6Jir0CIyLs&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Enjoy and stay tuned for more videos in the upcoming weeks...&lt;br /&gt;&lt;br /&gt;PS. I used Eclipse 3.5 (Galileo): &lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/__TpWDBZjanA/S5PHiep1niI/AAAAAAAANeU/WMWgV_Wz60s/s1600-h/eclipse.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/__TpWDBZjanA/S5PHiep1niI/AAAAAAAANeU/WMWgV_Wz60s/s320/eclipse.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/6634821089577839590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=6634821089577839590' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/6634821089577839590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/6634821089577839590'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2010/03/creating-mylyn-connector-plugin-part-1.html' title='How to create Mylyn Connector Plugin - part 1'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/__TpWDBZjanA/S5PHiep1niI/AAAAAAAANeU/WMWgV_Wz60s/s72-c/eclipse.PNG" height="72" width="72"/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-3108171889285142328</id><published>2010-02-03T08:06:00.002+01:00</published><updated>2010-02-03T08:06:00.716+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="commercial"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>JavaOne is dead?</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/__TpWDBZjanA/S2iLrJEKt-I/AAAAAAAANTw/neSzk3wRkvk/javaone.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/__TpWDBZjanA/S2iLrJEKt-I/AAAAAAAANTw/neSzk3wRkvk/javaone.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;I was just looking for the information regarding JavaOne 2010 and found some worrisome blog posts:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.javaworld.com/community/?q=node/3040&quot;&gt;Was JavaOne 2009 the last?&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://explodingpixels.wordpress.com/2009/12/03/javaone-2010/&quot;&gt;JavaOne 2010?&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.adam-bien.com/roller/abien/entry/javaone_2010_seems_like_it&quot;&gt;JavaONE 2010? Seems Like It Will Take Place&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;According to the Moscone Center &lt;a href=&quot;http://www.moscone.com/site/do/event/list?nav.type=0&amp;amp;nav.filter=1006&amp;amp;nav.base=0912&quot;&gt;website&lt;/a&gt; JavaOne 2010 is already scheduled between 22nd - 25th of June 2010.&lt;br /&gt;&lt;br /&gt;I hope to go there this year! Keep your fingers crossed for my dept&#39;s budget :)</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/3108171889285142328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=3108171889285142328' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3108171889285142328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3108171889285142328'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2010/02/javaone-is-dead.html' title='JavaOne is dead?'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/__TpWDBZjanA/S2iLrJEKt-I/AAAAAAAANTw/neSzk3wRkvk/s72-c/javaone.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-8075347190960569782</id><published>2010-02-02T10:33:00.002+01:00</published><updated>2010-02-02T10:36:00.830+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="buzz"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="tool"/><title type='text'>Memory Leak Protection in Tomcat 7 - fwd</title><content type='html'>&lt;div style=&quot;float: left&quot;&gt;&lt;a href=&quot;http://java.dzone.com/articles/memory-leak-protection-tomcat&quot;&gt;&lt;img src=&quot;http://www.dzone.com/sites/all/files/20845.jpg&quot; style=&quot;margin-right: 5px; width: 200px;&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;font-size: xx-small&quot; align=&quot;center&quot;&gt;Picture (c) DZone&lt;/div&gt;&lt;/div&gt;I&#39;m just forwarding you to a &lt;a href=&quot;http://java.dzone.com/articles/memory-leak-protection-tomcat&quot;&gt;good article&lt;/a&gt; on memory leaks protection implementation in the upcoming Apache Tomcat 7.&lt;br /&gt;&lt;br /&gt;This article is a in a form of short (but quite comprehensive) interview with:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Mark Thomas, a Senior Software Engineer with SpringSource and committer for Apache Tomcat&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Mark points directly to SVN repository where you can actually see how the mechanism he&#39;s describing works under the hood.&lt;br /&gt;&lt;br /&gt;Mark also mentions about other new features that will be available in new Tomcat 7 (which should be released in &lt;i&gt;alpha&lt;/i&gt; in Feb 2010).</content><link rel="related" href="http://java.dzone.com/articles/memory-leak-protection-tomcat" title="Memory Leak Protection in Tomcat 7 - fwd"/><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/8075347190960569782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=8075347190960569782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/8075347190960569782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/8075347190960569782'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2010/02/memory-leak-protection-in-tomcat-7-fwd.html' title='Memory Leak Protection in Tomcat 7 - fwd'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-5457953459380283794</id><published>2010-02-01T16:59:00.004+01:00</published><updated>2010-02-02T10:34:42.147+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>How to ensure your IE toolbar buttons are always visible?</title><content type='html'>Some time ago I encountered a wall while developing add-on for Internet Explorer. I wanted my add-on&#39;s button to be always visible after installation process, similarly to &lt;a href=&quot;http://delicious.com/help/installie&quot;&gt;delicious&lt;/a&gt; stuff.&lt;br /&gt;&lt;br /&gt;Problem seems to be quite simple - just check Browser Helper Object&#39;s (BHO) options and set some flag (aside of this subject I will tell you that developing pure BHO is a nightmare). In fact there is no such option. Internet Explorer seemed not extensible to this extent. Also finding something in the Internet appeared to be impossible. What the hell? Delicious guys made it!&lt;br /&gt;&lt;br /&gt;After quite long searching I was very close to give up and resign from this &quot;feature&quot;. But my sixth sense (yes, you should use it a lot while working with Microsoft) was telling me - &quot;check the registry&quot;. So I did, and it was a bull&#39;s eye shot.&lt;br /&gt;&lt;br /&gt;The thing you have to do is to increase the width of Tool Band Width of Internet Explorer (my NSIS script contains this):&lt;br /&gt;&lt;pre&gt;WriteRegDWORD HKCU &quot;Software\Microsoft\Internet Explorer\CommandBar&quot; &quot;ToolBandWidth&quot; 800&lt;br /&gt;&lt;/pre&gt;It&#39;s very very primitive but it&#39;s the only solution I found to work. You just have to provide the desired width in pixels (decimal value) you&#39;d like IE toolbar to be. Don&#39;t worry - you can put there even a value of 3000 - IE is smart enough not to extend the toolbar more than needed i.e. if you put a value of 1000 and your buttons need only 500 pixels IE will automatically adjust toolbar width to 500px.&lt;br /&gt;&lt;br /&gt;This solution works but has also a big disadvantage. As you can see I write information to the registry for HKCU (HKEY_CURRENT_USER), so if you are installing the add-on with user Administrator, only this user will have Tool Band enlarged. If you open IE with another user she will probably not see your add-on button(s) (applies to IE7 and IE8).&lt;br /&gt;&lt;br /&gt;Until now I couldn&#39;t find a better way - did you?</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/5457953459380283794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=5457953459380283794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/5457953459380283794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/5457953459380283794'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2010/02/how-to-ensure-your-ie-toolbar-buttons.html' title='How to ensure your IE toolbar buttons are always visible?'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-2574752153966453252</id><published>2010-01-18T08:00:00.004+01:00</published><updated>2010-01-18T08:00:00.086+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="book review"/><category scheme="http://www.blogger.com/atom/ns#" term="buzz"/><category scheme="http://www.blogger.com/atom/ns#" term="commercial"/><title type='text'>Tomcat 6 Developer&#39;s Guide - book review</title><content type='html'>&lt;div style=&quot;float: left&quot;&gt;&lt;a href=&quot;http://www.packtpub.com/tomcat-6-developers-guide/book&quot;&gt;&lt;img src=&quot;https://www.packtpub.com/images/full/1847197280.jpg&quot; style=&quot;margin-right: 5px; width: 150px;&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;font-size: xx-small&quot; align=&quot;center&quot;&gt;Picture (c) Packt Publishing&lt;/div&gt;&lt;/div&gt;Few days ago I received brand new &lt;a href=&quot;http://www.packtpub.com/tomcat-6-developers-guide/book&quot;&gt;&quot;Tomcat 6 Developer&#39;s Guide&quot;&lt;/a&gt; book which I’ll try to review shortly here. The book is best described in few sentences by the author himself:&lt;br /&gt;&lt;blockquote&gt;&quot;While Tomcat is one of the most popular servlet containers, its inner workings still remain a mystery to many developers. If you only have a superficial familiarity of how this container actually functions, much of its power remains untapped and underutilized. [...]&quot;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Before I start let me just mention that I’m experienced Java and Java EE developer and have worked with Tomcat server (with breaks) since version 4.x (year 2003). This means that I know how to develop, deploy, monitor and tune web applications in this web server. I also worked a little bit with Tomcat internals like custom class loaders. Despite that, this book gave me even more information and knowledge. With this book I was able not only to understand how Tomcat works internally but also where and how I could improve it or basically modify internal components for my needs. &lt;br /&gt;&lt;br /&gt;Let’s start the review here - first of all I’d like to say that the author &lt;a href=&quot;http://www.packtpub.com/author_view_profile/id/381&quot;&gt;Damodar Chetty&lt;/a&gt; meets his goals in this book. He states in the preface that this book is not for web developers who want to learn how to write Java Servlet / JSP applications and how to deploy them in Tomcat container. I totally agree with the author – this book will not teach you that. This book is for people who want to know how Tomcat works internally in order to tune it or modify it for specific needs.&lt;br /&gt;&lt;br /&gt;The author promises to go deep inside Tomcat’s architecture and implementation in order to better understand what’s under the hood, how it works and how you can improve or monitor it. I can assure you that this goal is met. This book describes in detail also other aspects of Java EE environment that are not directly connected to the Tomcat container but on which its implementation is based.&lt;br /&gt;&lt;br /&gt;In this book Damodar Chetty firstly describes Tomcat’s high-level architecture and then breaks them down up to basic Java classes. This way he makes the whole complex architecture easy to understand. The author describes all Tomcat’s components one by one which is reflected in the &lt;a href=&quot;http://www.packtpub.com/article/tomcat-6-developers-guide-table-of-contents&quot;&gt;Table of Contents&lt;/a&gt;. I think the author’s intention here was to make the reader read the book from cover to cover. I think so, because if you just want to learn about one particular component it will be a bit difficult to understand all the references to the previous sections. In my opinion this book should be read entirely to make every aspect clear, otherwise you will need to go back in the book and search for previously explained subjects, which is not easy.&lt;br /&gt;This book is definitely component-oriented rather than how-to- or problem-oriented, so if you have a concrete problem or question regarding Tomcat you may have problems finding answer in this book.&lt;br /&gt;&lt;br /&gt;All topics are difficult and in my opinion this book is for experienced Java and Java EE developers and administrators. In this field the book fully satisfied me. More so, many topics like &quot;URLs and protocol handlers&quot;, &quot;Java class loading&quot; or &quot;Implementing a custom class loader&quot; may be very useful out of the scope of Tomcat server.&lt;br /&gt;&lt;br /&gt;What I like in this book’s style is that all, even most complex subjects are explained in a clear way. Every complex component is broken down into pieces that are more easy to explain and understand. This book is also very concise in the source code examples. This makes it more time-consuming to read but on the other hand it forces the reader to understand the subject rather to copy-paste included source code. This aspect again makes this book accessible for experienced developers who know Java and Java EE environments pretty well and are able to start developing their own examples from the textual description.&lt;br /&gt;&lt;br /&gt;This book does not promise to cover all the subjects around Tomcat but few of them are really missing in my opinion. Despite full description of how Tomcat is built and how it works I really miss chapters describing how to configure load-balancer for Tomcat or a cluster of Tomcat web servers. I know there are many books or Internet resources that cover these subjects but it would be just nice to have it here. I also realize that load-balancers and clustering components are not core Tomcat components and maybe this is the reason why they are not covered in this book.&lt;br /&gt;&lt;br /&gt;To summarize, I think &quot;Tomcat 6 Developer&#39;s Guide&quot; book is a really good one and describes Tomcat web server in a pretty detailed fashion. Please note again that you will not learn from this book how to develop web applications using Java Servlet and JSP technologies. You will learn how to effectively use and also modify tomcat internals for you specific needs. You need to be experienced Java / Java EE developer to fully understand all the topics and successfully apply knowledge from this book. I would basically recommend you reading full description of this book available &lt;a href=&quot;http://www.packtpub.com/tomcat-6-developers-guide/book#indetail&quot;&gt;here&lt;/a&gt; before buying it.</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/2574752153966453252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=2574752153966453252' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/2574752153966453252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/2574752153966453252'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2010/01/tomcat-6-developers-guide-book-review.html' title='Tomcat 6 Developer&#39;s Guide - book review'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-8104640354175442837</id><published>2009-12-21T11:32:00.005+01:00</published><updated>2010-01-08T08:27:39.014+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="buzz"/><category scheme="http://www.blogger.com/atom/ns#" term="commercial"/><title type='text'>Tomcat 6 Developer&#39;s Guide is here</title><content type='html'>&lt;div style=&quot;float: left&quot;&gt;&lt;a href=&quot;http://www.packtpub.com/tomcat-6-developers-guide/book&quot;&gt;&lt;img src=&quot;https://www.packtpub.com/images/full/1847197280.jpg&quot; style=&quot;margin-right: 5px; width: 150px;&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;font-size: xx-small&quot; align=&quot;center&quot;&gt;Picture (c) Packt Publishing&lt;/div&gt;&lt;/div&gt;Few days ago I was contacted by Amit Sharma (Marketing Research Executive at Packt Publishing) who asked me if I can review their new book &lt;a href=&quot;http://www.packtpub.com/tomcat-6-developers-guide/book&quot;&gt;Tomcat 6 Developer&#39;s Guide&lt;/a&gt;. It was published just few days ago and sound interesting, so I agreed.&lt;br /&gt;&lt;br /&gt;I expect the book to be rather for advanced users who want to dig in into Tomcat&#39;s architecture and more tricky configurations (e.g. SSL and load balancing with Apache front-end, clustering, security realms for Single Sign-In like Kerberos or Windows NTLM).&lt;br /&gt;&lt;br /&gt;My short review of the book will follow shortly (in mid Jan 2010). Stay tuned!</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/8104640354175442837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=8104640354175442837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/8104640354175442837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/8104640354175442837'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2009/12/tomcat-6-developers-guide-is-here.html' title='Tomcat 6 Developer&#39;s Guide is here'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-3912050850865087090</id><published>2009-12-16T18:51:00.001+01:00</published><updated>2009-12-21T11:32:53.492+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="buzz"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><title type='text'>Spring 3.0 goes public</title><content type='html'>Here it is &lt;a href=&quot;http://www.springsource.com/download&quot;&gt;http://www.springsource.com/download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Spring 3.0 is here and I hope it will serve Java developers as good as the previous releases. Spring Framework used to be &lt;i&gt;de facto&lt;/i&gt; Java EE standard and I believe it will remain so for the next couple of years:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;For some very recent news, Spring 3.0 GA is compatible with Java EE 6 final in terms of runtime environments now (e.g. on GlassFish v3 as released last week) and supports JPA 2.0 final already (e.g. using EclipseLink 2.0). We also support the newly introduced &lt;a href=&quot;http://java.sun.com/javaee/6/docs/api/javax/annotation/ManagedBean.html&quot; onclick=&quot;javascript:urchinTracker(&#39;/outbound/java.sun.com&#39;);&quot;&gt;@ManagedBean&lt;/a&gt; (JSR-250 v1.1) annotation for component scanning now, which nicely complements our &lt;a href=&quot;http://java.sun.com/javaee/6/docs/api/javax/inject/Inject.html&quot; onclick=&quot;javascript:urchinTracker(&#39;/outbound/java.sun.com&#39;);&quot;&gt;@Inject&lt;/a&gt; (JSR-330) support for annotation-driven dependency injection.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;More details in these posts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://blog.springsource.com/2009/12/16/spring-framework-3-0-goes-ga/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+Interface21TeamBlog+%28SpringSource+Team+Blog%29&quot;&gt;Spring Framework 3.0 goes GA&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.springsource.org/node/2266&quot;&gt;Spring 3.0.0 is Now Available&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/3912050850865087090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=3912050850865087090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3912050850865087090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/3912050850865087090'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2009/12/spring-30-goes-public.html' title='Spring 3.0 goes public'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37306137.post-535842915964543183</id><published>2009-09-29T13:56:00.003+02:00</published><updated>2010-02-26T09:18:32.660+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><title type='text'>Server timeout for maven release:perform or site:deploy</title><content type='html'>I just wanted to release a piece of software I&#39;m working on when I encountered a wall. Big, high and not very talkative wall - read timeout. I thought maybe the configuration of the server (and Web DAV) I described in &lt;a href=&quot;http://blog.bielu.com/2008/02/maven-artifactory-continuum.html&quot;&gt;this post&lt;/a&gt; has changed? No way - everything is like it was. The only thing that has changed is Maven version from 2.0.9 to 2.2.1 (where you don&#39;t have to define DAV extension in the &lt;tt&gt;build&lt;/tt&gt; part).&lt;br /&gt;&lt;br /&gt;Fortunately I also had my old environment where it worked (I meanMmaven 2.0.9). I noticed that the full build takes over 2 minutes while on the new Maven I get the timeout after 1 minute and few seconds. This way I realized that maybe increasing the timeout value will help. &lt;b&gt;IT DID!!!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So how to do this? It&#39;s simple - just add:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;xml:nogutter&quot;&gt;&amp;lt;servers&amp;gt;&lt;br /&gt;  &amp;lt;server&amp;gt;&lt;br /&gt;    &amp;lt;id&amp;gt;someId&amp;lt;/id&amp;gt;&lt;br /&gt;    &amp;lt;username&amp;gt;blahblah&amp;lt;/username&amp;gt;&lt;br /&gt;    &amp;lt;password&amp;gt;blahblah&amp;lt;/password&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;      &amp;lt;timeout&amp;gt;120000&amp;lt;/timeout&amp;gt; &amp;lt;!-- your timeout in milliseconds --&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;  &amp;lt;/server&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;&lt;/pre&gt;in the &lt;tt&gt;MAVEN_HOME/conf/settings.xml&lt;/tt&gt; file and restart your Maven task.&lt;br /&gt;&lt;br /&gt;Enjoy!</content><link rel='replies' type='application/atom+xml' href='http://blog.bielu.com/feeds/535842915964543183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37306137&amp;postID=535842915964543183' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/535842915964543183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37306137/posts/default/535842915964543183'/><link rel='alternate' type='text/html' href='http://blog.bielu.com/2009/09/server-timeout-for-maven-releaseperform.html' title='Server timeout for maven &lt;code&gt;release:perform&lt;/code&gt; or &lt;code&gt;site:deploy&lt;/code&gt;'/><author><name>Przemysław Bielicki</name><uri>http://www.blogger.com/profile/15413461498736691725</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>