4 Replies Latest reply on Oct 24, 2012 4:08 AM by jmsjr

    Bug(?): Classloader stuck on WAITING (on object monitor) when loading from a module

    jmsjr Newbie

      Summary:

       

      1) JBoss 7.1.1 ( Brontes )

      2) Window7 64-bit

      3) JDK 1.7.0_04 ( 32-bit / x86 )

       

      4) I have defined a module to the necessity for it to use a native libary ( .dll ), as follows:

       

      Under modules, I have the following:

       

      -- com/staffware/sso/main

        \--> module.xml

        \-->        ssoJBase.jar

        \-->        lib

             \-->                  win-i686

                \--> icudt36.dll  icuuc36.dll  ssoJNI.dll

             \-->                  win-x86_64

                \--> icudt36.dll  icuuc36.dll  ssoJNI.dll

       

      The contents of the module.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.1" name="com.staffware.sso">

          <resources>

              <resource-root path="ssoJBase.jar"/>

          </resources>

       

          <dependencies>

              <module name="java.util.logging"/>

          </dependencies>

      </module>

       

      5) In my webapp, I have the following WEB-INF/jboss-deployment-structure.xml:

       

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure>

        <deployment>

          <dependencies>

            <module name="com.staffware.sso" />

          </dependencies>

        </deployment>

      </jboss-deployment-structure>

       

      6) When I am using the class that is in the module within by JSF webapp, the JSF request is stuck at the INVOKE_APPLICATION lifecycle forever:

       

      http--0.0.0.0-8081-1" daemon prio=6 tid=0x0707a000 nid=0x2b14 in Object.wait() [0x0658c000]

         java.lang.Thread.State: WAITING (on object monitor)

                at java.lang.Object.wait(Native Method)

                - waiting on <0x14267700> (a org.jboss.modules.Module)

                at java.lang.Object.wait(Object.java:503)

                at org.jboss.modules.Module.getPaths(Module.java:1141)

                - locked <0x14267700> (a org.jboss.modules.Module)

                at org.jboss.modules.Module.getPathsUnchecked(Module.java:1164)

                at org.jboss.modules.Module.loadModuleClass(Module.java:512)

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                at java.lang.ClassLoader.defineClass1(Native Method)

                at java.lang.ClassLoader.defineClass(ClassLoader.java:791)

                at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

                at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                at java.lang.Class.getDeclaredConstructors0(Native Method)

                at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)

                at java.lang.Class.getConstructor0(Class.java:2714)

                at java.lang.Class.newInstance0(Class.java:343)

                at java.lang.Class.newInstance(Class.java:325)

                at au.aas.com.bpm.SessionFactory.getSession(SessionFactory.java:16)

                at au.aas.com.bpm.insurance.SessionController.createSession(SessionController.java:99)

                at au.aas.com.bpm.insurance.SessionController.release(SessionController.java:221)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:601)

                at org.apache.el.parser.AstValue.invoke(AstValue.java:262)

                at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

                at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

                at javax.faces.component.UICommand.broadcast(UICommand.java:315)

                at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)

                at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)

                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

                at java.lang.Thread.run(Thread.java:722)

       

       

       

      7) If I don't use a module, and simply use -Djava.library.path directly within standalone.conf.bat, and then include the JAR that was in the module into WEB-INF/lib, I get:

       

      Native Library C:\jboss-as-7.1.1.Final\opt\lib\x86\icudt36.dll already loaded in another classloader

       

       

      Thanks.