1 Reply Latest reply on Oct 7, 2010 1:29 AM by aguizar

    JBPM 4.4 Tomcat JNDI ProcessEngine Exception.

    antonio.pagano

      Hi,

       

      I wrote a Factory for my using JBPM 4.4 ProcessEngine as a JNDI resource in Tomcat like this,

      ...

      public class ProcessEngineFactory implements ObjectFactory {

       

          public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {

              return Configuration.getProcessEngine();

          }

      }

       

      Im start my Tomcat and everithing goes great, but when another application needs to find anyone of the services

      inside the ProcessEngineImpl (lets say RepositoryService) , i get this exception :

      ...

       

      Caused by: org.jbpm.pvm.internal.wire.WireException: couldn't set commandService to org.jbpm.pvm.internal.svc.SkipInterceptor@2e8e96cd

      at org.jbpm.pvm.internal.wire.operation.FieldOperation.apply(FieldOperation.java:48)

      at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.initialize(ObjectDescriptor.java:230)

      ... 25 more

      Caused by: org.jbpm.api.JbpmException: couldn't set 'commandService' to 'org.jbpm.pvm.internal.svc.SkipInterceptor@2e8e96cd'

      at org.jbpm.pvm.internal.util.ReflectUtil.set(ReflectUtil.java:170)

      at org.jbpm.pvm.internal.wire.operation.FieldOperation.apply(FieldOperation.java:46)

      ... 26 more

      Caused by: java.lang.IllegalArgumentException: Can not set org.jbpm.pvm.internal.cmd.CommandService field org.jbpm.pvm.internal.svc.AbstractServiceImpl.commandService to org.jbpm.pvm.internal.svc.SkipInterceptor

      at org.jbpm.pvm.internal.util.ReflectUtil.set(ReflectUtil.java:168)

      ... 27 more

      ...

       

      Please any help you can give me arround this topic is great received.

       

      Thanks in advance,

       

      Antonio

      Caused by: org.jbpm.pvm.internal.wire.WireException: couldn't set commandService to org.jbpm.pvm.internal.svc.SkipInterceptor@2e8e96cd
      at org.jbpm.pvm.internal.wire.operation.FieldOperation.apply(FieldOperation.java:48)
      at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.initialize(ObjectDescriptor.java:230)
      ... 25 more
      Caused by: org.jbpm.api.JbpmException: couldn't set 'commandService' to 'org.jbpm.pvm.internal.svc.SkipInterceptor@2e8e96cd'
      at org.jbpm.pvm.internal.util.ReflectUtil.set(ReflectUtil.java:170)
      at org.jbpm.pvm.internal.wire.operation.FieldOperation.apply(FieldOperation.java:46)
      ... 26 more
      Caused by: java.lang.IllegalArgumentException: Can not set org.jbpm.pvm.internal.cmd.CommandService field org.jbpm.pvm.internal.svc.AbstractServiceImpl.commandService to org.jbpm.pvm.internal.svc.SkipInterceptor
      at org.jbpm.pvm.internal.util.ReflectUtil.set(ReflectUtil.java:168)
      ... 27 Caused by: org.jbpm.pvm.internal.wire.WireException: couldn't set commandService to org.jbpm.pvm.internal.svc.SkipInterceptor@2e8e96cd
      at org.jbpm.pvm.internal.wire.operation.FieldOperation.apply(FieldOperation.java:48)
      at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.initialize(ObjectDescriptor.java:230)
      ... 25 more
      Caused by: org.jbpm.api.JbpmException: couldn't set 'commandService' to 'org.jbpm.pvm.internal.svc.SkipInterceptor@2e8e96cd'
      at org.jbpm.pvm.internal.util.ReflectUtil.set(ReflectUtil.java:170)
      at org.jbpm.pvm.internal.wire.operation.FieldOperation.apply(FieldOperation.java:46)
      ... 26 more
      Caused by: java.lang.IllegalArgumentException: Can not set org.jbpm.pvm.internal.cmd.CommandService field org.jbpm.pvm.internal.svc.AbstractServiceImpl.commandService to org.jbpm.pvm.internal.svc.SkipInterceptor
      at org.jbpm.pvm.internal.util.ReflectUtil.set(ReflectUtil.java:168)
      ... 27 more

        • 1. Re: JBPM 4.4 Tomcat JNDI ProcessEngine Exception.
          aguizar

          Custom Tomcat resource factories have been discussed in the past, you might want to read the comments on the subject. In sum, it would make a fine addition. If it has not been done already is due to lack of time. However, employing the shared ProcessEngine instance returned by Configuration.getProcessEngine() might be a bad idea due to class loading concerns. In fact, the exception thrown while setting a field via reflection is the telltale sign of class loader conflicts.

           

          Please create a feature request for a process engine factory in JIRA. I will help you get the code right and update the shipped Tomcat configuration so that the custom resource factory is deployed by default in jBPM 4.5 and future versions.