4 Replies Latest reply on Apr 4, 2006 5:23 PM by forjbpm

    error for jbpm webservice method

    forjbpm

      Hi all,
      I am trying to develop a webservice for jbpm. In this case I am using stateless session EJB and I have exposed it as a webservice .

      EJB has business method -> processDefinitionNames()
      Which is a very basic method (not at all fancy! Just returns the String of all processDefinitions())

      
      public String processDefinitionNames() {
       // TODO Auto-generated method stub
       String processDefinitionNames = "ECSPUT\n";
       JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
       java.util.List processDefinitions = jbpmContext.getGraphSession().findAllProcessDefinitions();
      
       if (processDefinitions.isEmpty() == false) {
       java.util.ListIterator listProcessDefinitions = processDefinitions
       .listIterator();
      
       while (listProcessDefinitions.hasNext()) {
      
       ProcessDefinition processDefinition = (ProcessDefinition) listProcessDefinitions
       .next();
       processDefinitionNames = processDefinitionNames
       + processDefinition.getName()
       + "\n";
       }
       }
       return processDefinitionNames;
       }
      

      However for jbpmContext.getGraphSession().findAllProcessDefinitions();
      I get following error when I try to use processDefinitionNames() method in my SOAP client

      14:37:58,187 ERROR [ServerEngine] Server error: AxisFault
       faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
       faultSubcode:
       faultString: RuntimeException; nested exception is:
       java.lang.NullPointerException
       faultActor:
       faultNode:
       faultDetail:
       {http://xml.apache.org/axis/}stackTrace: java.rmi.ServerException: RuntimeException; nested exception is:
       java.lang.NullPointerException
       at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:400)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:210)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:643)
       at org.jboss.ejb.Container.invoke(Container.java:917)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.webservice.server.InvokerProviderEJB.invokeServiceEndpoint(InvokerProviderEJB.java:144)
       at org.jboss.webservice.server.InvokerProvider.invokeMethod(InvokerProvider.java:327)
       at org.jboss.axis.providers.java.RPCProvider.invokeTarget(RPCProvider.java:176)
       at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)
       at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
       at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
       at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
       at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
       at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
       at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:215)
       at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:104)
       at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.NullPointerException
       at com.exegenix.ExegenixWork1Bean.processDefinitionNames(ExegenixWork1Bean.java:111)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:228)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
       at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:126)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:206)
       ... 46 more
      
      



      Can any one suggest me something?

      Thanks and Regards

        • 1. Re: error for jbpm webservice method
          kukeltje

          In the stacktrace I see no jBPM code, there is a reference in the stacktrace to your code

          (Caused by: java.lang.NullPointerException at
           com.exegenix.ExegenixWork1Bean.processDefinitionNames(ExegenixWork1Bean.java:111)


          more specifically to a line number, but you do not say what line that is.

          We are unable to help you this way, so my suggestion would be to report the issue in a better way.

          Ronald

          • 2. Re: error for jbpm webservice method
            forjbpm

            Hi,

            I have already mentioned in my post that error is at

            However for jbpmContext.getGraphSession().findAllProcessDefinitions();

            i.e. line no 111 in the error stack is nothing but the above line.

            Thanks and regards,

            • 3. Re: error for jbpm webservice method
              kukeltje

              sorry, I missed that, but since it is a null pointer exception in your code, and not an error in the jBPM code, it is impossible to see what is wrong.

              You should do some errorchecking by storing the result of jbpmContext.getGraphSession() in a variable and checking it is not null. Only then do a findAllProcessDefinitions() on that variable.

              if the jbpmContext.getGraphSession() is null, there is no sesion assigned in this thread. Do you associate a session somewhere with the thread this is running in?

              • 4. Re: error for jbpm webservice method
                forjbpm

                Hi Ronald,

                Thanks a lot for your reply!
                you are right jbpmContext was null .

                Thanks again,