1 Reply Latest reply on Oct 12, 2010 2:06 PM by bganguly

    Problem with Servlet Initialization in JBoss 5.1.0/JDK 1.6

    bganguly

      Hi,

      I have recently upgraded my JBoss 4.2.2 to JBoss 5.10 running on Java 1.6.

      The first issue that I'm facing is servlet initialization. We have servlets setup to load on startup with proper load order.

      First three of them are loading fine, but it is not progressing to load other servlets which are specified in the web.xml.

      We are not doing anything memory intensive in the init() method of the servlets, just reading the init params.

       

      Error stack that appears when we force stop the server looks like this :-

       

      2010-10-12 08:22:36,685 INFO  [STDOUT] (main) 3. Inside Finengine startup servlet .......
      2010-10-12 08:22:36,685 INFO  [STDOUT] (main) Inside Finengine startup loop .......
      2010-10-12 08:22:36,685 INFO  [STDOUT] (main) Going to leave Finengine startup servlet .......
      2010-10-12 09:06:48,139 WARN  [org.jboss.detailed.classloader.ClassLoaderManager] (main) Unexpected error during load of:javax.servlet.http.HttpServletResponse
      java.lang.OutOfMemoryError: Java heap space
      at java.util.Arrays.copyOf(Arrays.java:2882)
      at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
      at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
      at java.lang.StringBuilder.append(StringBuilder.java:119)
      at org.jboss.virtual.plugins.context.zip.ZipEntryHandler.getRealURL(ZipEntryHandler.java:252)
      at org.jboss.virtual.plugins.context.DelegatingHandler.getRealURL(DelegatingHandler.java:222)
      at org.jboss.virtual.VFSUtils.getRealURL(VFSUtils.java:1064)
      at org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy.getProtectionDomain(VFSClassLoaderPolicy.java:651)
      at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:547)
      at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:507)
      at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
      at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
      at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:452)
      at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:251)
      at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:150)
      at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:265)
      at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1119)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:798)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:441)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
      at java.lang.Class.getConstructor0(Class.java:2699)
      at java.lang.Class.newInstance0(Class.java:326)
      at java.lang.Class.newInstance(Class.java:308)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:264)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:256)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
      2010-10-12 09:06:48,139 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/]] (main) Marking servlet FormRunServlet as unavailable

       

      Finengine startup servlet is the 3rd servlet which loads, but after that it seems that the server never gets to FormRunServlet which is the next servlet that is supposed to be initialized.

       

      Appreciate any help to resolve this issue.

       

      Thanks

      Biswajit

        • 1. Re: Problem with Servlet Initialization in JBoss 5.1.0/JDK 1.6
          bganguly

          The difference between the servlet which gets initialized and the one not is like this :-

           

          The servlet which gets initialized extends a CustomHttpServlet base class which is placed in a jar in JBoss/server/default/lib folder.The CustomHttpSevlet extends the standard HttpServlet.

           

          The servlet which doesn't get initialized directly extends HttpServlet.

           

          In order to verfiy if the problem is related to this, I changed the servlet which was not getting initialized to extend CustomHttpServlet instead of directly extend HttpServlet, and now it gets loaded.However we cannot do the same for all, like while loading Struts Action Servlet etc we cannot take this approach. Trying to figure out if there is any classloading issue that I'm running into.