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

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

    Ino G Newbie

      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