JBoss Startup Takes Very Long

In the last weeks we noted startup problems of our productive JBoss server several times: either it did not startup at all or it took very (up to an hour!) long.

In the server log files we found exceptions like this one:

2011-04-19 08:36:09,484 ERROR [de.absoft.portal.core.listener.PortletContextListener] Exception while parsing 'portlet.xml'
org.dom4j.DocumentException: Error on line 573 of document http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd : src-resolve: Cannot resolve the name 'xml:lang' to a(n) 'attribute declaration' component. Nested exception: src-resolve: Cannot resolve the name 'xml:lang' to a(n) 'attribute declaration' component.

We figured out that the exception is thrown when this document on the Sun webpage is – for whatever reason – not reachable. Additionally this error may also occur if you try to start JBoss without an internet connection at all.

But the main problem is that before it throws this exception, it waits for a timeout. This leads to the extremely long startup time in this case.

As it is completely insane that the JBoss startup relies on a Sun server that obviously does not run very steadily, we searched for a solution.

The only reason for this issue was that the validation feature was enabled in code. So we just needed to remove these lines of code:

reader.setFeature("http://xml.org/sax/features/validation", true);
reader.setFeature("http://apache.org/xml/features/validation/schema", true);
reader.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
reader.setFeature("http://apache.org/xml/features/validation/dynamic", true);

Of course, this validation feature is very useful for debugging reasons, but it should definitely be disabled for productive environments.

Did you also note JBoss startup problems due to this feature already yourself?

This post is also available in Deutsch.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>