2 Replies Latest reply on Jan 18, 2012 9:46 AM by rigazilla

    jBPM 5.2 issue Jboss7.1Beta

    pushpak1981

      Hi

      We have setup jBPM5.2 on JBoss7.1Beta when we try to execute sample business process we get the following error.

       

      Caused by: java.lang.IllegalAccessException: Class org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer can not access a member of class org.jboss.stdio.StdioContext$DelegatingPrintStream with modifiers "public"

          at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)

          at java.lang.reflect.Method.invoke(Method.java:588)

          at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:1093)

          at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:982)

          at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:375)

          ... 114 more

       

      Below is the sample bpmn we are trying to deploy:

       

      <?xml version="1.0" encoding="UTF-8"?> 
      <definitions id="Definition"
                   targetNamespace="http://www.jboss.org/drools"
                   typeLanguage="http://www.java.com/javaTypes"
                   expressionLanguage="http://www.mvel.org/2.0"
                   xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
                   xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
                   xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
                   xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
                   xmlns:tns="http://www.jboss.org/drools">
      
        <process processType="Private" isExecutable="true" id="com.sample.bpmn.hello" name="Hello World" >
      
          <!-- nodes -->
          <scriptTask id="_2" name="Hello" >
            <script>System.out.println("Hello World");</script>
          </scriptTask>
          <startEvent id="_1" name="StartProcess" />
          <endEvent id="_3" name="EndProcess" >
              <terminateEventDefinition/>
          </endEvent>
      
          <!-- connections -->
          <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />
          <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />
      
        </process>
      
        <bpmndi:BPMNDiagram>
          <bpmndi:BPMNPlane bpmnElement="com.sample.bpmn.hello" >
            <bpmndi:BPMNShape bpmnElement="_2" >
              <dc:Bounds x="96" y="16" width="80" height="48" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="_1" >
              <dc:Bounds x="16" y="16" width="48" height="48" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="_3" >
              <dc:Bounds x="206" y="17" width="48" height="48" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNEdge bpmnElement="_1-_2" >
              <di:waypoint x="40" y="40" />
              <di:waypoint x="136" y="40" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="_2-_3" >
              <di:waypoint x="136" y="40" />
              <di:waypoint x="230" y="41" />
            </bpmndi:BPMNEdge>
          </bpmndi:BPMNPlane>
        </bpmndi:BPMNDiagram>
      
      </definitions>
      

       

      Are we missing any configuration for JBoss7 ?

        • 1. Re: jBPM 5.2 issue Jboss7.1Beta
          rigazilla

          Hi

          we have the same problem, with this code snip.

           

          try {
            InitialContext ctx= new InitialContext();
            kbi=(KnowledgeBaseInterface)ctx.lookup("java:global/examplejbpm5/KnowledgeBaseEJB!it.comp.example.jbpm5.KnowledgeBaseInterface");
          } catch (NamingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }

           

          KnowledgeBase kbase= kbi.getKB();

           

          EntityManagerFactory emf = Persistence.createEntityManagerFactory("it.comp.example.jbpm5.jpa");
          Environment env = KnowledgeBaseFactory.newEnvironment();
          env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
          StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
          ProcessInstance pi = ksession.getProcessInstance(1);
          if (pi == null) {
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("employee", "krisv");
            params.put("reason", "Yearly performance evaluation");
            pi = ksession.startProcess("sayhello", params);   // <--- exception
          • 2. Re: jBPM 5.2 issue Jboss7.1Beta
            rigazilla

            Hi push,

             

            I solved.

             

            Change the system.out to something like this:

             

            org.jboss.logging.Logger.getLogger(&quot;wwww&quot;).error(&quot;Ciao&quot;);

             

            System.out involves a call to a private nested class method  which can't be run inside a script... (I suppose)

             

            Vit