1 Reply Latest reply on Aug 26, 2014 10:41 AM by inoshikag

    Singleton not set for ModuleClassLoader for Module Exception occurs when a process started from the jsp page using REST calls (jBPM6)

    inoshikag

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

      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();

       

      Message was edited by: Inoshika Gamage

        • 1. Re: Exception occurs when a process started from the jsp page using REST calls (jBPM6)
          inoshikag

          I couldn't figure out this yet. 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 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.

          Thanks in advance.