3 Replies Latest reply on Jul 28, 2014 9:50 AM by danesh

    Null Pointer Exception on xml parsing

    d.bramati

      Hi,

       

      I'm facing a strange problem with jbpm 6.0.1 Final. I have wrote a jbpm process using BPM2 modeler plugin for eclipse. If i try to launch my process throught a unit test using the utility methods defined in JbpmJUnitBaseTestCase class i found process compiles and runs correctly. This is my test method to simply verify process execution

       

      KieHelper kieHelper = new KieHelper();

      HashMap<String, ResourceType> resourcesMap = new HashMap<String, ResourceType>();

      resourcesMap.put("it\\telecomitalia\\fms\\fraud\\generator\\bpm\\aggiornaAnagrafica.bpmn", ResourceType.BPMN2);

      createRuntimeManager(resourcesMap);

      RuntimeEngine runtimeEngine = getRuntimeEngine();

      KieSession ksession = runtimeEngine.getKieSession();

      ProcessInstance processInstance = ksession.startProcess("it.telecomitalia.fms.fraud.generator.bpm.aggiornaAnagrafica");

      assertProcessInstanceCompleted(processInstance.getId(), ksession);

       

      If i try to deploy my application an load the same process on startup adding it throught the KieHelper APIs this way

       

      KieHelper kieHelper = new KieHelper();

      kieHelper.addResource(ResourceFactory.newClassPathResource(<resource_path>));

      KieBase kieBase = kieHelper.build();

       

      it seems i have problem on process compilation. Inspecting the application server log i found an NPE exception without no evidence of which problem has occurred

       

      java.lang.RuntimeException: java.lang.RuntimeException: [Message [id=1, level=ERROR, path=it/telecomitalia/fms/fraud/generator/bpm/aggiornaAnagrafica.bpmn, line=-1, column=0

         text=unable to parse xml : Exception class java.lang.NullPointerException : null]

       

      Someone has faced the same problem and could help me? I have attached the bpmn file.

      Thanks!

        • 1. Re: Null Pointer Exception on xml parsing
          swiderski.maciej

          could you attach complete stack trace as that might tell us more.

           

          HTH

          • 2. Re: Null Pointer Exception on xml parsing
            d.bramati

            Sorry, i lost application server logs after log rotation but i finally found the problem and would like to share the solution. Error message and exception were a bit misleading, there was a problem with variables declaration. I have used a local variable in a script task with the same name as a global variable declared in another process. Clearly when i was unit testing process problem was hidden because i was loading only one process in knowledge base. By the way after checking and renaming local variables problem as been solved.

            • 3. Re: Null Pointer Exception on xml parsing
              danesh

              Hi

              I have the same problem.

              But problem is not duplicate variable duplicate names nor variable types.

              I try to create different processes but I have still the same problem.