7 Replies Latest reply on Sep 21, 2015 3:06 PM by SANJAY GAUTAM

    Deployment Units containing supporting java classes

    James Jones Newbie

      Are there any considerations or restrictions on supplementary java classes residing in the same maven artifact containing BPM processes to be deployed?

      More details.

       

      My team is upgrading our jbpm application from jbpm-6.0.1.Final to jbpm-6.1.0.CR1
      We are getting deployment errors for BPM processes that were previously deploying successfully with jbpm-6.0.1.Final
      Here is error message

          Deployment of unit com.unisys.spc.bpm:StatusPoller:4.0.30773 failed: java.lang.IllegalStateException: Unable to instantiate JAXBContext for deployment 'com.unisys.spc.bpm:StatusPoller:4.0.30773'.

      We get same results when deploying using REST API or manually using KIE Workbench.
      We think this error is caused by non-serializeable java classes located in the maven artifact we are deploying.
      In other words, the artifact StatusPoller-4.0.30773.jar contains non-serializeable java classes in addition to a BPM process.
      If we move the non-serializeable java classes to a separate jar file, then StatusPoller artifact and its BPM process seem to successfully deploy and execute.
      Is there syntax that we can provide in kmodule.xml or deployment-descriptor.xml that resolves this issue without having to refactor our BPM java projects?
      Or is it best to refactor our maven artifacts containing BPM processes to be deployed and move any "supporting" java classes to a separate jar?

        • 1. Re: Deployment Units containing supporting java classes
          Maciej Swiderski Master

          it should be perfectly ok to include any class in kjar (next to your processes) regardless if they are serializable or not. Classes that are used as process variables must be serializable. Could you please attach complete stacktrace from server.log to be able to identify the root cause and maybe suggest some way out?

           

          HTH

          • 2. Re: Deployment Units containing supporting java classes
            James Jones Newbie

            Here is excerpt from server.log

            This is different error than I reported earlier, but hopefully you can tell us something to look at.

            Again, this same code is deploying successfully with 6.0.1.Final

             

            12:17:28,651 INFO  [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (pool-18-thread-20) KieModule was added:MemoryKieModule[ ReleaseId=com.unisys.spc.bpm:StatusPoller:4.0.31002]

            12:17:28,900 INFO  [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (pool-18-thread-7) KieModule was added:MemoryKieModule[ ReleaseId=com.unisys.spc.bpm:StatusPoller:4.0.31002]

            12:17:57,494 WARN  [org.kie.remote.services.rest.exception.DescriptiveExceptionHandler] (http-0.0.0.0-0.0.0.0-8080-1) Exception thrown when processing request [/deployment/com.unisys.spc.bpm:StatusPoller:4.0.31002/deploy?strategy=PER_REQUEST]; responding with status -1: java.io.EOFException: No content to map to Object due to end of input

            at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2775) [jackson-mapper-asl-1.9.9.jar:1.9.9]

            at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2691) [jackson-mapper-asl-1.9.9.jar:1.9.9]

            at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1315) [jackson-mapper-asl-1.9.9.jar:1.9.9]

            at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419) [jackson-jaxrs-1.9.9.jar:1.9.9]

            at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:105) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.read(GZIPDecodingInterceptor.java:61) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:108) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:169) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:124) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:147) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]

            at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.2.1.Final.jar:3.2.1.Final]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.2.1.Final.jar:3.2.1.Final]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.kie.remote.services.rest.jaxb.DynamicJaxbContextFilter.doFilter(DynamicJaxbContextFilter.java:29) [kie-services-remote-6.1.0.CR1.jar:6.1.0.CR1]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70) [jbpm-designer-backend-6.1.0.CR1.jar:6.1.0.CR1]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:283) [uberfire-security-server-0.4.0.CR1.jar:0.4.0.CR1]

            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397) [jbossweb-7.0.13.Final.jar:]

            at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

            at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:397) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

            at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]

            • 3. Re: Deployment Units containing supporting java classes
              Maciej Swiderski Master

              James,

               

              could you please try adding empty deployment descriptor into the POST body of the request and ensure that the content type is xml:

              <deployment-descriptor/>

               

              Content-type: application/xml

               

              Depending on the app servers it might require deployment descriptor to be given even if it's empty.

               

              HTH

              • 4. Re: Deployment Units containing supporting java classes
                James Jones Newbie

                We can successfully deploy and execute after deleting the following code from our project.

                Fortunately, this is obsolete test code, but perhaps you can enlighten us on what has changed in 6.1.0? Is 6.1.0 more rigorous about flagging static main() entry points?

                 

                public class ProcessMain {

                private static RuntimeManager manager;
                private static UserGroupCallback userGroupCallback;
                public static void main(String[] args){
                  RuntimeEnvironment environment = RuntimeEnvironmentBuilder.getDefault().userGroupCallback(userGroupCallback)
                    .addAsset(ResourceFactory.newClassPathResource("StatusPoller.bpmn"), ResourceType.BPMN2)
                    .registerableItemsFactory(new DefaultRegisterableItemsFactory()
                    {

                     @Override
                     public Map<String, WorkItemHandler> getWorkItemHandlers(RuntimeEngine runtime)
                     {

                      Map<String, WorkItemHandler> handlers = super.getWorkItemHandlers(runtime);
                      return handlers;
                     }
                    }).get();

                  manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);
                  important to register RuntimeManager in the registry as callbacks
                  rely on it to move process forward
                  RuntimeManagerRegistry.get().addRuntimeManager(manager.getIdentifier(), manager); 

                  RuntimeEngine runtime = manager.getRuntimeEngine(EmptyContext.get());
                  KieSession ksession = runtime.getKieSession();
                 
                  ProcessInstance processInstance = ksession.startProcess("com.unisys.spc.bpm.StatusPoller");
                  try { Thread.sleep(10000); }
                       catch (InterruptedException e)
                       {
                        e.printStackTrace();
                       }       
                    }
                }

                • 5. Re: Deployment Units containing supporting java classes
                  James Jones Newbie

                  I finally noticed that ProcessMain.java was using obsolete versions of jBPM Runtime APIs. ProcessMain had been generated long ago by a previous version of jBPM project wizard for Eclipse. I guess jBPM 6.1 is doing more rigorous analysis of Java classes during deployment.phase.

                  • 6. Re: Deployment Units containing supporting java classes
                    James Jones Newbie

                    We are still having trouble deploying some of our processes in jbpm-6.1.0.CR1

                    Is there any way to increase the logging verbosity relevant to deployment processing that might give us more clues?

                    Server.log doesn't give any clues other than

                    16:27:48,748 ERROR [org.kie.remote.services.rest.jaxb.DynamicJaxbContext] (http-0.0.0.0-0.0.0.0-8080-2) JAXB context instance could not be found when undeploying deployment 'com.unisys.spc.bpm:CommissionVm:4.0.31430'!

                     

                     


                    • 7. Re: Deployment Units containing supporting java classes
                      SANJAY GAUTAM Expert

                      @james

                       

                      were you able to resolve this issue and how ?

                       

                       

                      Thanks

                      Sanjay Gautam