4 Replies Latest reply on Jan 13, 2015 3:58 AM by sanjay05222

    JBPM6: Singleton not set for ModuleClassLoader for Module Exception occurs when a process started from the jsp page

    inoshikag

      I get the following error when I try to start the process from the JSP page.

      For the first time, I start the jboss and start the process , this error does not occur. Therefore, I have to restart each time to start a process or to  a complete a task which is not practical. I deployed the evaluation as Per Request deployment. Still i get this error.

      It might be a library issue. Please help me to find this. Highly appreciate even a clue to proceed.

      I am struggling this for last few weeks.

       

      org.jboss.resteasy.spi.ReaderException: java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "deployment.Evaluation.war:main" from Service Module Loader. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.

      19:36:31,447 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:469)

      19:36:31,450 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:377)

      19:36:31,453 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:350)

      19:36:31,456 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:344)

      19:36:31,459 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:323)

      19:36:31,462 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:110)

      19:36:31,466 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jbpm.services.task.impl.command.CommandBasedTaskService.getTasksAssignedAsPotentialOwner(CommandBasedTaskService.java:185)

      19:36:31,469 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at com.sample.DemoRun.submitProcess(DemoRun.java:53)

      19:36:31,471 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at com.sample.ActionServlet.doGet(ActionServlet.java:34)

      19:36:31,473 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)

      19:36:31,475 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

      Caused by: java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "deployment.Evaluation.war:main" from Service Module Loader. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.

      19:36:31,521 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:75)

      19:36:31,524 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.weld.Container.instance(Container.java:54)

      19:36:31,526 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:67)

      19:36:31,529 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)

      19:36:31,531 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.kie.services.remote.rest.JaxbContextResolver$Proxy$_$$WeldClientProxy.getContext(JaxbContextResolver$Proxy$$$_WeldClientProxy.java)

      19:36:31,535 ERROR [stderr] (http-localhost-127.0.0.1-8080-5) at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBContextFinder.findProvidedJAXBContext(AbstractJAXBContextFinder.java:76)

      The logic is written as follows.

         String deploymentId = "org.jbpm:Evaluation:1.0";

      URL baseUrl = new URL("http://localhost:8080/jbpm-console");

        String username = "krisv";

        String password = "krisv";

        RemoteRestRuntimeFactory rFactory = new RemoteRestRuntimeFactory( deploymentId, baseUrl, username, password); 

        RemoteRuntimeEngine engine = rFactory.newRuntimeEngine();

        KieSession ksession = engine.getKieSession();

        TaskService taskService = engine.getTaskService();

        Map<String, Object> params = new HashMap<String, Object>();

        params.put("employee", "krisv");

        params.put("reason", "Yearly performance evaluation");

        ProcessInstance pInstance = ksession.startProcess("evaluation", params);

        long parentId = pInstance.getId();

        • 1. Re: JBPM6: Singleton not set for ModuleClassLoader for Module Exception occurs when a process started from the jsp page
          swiderski.maciej

          what exactly version do you use? Is it 6.0 or 6.1? Would be best to have reproducer like a tiny or mavenized web app that illustrates it.

           

          HTH

          • 2. Re: JBPM6: Singleton not set for ModuleClassLoader for Module Exception occurs when a process started from the jsp page
            siegbert

            Hi Maciej,

            I have a similar problem.

            - workbench: 6.1.0.Final

            - as:wildfly

            A process deployt on the workbench can be started several times via JavaRestRemote-API without problems by JunitTestcases.

            BUT if I try to start the same process via JavaRestRemote-API from within a small Webapp (jsp/servlet/Ejb/--> JavaRestRemoteAPI)

            the start is only succesful the first time after jboss start. the second time I got the exception below.

            The webapp is deployed on the same jboss as the workbench.

             

            The webapp is derived (changed to JavaRestRemote) from the rewards basic: jbpm-6-examples/rewards-basic at master · jsvitak/jbpm-6-examples · GitHub

            Is there somewhere an example webapp for JavaRestRemote which is working on the currentsetup (6.1.0.Final, wildfly) ?

            Or are there general problems with JavaRestRemote called by Webapp?

             

            Thanks in advance.

            Regards Siegbert

             

            Here the exception:

            The process at the workbench is successfully processed but the response building is not possible the second time.

             

            Caused by: org.jboss.resteasy.spi.ReaderException: java.lang.IllegalStateException: No jaxb context available for request!

                at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:470) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:385) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:358) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:352) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:406) [kie-services-client-6.1.0.Final.jar:6.1.0.Final]

                at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:120) [kie-services-client-6.1.0.Final.jar:6.1.0.Final]

                at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:230) [drools-core-6.1.0.Final.jar:6.1.0.Final]

                at de.wolle.wolleclient.impl.ProcessBean.startProcess(ProcessBean.java:243) [classes:]

                at de.wolle.wolleclient.web.ProcessServlet.startUeberProcessWithCart(ProcessServlet.java:105) [classes:]

                at de.wolle.wolleclient.web.ProcessServlet.doPost(ProcessServlet.java:61) [classes:]

                ... 28 more

            Caused by: java.lang.IllegalStateException: No jaxb context available for request!

                at org.kie.remote.services.rest.jaxb.DynamicJaxbContext.getRequestContext(DynamicJaxbContext.java:100)

                at org.kie.remote.services.rest.jaxb.DynamicJaxbContext.createUnmarshaller(DynamicJaxbContext.java:111)

                at org.kie.remote.services.rest.jaxb.DynamicJaxbContext$Proxy$_$$_WeldClientProxy.createUnmarshaller(Unknown Source)

                at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom(AbstractJAXBProvider.java:93) [resteasy-jaxb-provider-3.0.8.Final.jar:]

                at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:59) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:51) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor.aroundReadFrom(DigitalVerificationInterceptor.java:32) [resteasy-crypto-3.0.8.Final.jar:]

                at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53) [resteasy-jaxrs-3.0.8.Final.jar:]

                at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:434) [resteasy-jaxrs-3.0.8.Final.jar:]

                ... 37 more

             

            I made a JIRA  ([JBPM-4452] Java REST API startProcess called from a WebApp works only the FIRST time the server is started - JBoss Issu…) for that and attach a webapp to reproduce it

            • 3. Re: JBPM6: Singleton not set for ModuleClassLoader for Module Exception occurs when a process started from the jsp page
              inoshikag

              Hi Maciej,

               

              Thanks for your reply and sorry for the late reply.

              I am using jbpm 6.1.

              My web page is a simple jsp page running on jboss.

              We need to integrate our web pages with jbpm.

              Cannot continue because of this error.

              It is not practical to restart jboss each time.

               

              Thanks in advance,

              Inoshika

              • 4. Re: JBPM6: Singleton not set for ModuleClassLoader for Module Exception occurs when a process started from the jsp page
                sanjay05222

                Hi Maciej,

                 

                I am also getting similar error , my deployment is bit different

                I have a SOAP webservice which has runtime and kie session which calls the kie rest apis to invoke the business process and I get similar error .

                 

                00:43:17,761 INFO  [stdout] (default task-3) Hello World

                00:43:17,763 INFO  [stdout] (default task-3) Hello World  Hello India

                00:43:17,819 ERROR [stderr] (default task-1) org.jboss.resteasy.spi.ReaderException: java.lang.IllegalStateException: No jaxb context available for request!

                00:43:17,836 ERROR [stderr] (default task-1)    at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:470)

                00:43:17,840 ERROR [stderr] (default task-1)    at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:385)

                00:43:17,842 ERROR [stderr] (default task-1)    at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:358)

                00:43:17,853 ERROR [stderr] (default task-1)    at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:352)

                00:43:17,854 ERROR [stderr] (default task-1)    at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:406)

                00:43:17,855 ERROR [stderr] (default task-1)    at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:120)

                00:43:17,857 ERROR [stderr] (default task-1)    at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:230)

                00:43:17,858 ERROR [stderr] (default task-1)    at com.xxxx.ws.soap.StartOasisService.startOasisBpmFlow(StartOasisService.java:105)

                00:43:17,859 ERROR [stderr] (default task-1)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                00:43:17,859 ERROR [stderr] (default task-1)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                00:43:17,860 ERROR [stderr] (default task-1)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                 

                ------ code INSIDE A SOAP WebMethod --------

                 

                RemoteRuntimeEngineFactory restSessionFactory = new RemoteRestRuntimeEngineFactory(bpmProcessDeploymentId, kieInstanceURL, kieUserName,kiePassword);

                RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine();

                KieSession ksession = engine.getKieSession();

                Map<String, Object> params = new HashMap<String, Object>();

                params.put("test", "Hello jbpm  ");

                ProcessInstance processInstance = ksession.startProcess(bpmProcessId, params);  < -- error line

                long procId = processInstance.getId();

                 

                But if i call the same bpm process with simple java client , there are no errors on the server side.

                 

                jbpm6.1.-final +weld-integration 4.5.x  + wildfly 8.2.final

                 

                Thanks

                Sanjay Gautam