#1305 95 jars in lib dir makes jboss explode


Came across this obscure bug since we put a lot of
stuff in the standard jboss 'lib' dir.

Take a 3.2 release, and put into server/default/lib a
number of tiny jar files (my example contained a single
text file and manifest). Keep adding copies of this jar
until the total number of jars in the directory reaches 95.

Then 'run'. Whilst trying to deploy jboss-service.xml
you get CNFE's for each MBean class mentioned in the
xml file.

I turned on a whole pile of tracing information with
-Dlog4.configuration=log4-trace.properties and
discovered that the CNFE is caused by a
StackOverFlowError where the class loader tries to load
the jar protocol handler and gets into an infinite
recursion. However this is just the symptom - I suspect
there is a hard limit somewhere in the unified class
loading structure which is causing some class loaders
to 'fall off the front'.

There are lots of workarounds to this obviously but it
looks like I'm hitting a limit somewhere.

Chris Harris


  • Jeff Gettle

    Jeff Gettle - 2003-05-06

    Logged In: YES

    We had a similar problem on Solaris 8 with the sun 1.4.1_02
    jdk. We were able to get past the problem by setting the
    stack size(-Xss) higher than the default of 512K. We traced
    it down to the number of jars in the server/[config]/lib
    directory. The more jars added here the larger the thread
    stack size needed to be... It appears as if the jars are
    being added to the classpath recursively. It pains me to
    have to set the thread stack unnecessarily high just to get
    the vm started.

  • Scott M Stark

    Scott M Stark - 2003-05-06

    Logged In: YES

    There is no fixed limit to the number of jars, it just
    depends on the system vm stack limits. The problem is
    another variation of the
    org.jboss.net.protocol.URLStreamHandlerFactory's interaction
    with class loaders causing a recursive loop when finding jar
    protocol handlers. A check has been added to the
    createURLStreamHandler(String) method to avoid recursion and
    I can startup with over 1000 jars in the lib directory.

  • Scott M Stark

    Scott M Stark - 2003-05-06
    • assigned_to: nobody --> starksm
    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks