10 Replies Latest reply on Jun 29, 2009 10:19 AM by Ronald van Kuijk

    WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph

    viral mehta Newbie

      Hi,
      I am using jbpm-jpdl-suite-3.2.3 and below is my processdefinition in which I have configured super state



      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="SuperStateSample">
      
      
       <start-state name="start-state1">
       <transition to="node1"></transition>
       </start-state>
      
      
       <node name="node1">
       <event type="node-enter">
       <action name="action1" class="testFolder.ActionHandler1"></action>
       </event>
       <transition to="node2"></transition>
       </node>
      
       <node name="node2">
       <event type="node-enter">
       <action name="action2" class="testFolder.ActionHandler2"></action>
       </event>
       <transition to="super-state1"></transition>
       </node>
      
       <super-state name="super-state1">
       <node name="node3">
       <event type="node-enter">
       <action name="action3" class="testFolder.ActionHandler3"></action>
       </event>
       <transition to="join1"></transition>
       </node>
       <node name="node4">
       <event type="node-enter">
       <action name="action4" class="testFolder.ActionHandler4"></action>
       </event>
       <transition to="join1"></transition>
       </node>
       <decision name="decision1">
       <handler class="testFolder.DecisionHandler1"></handler>
       <transition to="node3"></transition>
       <transition to="join1" name="to join1"></transition>
       </decision>
       <decision name="decision2">
       <handler class="testFolder.DecisionHandler2"></handler>
       <transition to="node4"></transition>
       <transition to="join1" name="to join1"></transition>
       </decision>
       <fork name="fork1">
       <transition to="decision1"></transition>
       <transition to="decision2" name="to decision2"></transition>
       </fork>
       <join name="join1"></join>
       <transition to="node5"></transition>
       </super-state>
      
       <node name="node5">
       <event type="node-enter">
       <action name="action5" class="testFolder.ActionHandler5"></action>
       </event>
       <transition to="end-state1"></transition>
       </node>
      
      
       <end-state name="end-state1"></end-state>
      
      
      </process-definition>





      but on singnaling processinstance of this processdefition I am getting follwing warning which is because of using superstate in my processdefintion...

      WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.def.SuperState - this operation breaks ==


      And because of this problem nodes which are part of superstate are not called on execution of processinstance....

      Thanks in advance for help

        • 1. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
          viral mehta Newbie

          From some of previous posts I found out that this msg is generated by hibernate bcz of lazy loading... But ppl had ended the topic concluding that this warning can be neglected..

          But in my case I dont agree with that bcz after this warning appears ,execution of my processdefintion is halted apruptly in between.So it might be an error...

          Or may be I have nt used superstate properly in my jpdl...So I'm confused all the way..

          I really need some assistance for the same..

          Regards,
          vnm

          • 2. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
            Viki . Newbie

            Even without using a super state, i am getting this WARNING time & again. As my process execution is fine, i just ignored it.

            But why is it coming ?
            Experienced people, please address us..

            • 3. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
              Ronald van Kuijk Master

              The experienced people already answered this question. VNM searched the forum and found a reason why. He is right about the fact that it is a warning. It has no influence on the working of the engine (It is a warning, not an error).

              • 4. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
                viral mehta Newbie

                Hi Ronald,
                Thanks for your reply..But are you sure that this warning can be neglected!!! Because as mentioned in my previous post, due to this warning my whole processdefintion is not executed and it is halted in between...
                Is there any other reason for the failure of execution of process??If you find any problem in design of my processdefinition then please let me know...Becasue I need to use super state in my processdefintion...

                Thanks and Regards,
                vnm

                • 5. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
                  Ronald van Kuijk Master

                   

                  Thanks for your reply..But are you sure that this warning can be neglected!!!


                  Yes

                  Because as mentioned in my previous post, due to this warning my whole processdefintion is not executed and it is halted in between...


                  That is your assumption and I, respectfully, think that is wrong. For the simple reason that I get those warnings to depending on how I use the api.

                  • 6. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
                    Ronald van Kuijk Master

                    Oops, something missing in the post

                    So I think there is something wrong in how you signal the process that causes this. Write a unit test with *everything* in one file, like in http://fisheye.jboss.com/browse/~raw,r=4398/JbpmSvn/jbpm3/trunk/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java that demonstrates the problem so we can try to reproduce or see what you do wrong.

                    • 7. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
                      viral mehta Newbie

                      Hi Ronald,
                      Sending you a single java file that contains all things used in my process..



                      package org.jbpm.job.executor;
                      
                      import java.util.ArrayList;
                      import java.util.Collections;
                      import java.util.HashSet;
                      import java.util.List;
                      import java.util.Set;
                      import java.util.TreeSet;
                      
                      import org.jbpm.db.AbstractDbTestCase;
                      import org.jbpm.graph.def.Action;
                      import org.jbpm.graph.def.ActionHandler;
                      import org.jbpm.graph.def.ProcessDefinition;
                      import org.jbpm.graph.exe.ExecutionContext;
                      import org.jbpm.graph.exe.ProcessInstance;
                      
                      public class JobExecutorDbTest extends AbstractDbTestCase {
                      
                       static final int nbrOfConcurrentProcessExecutions = 20;
                       static final int timeout = 60000;
                      
                       static Set<String> collectedResults = Collections.synchronizedSet(new TreeSet<String>());
                       static List<Long> allocatedProcessIds = Collections.synchronizedList(new ArrayList<Long>());
                      
                       @Override
                       protected void setUp() throws Exception {
                       super.setUp();
                       getJbpmConfiguration().getJobExecutor().setNbrOfThreads(4);
                       }
                      
                       @Override
                       protected void tearDown() throws Exception {
                       getJbpmConfiguration().getJobExecutor().setNbrOfThreads(1);
                       super.tearDown();
                       }
                      
                       public void testJobExecutor() {
                       deployProcessDefinition();
                       try {
                       ServiceVO serviceVO = new ServiceVO();
                       serviceVO.setProcessDefinitionName("SuperStateSample");
                       initiateProcess(serviceVO);
                       processJobs(timeout);
                       // assertEquals(getExpectedResults(), collectedResults);
                       }
                       finally {
                      
                       }
                       }
                      
                       void deployProcessDefinition() {
                       ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("
                      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="SuperStateSample">
                      
                      
                       <start-state name="start-state1">
                       <transition to="node1"></transition>
                       </start-state>
                      
                      
                       <node name="node1">
                       <event type="node-enter">
                       <action name="action1" class="ActionHandler1.class.getName()"></action>
                       </event>
                       <transition to="super-state1"></transition>
                       </node>
                      
                       <super-state name="super-state1">
                       <node name="node3">
                       <event type="node-enter">
                       <action name="action3" class="ActionHandler1.class.getName()"></action>
                       </event>
                       <transition to="join1"></transition>
                       </node>
                       <node name="node4">
                       <event type="node-enter">
                       <action name="action4" class="ActionHandler1.class.getName()"></action>
                       </event>
                       <transition to="join1"></transition>
                       </node>
                       <decision name="decision1">
                       <handler class="DecisionHandler1.class.getName()"></handler>
                       <transition to="node3" name="node3"></transition>
                       <transition to="join1" name="to join1"></transition>
                       </decision>
                       <decision name="decision2">
                       <handler class="DecisionHandler2.class.getName()"></handler>
                       <transition to="node4" name="node4"></transition>
                       <transition to="join1" name="to join1"></transition>
                       </decision>
                       <join name="join1">
                       <transition to="node5"></transition>
                       </join>
                       <fork name="fork1">
                       <transition to="decision1"></transition>
                       <transition to="decision2" name="to decision2"></transition>
                       </fork>
                       <node name="node5">
                       <event type="node-enter">
                       <action class="ActionHandler1.class.getName()"></action>
                       </event>
                       </node>
                       <node name="node2">
                       <event type="node-enter">
                       <action name="action2" class="ActionHandler1.class.getName()"></action>
                       </event>
                       <transition to="fork1"></transition>
                       </node>
                       <transition to="end-state1"></transition>
                       </super-state>
                      
                      
                       <end-state name="end-state1"></end-state>
                      
                      
                      </process-definition>");
                       jbpmContext.deployProcessDefinition(processDefinition);
                      
                       }
                      
                       void initiateProcess(ServiceVO serviceVO) {
                       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
                       String processName = serviceVO.getProcessDefinitionName();
                       logger.info("processName==="+processName);
                       ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate(processName);
                       logger.info("--------------after getting processInstance");
                       long processInstanceId = processInstance.getId();
                      
                       Token token = processInstance.getRootToken();
                       logger.info("--------------after getting token");
                       ContextInstance contextInstance = processInstance.getContextInstance();
                       logger.info("--------------after getting contextInstance");
                       contextInstance.setVariable("serviceVO", serviceVO);
                      
                       /*if(processVariables!=null){
                       Set keySet = processVariables.keySet();
                       Iterator keyIterator = keySet.iterator();
                       String key = null;
                       Object obj = null;
                       while(keyIterator.hasNext()){
                      
                       key = (String)keyIterator.next();
                       obj = processVariables.get(key);
                      
                       contextInstance.setVariable(key,obj);
                      
                       }
                       }*/
                       processInstance.signal();
                       logger.info("---------after processInstance singal");
                       logger.info("--------------after signal");
                      
                       logger.info("--------------after saving token");
                       jbpmContext.save(processInstance);
                       logger.info("--------------after saving processInstance");
                       logger.info("root token======="+token.getId());
                      
                      
                      
                       jbpmContext.close();
                       }
                       }
                      
                       //start
                       class ServiceVO implements Serializable{
                      
                      
                      
                       private String processDefinitionName;
                      
                      
                       public String getProcessDefinitionName() {
                       return processDefinitionName;
                       }
                      
                       public void setProcessDefinitionName(String processDefinitionName) {
                       this.processDefinitionName = processDefinitionName;
                       }
                      
                      
                      
                      }
                      //end
                      
                      
                      //start
                       class ActionHandler1 implements ActionHandler{
                      
                       public void execute(ExecutionContext executionContext) throws Exception {
                       System.out.println("===========>>>>in action handler 1 >>>>>>>>>");
                      
                       }
                      //end
                      
                      //start
                       class DecisionHandler1 implements DecisionHandler {
                       public String decide(ExecutionContext arg0) throws Exception {
                       // TODO Auto-generated method stub
                       System.out.println("--in handler1-");
                       return "node3";
                       }
                      //end
                      
                      //start
                       class DecisionHandler2 implements DecisionHandler {
                       public String decide(ExecutionContext arg0) throws Exception {
                       // TODO Auto-generated method stub
                       System.out.println("--in handler2-");
                       return "node4";
                       }
                      
                      }
                      //end



                      Thanks
                      vnm

                      • 8. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
                        Ronald van Kuijk Master

                        I would like to give it a try, but copy/pasting this into eclipse gives me many errors.... Are you sure this one runs in your environment?
                        - Processdefinition is not escaped
                        - class attribute in actions is wrong
                        - lots of imports missing
                        - I do not see any assertions of what you expect
                        - ...

                        Please correct it before I can give it another try

                        • 9. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
                          viral mehta Newbie

                          Hi Ronald,
                          Sorry to send you improper code..As I was in bit hurry to send you I just skipped to resolve compilation issues,below is my modified code..Before you run it I request you to put my processdefintion.xml in src for testing,herein with I am also sending you my xml..
                          And another thing I want to mention is in my code import org.jbpm.db.AbstractDbTestCase; this import couldnt be resolved as this class in not in my jbpm-jpdl.jar...I am using jbpm version 3.2.3..And the same class is used in java file for which you sent me the link



                          code of class

                          package org.jbpm.job.executor;
                          
                          import java.io.Serializable;
                          import java.util.ArrayList;
                          import java.util.Collections;
                          import java.util.HashSet;
                          import java.util.List;
                          import java.util.Set;
                          import java.util.TreeSet;
                          
                          import org.apache.commons.logging.Log;
                          import org.apache.commons.logging.LogFactory;
                          import org.jbpm.JbpmConfiguration;
                          import org.jbpm.JbpmContext;
                          import org.jbpm.context.exe.ContextInstance;
                          import org.jbpm.db.AbstractDbTestCase;
                          import org.jbpm.graph.def.Action;
                          import org.jbpm.graph.def.ActionHandler;
                          import org.jbpm.graph.def.ProcessDefinition;
                          import org.jbpm.graph.exe.ExecutionContext;
                          import org.jbpm.graph.exe.ProcessInstance;
                          import org.jbpm.graph.exe.Token;
                          import org.jbpm.graph.node.DecisionHandler;
                          
                          public class JobExecutorDbTest extends AbstractDbTestCase {
                           final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml");
                           JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
                           static final int nbrOfConcurrentProcessExecutions = 20;
                           static final int timeout = 60000;
                           final Log logger = LogFactory.getLog(getClass());
                           static Set<String> collectedResults = Collections.synchronizedSet(new TreeSet<String>());
                           static List<Long> allocatedProcessIds = Collections.synchronizedList(new ArrayList<Long>());
                          
                           @Override
                           protected void setUp() throws Exception {
                           super.setUp();
                           getJbpmConfiguration().getJobExecutor().setNbrOfThreads(4);
                           }
                          
                           @Override
                           protected void tearDown() throws Exception {
                           getJbpmConfiguration().getJobExecutor().setNbrOfThreads(1);
                           super.tearDown();
                           }
                          
                           public void testJobExecutor() {
                           deployProcessDefinition();
                           try {
                           ServiceVO serviceVO = new ServiceVO();
                           serviceVO.setProcessDefinitionName("SuperStateSample");
                           initiateProcess(serviceVO);
                           processJobs(timeout);
                           // assertEquals(getExpectedResults(), collectedResults);
                           }
                           finally {
                          
                           }
                           }
                          
                           void deployProcessDefinition() {
                           ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("processdefinition.xml");
                           jbpmContext.deployProcessDefinition(processDefinition);
                          
                           }
                          
                           void initiateProcess(ServiceVO serviceVO) {
                           JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
                           String processName = serviceVO.getProcessDefinitionName();
                           logger.info("processName==="+processName);
                           ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate(processName);
                           logger.info("--------------after getting processInstance");
                           long processInstanceId = processInstance.getId();
                          
                           Token token = processInstance.getRootToken();
                           logger.info("--------------after getting token");
                           ContextInstance contextInstance = processInstance.getContextInstance();
                           logger.info("--------------after getting contextInstance");
                           contextInstance.setVariable("serviceVO", serviceVO);
                          
                           /*if(processVariables!=null){
                           Set keySet = processVariables.keySet();
                           Iterator keyIterator = keySet.iterator();
                           String key = null;
                           Object obj = null;
                           while(keyIterator.hasNext()){
                          
                           key = (String)keyIterator.next();
                           obj = processVariables.get(key);
                          
                           contextInstance.setVariable(key,obj);
                          
                           }
                           }*/
                           processInstance.signal();
                           logger.info("---------after processInstance singal");
                           logger.info("--------------after signal");
                          
                           logger.info("--------------after saving token");
                           jbpmContext.save(processInstance);
                           logger.info("--------------after saving processInstance");
                           logger.info("root token======="+token.getId());
                          
                          
                          
                           jbpmContext.close();
                           }
                           }
                          
                           //start
                           class ServiceVO implements Serializable{
                          
                          
                          
                           private String processDefinitionName;
                          
                          
                           public String getProcessDefinitionName() {
                           return processDefinitionName;
                           }
                          
                           public void setProcessDefinitionName(String processDefinitionName) {
                           this.processDefinitionName = processDefinitionName;
                           }
                          
                          
                          
                          }
                          //end
                          
                          
                          //start
                           class ActionHandler1 implements ActionHandler{
                          
                           public void execute(ExecutionContext executionContext) throws Exception {
                           System.out.println("===========>>>>in action handler 1 >>>>>>>>>");
                          
                           }
                           }
                          //end
                          
                          //start
                           class DecisionHandler1 implements DecisionHandler {
                           public String decide(ExecutionContext arg0) throws Exception {
                           // TODO Auto-generated method stub
                           System.out.println("--in handler1-");
                           return "node3";
                           }
                           }
                          //end
                          
                          //start
                           class DecisionHandler2 implements DecisionHandler {
                           public String decide(ExecutionContext arg0) throws Exception {
                           // TODO Auto-generated method stub
                           System.out.println("--in handler2-");
                           return "node4";
                           }
                           }
                          
                          //end




                          code for processdefinition.xml


                          <?xml version="1.0" encoding="UTF-8"?>

                          <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="SuperStateSample">
                          
                          
                           <start-state name="start-state1">
                           <transition to="node1"></transition>
                           </start-state>
                          
                          
                           <node name="node1">
                           <event type="node-enter">
                           <action name="action1" class="testFolder.ActionHandler1"></action>
                           </event>
                           <transition to="super-state1"></transition>
                           </node>
                          
                           <super-state name="super-state1">
                           <node name="node3">
                           <event type="node-enter">
                           <action name="action3" class="testFolder.ActionHandler3"></action>
                           </event>
                           <transition to="join1"></transition>
                           </node>
                           <node name="node4">
                           <event type="node-enter">
                           <action name="action4" class="testFolder.ActionHandler4"></action>
                           </event>
                           <transition to="join1"></transition>
                           </node>
                           <decision name="decision1">
                           <handler class="testFolder.DecisionHandler1"></handler>
                           <transition to="node3" name="node3"></transition>
                           <transition to="join1" name="to join1"></transition>
                           </decision>
                           <decision name="decision2">
                           <handler class="testFolder.DecisionHandler2"></handler>
                           <transition to="node4" name="node4"></transition>
                           <transition to="join1" name="to join1"></transition>
                           </decision>
                           <join name="join1">
                           <transition to="node5"></transition>
                           </join>
                           <fork name="fork1">
                           <transition to="decision1"></transition>
                           <transition to="decision2" name="to decision2"></transition>
                           </fork>
                           <node name="node5">
                           <event type="node-enter">
                           <action class="testFolder.ActionHandler5"></action>
                           </event>
                           </node>
                           <node name="node2">
                           <event type="node-enter">
                           <action name="action2" class="testFolder.ActionHandler2"></action>
                           </event>
                           <transition to="fork1"></transition>
                           </node>
                           <transition to="end-state1"></transition>
                           </super-state>
                          
                          
                           <end-state name="end-state1"></end-state>
                          
                          
                          </process-definition>




                          jbpm.cfg.xml


                          <jbpm-configuration>
                          
                           <!--
                           The default configurations can be found in org/jbpm/default.jbpm.cfg.xml
                           Those configurations can be overwritten by putting this file called
                           jbpm.cfg.xml on the root of the classpath and put in the customized values.
                           -->
                           <jbpm-context>
                           <service name='persistence' factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />
                           <service name='message' factory='org.jbpm.msg.db.DbMessageServiceFactory' />
                           <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
                           <!--<service name='scheduler' factory='org.jbpm.scheduler.db.DbSchedulerServiceFactory' />-->
                           <service name='logging' factory='org.jbpm.logging.db.DbLoggingServiceFactory' />
                           <service name='authentication' factory='org.jbpm.security.authentication.DefaultAuthenticationServiceFactory' />
                           </jbpm-context>
                          
                           <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar-->
                           <string name='resource.hibernate.cfg.xml' value='hibernate.cfg.xml' />
                           <!-- <string name='resource.hibernate.properties' value='hibernate.properties' /> -->
                           <string name='resource.business.calendar' value='org/jbpm/calendar/jbpm.business.calendar.properties' />
                           <string name='resource.default.modules' value='org/jbpm/graph/def/jbpm.default.modules.properties' />
                           <string name='resource.converter' value='org/jbpm/db/hibernate/jbpm.converter.properties' />
                           <string name='resource.action.types' value='org/jbpm/graph/action/action.types.xml' />
                           <string name='resource.node.types' value='org/jbpm/graph/node/node.types.xml' />
                           <string name='resource.parsers' value='org/jbpm/jpdl/par/jbpm.parsers.xml' />
                           <string name='resource.varmapping' value='org/jbpm/context/exe/jbpm.varmapping.xml' />
                          
                           <int name='jbpm.byte.block.size' value="1024" singleton="true" />
                           <bean name='jbpm.task.instance.factory' class='org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl' singleton='true' />
                           <bean name='jbpm.variable.resolver' class='org.jbpm.jpdl.el.impl.JbpmVariableResolver' singleton='true' />
                          
                          </jbpm-configuration>



                          Thanks and Regards
                          vnm

                          • 10. Re: WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.g
                            Ronald van Kuijk Master

                            PLEEEEEEEEEAAAAAAAAAAAAASSSSSSSSSSSSEEEEEEEEEE, come on....

                            The testcase I posted is an example. Might be that the AbstractDBTestCase is not in 3.2.2. Could be, not sure, but removing it would show only a few things that need removal and you *could* be up and running.... but you can't for the very reason you again posted things that do *not* work at all.

                            You might have limited time, but so so I and by spending to little to provide me with a good testcase, you are unfortunately now on your own. I'm sorry, but I'm not going to put any more effort (over 1 hour now) in solving this for you. Maybe others can help.