0 Replies Latest reply on Jul 20, 2007 6:13 AM by Stefano Zaccaria

    Again about WS and JBPM

    Stefano Zaccaria Newbie

      I know I'm hard into understanding... But I need this feature... Therefore I'm sorry for my insistence!

      Ok, summarize, I need a web service that read the state of the tasks assign to a certain actor. Ex: the actor "bob" have some tasks in the list of own tasks, and he want them to know through web service, so can do something and pass over...
      I've followed the example "seambay" written by Shane, like you can read below.

      @Name("testJBPM")
      @Restrict("#{identity.loggedIn}")
      public class WfWebMethod implements Serializable{
      
       private static final long serialVersionUID = 1L;
      
       @In EntityManager entityManager;
      
      
       @SuppressWarnings("unchecked")
       public String getDocumenti(){
      
       ManagedJbpmContext bp = (ManagedJbpmContext)Component.getInstance("jbpmContext", true);
      
      ...
      ...
      ...
      
       return stringa.toString() ;
       }
      
      
       public void end() {
      
       }
      
      }
      
      



      But when I start the ws client, I receive the follow trace error in the trace of the jboss AS 4.2.0

      10:37:29,369 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
      javax.ejb.EJBException: java.util.EmptyStackException
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
       at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
       at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:174)
       at org.jboss.ws.integration.jboss42.ServiceEndpointInvokerEJB3.invokeServiceEndpointInstance(ServiceEndpointInvokerEJB3.java:114)
       at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:207)
       at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
       at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
       at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.util.EmptyStackException
       at java.util.Stack.peek(Stack.java:79)
       at org.jboss.seam.transaction.Transaction.registerSynchronization(Transaction.java:75)
       at org.jboss.seam.transaction.UTTransaction.registerSynchronization(UTTransaction.java:86)
       at org.jboss.seam.bpm.ManagedJbpmContext.joinTransaction(ManagedJbpmContext.java:91)
      


      and in the web service client:

      Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: java.util.EmptyStackException
       at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:70)
       at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:109)
       at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:531)
       at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:356)
       at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:230)
       at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
       at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
       at $Proxy15.documenti(Unknown Source)
       at com.cesaco.wsclient.WsClient.main(WsClient.java:14)
      


      Otherwise If I get some other seam component I don't receive none error. It's all ok

      
      @Name("testOther")
      @Restrict("#{identity.loggedIn}")
      public class WfWebMethod implements Serializable{
      
       private static final long serialVersionUID = 1L;
      
       @In EntityManager entityManager;
      
      
       @SuppressWarnings("unchecked")
       public String getDocumenti(){
      
      
       StringBuffer stringa = new StringBuffer();
      
      
       List<Documento> documenti = entityManager.createQuery(
       "select doc from Documento doc ").getResultList();
      
      
       for (Iterator iter = documenti .iterator(); iter.hasNext();) {
      
       Documento element = (Documento) iter.next();
       stringa.append(element.getNumass() + " - " + element.getNumdoc() + " - " + element.getRegdoc());
       Collection<Riga> righe = element.getRighe();
       for (Iterator iterator = righe.iterator(); iterator.hasNext();) {
       Riga riga = (Riga) iterator.next();
       stringa.append(" " + riga.getCodart() + " - " + riga.getPezzi() + "\n\r" );
       }
       }
      
       return stringa.toString() ;
       }
      
      
       public void end() {
      
       }
      
      }
      
      


      So, seen that I'm very hopeless and confused about this, I've conceived of make some scheduled work with quartz, in to SEAM application, that read the taskinstance and wrote the task list in a table, so read with ws...
      Oh, dear me, what a mess!!!

      Thanks again