AnsweredAssumed Answered

Calls to multiple web service provider fail

Question asked by eirmag on Jul 13, 2012
Latest reply on Jul 20, 2012 by eirmag
Hi all,

I would like to achieve a "simple" thing with activiti: call several service providers sequentially. But so far I'm unable to do so! I've created a testcase project to understand exactly what is wrong, with different tests. The test case creates two service provider, deployed in virtually different locations
* A counter service provider, that exposes one method with one parameter. The service is deployed on endpoint http://127.0.0.1:63081/counter
* An echo service provider, that exposes one method with one parameter. The service is deployed on endpoint http://127.0.0.1:63082/echo

Now, the problem I face is "simple" but I'm unable to find the root cause:
Whenever I call a service task from one endpoint, I'm not able to call the other service. For instance, if the first service that I call is the counter service, I'm unable to contact the echo server. The reverse (echo server contacted first -> unable to contact the counter service) produces the same result. The two pictures attached shows the problem in the two cases. I've also attached a listing to present the exception produced when calling the second service provider (does someone knows how to attach txt file to the post? I've put .zip extension, but it is not compressed. I only display partial information to reduce size of the exception inlined). For this file, the scenario is : the business process contacts the Echo server first, then Activiti is unable to contact the Counter server (cannot find the Inc class generated by CXF even though in the 2nd line of the listing, the log says the class is created).

There is attached (in fact no, the project is 3MB large, upload is limited to 256kB. The project can be found at http://nunix.fr/ComplexServiceProblem.zip) a complete eclipse project, that yuo can import. Then run the tests individually or the scenarios, they are unit testing that you can launch with JUnit. The only libraries that you need are CXF (my version is 2.6.1) and the Activiti Designer Extension. I have the sun jdk 1.7.

If you have any idea of what can be wrong, feel free to answer.
Best Regards,

Gabriel

=> Scenario: contact the Echo server first, then Activiti is unable to contact the Counter server (cannot find the Inc class generated by CXF even though in the 2nd line of the listing, the log says the class is created

————————————–
juil. 13, 2012 3:54:16 PM org.apache.cxf.common.jaxb.JAXBUtils logGeneratedClassNames
INFO: Created classes: org.activiti.engine.impl.webservice.Account, org.activiti.engine.impl.webservice.Customer, org.activiti.engine.impl.webservice.Inc, org.activiti.engine.impl.webservice.IncResponse, org.activiti.engine.impl.webservice.IncSimple, org.activiti.engine.impl.webservice.IncSimpleResponse, org.activiti.engine.impl.webservice.ObjectFactory, org.activiti.engine.impl.webservice.TripletObject
warning: [options] bootstrap class path not set in conjunction with -source 1.5
1 warning
juil. 13, 2012 3:54:16 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://webservice.impl.engine.activiti.org/}Counter#{http://webservice.impl.engine.activiti.org/}inc has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: org.activiti.engine.impl.webservice.Inc is not known to this context
   at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:261)
   at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
   ……
   ……
   ……
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.SAXException2: org.activiti.engine.impl.webservice.Inc is not known to this context
javax.xml.bind.JAXBException: org.activiti.engine.impl.webservice.Inc is not known to this context]
   at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:326)
   at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251)
   at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95)
   at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:554)
   at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:236)
   … 134 more
Caused by: com.sun.istack.SAXException2: org.activiti.engine.impl.webservice.Inc is not known to this context
javax.xml.bind.JAXBException: org.activiti.engine.impl.webservice.Inc is not known to this context
   at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:247)
   at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:262)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:148)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:131)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:333)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:340)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:76)
   at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
   at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323)
   … 138 more
Caused by: javax.xml.bind.JAXBException: org.activiti.engine.impl.webservice.Inc is not known to this context
   at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:619)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:145)
   … 144 more

juil. 13, 2012 3:54:16 PM org.activiti.engine.impl.webservice.WSOperation safeSend
WARNING: Error calling WS http://webservice.activiti.org/:Counter
org.apache.cxf.interceptor.Fault: Marshalling Error: org.activiti.engine.impl.webservice.Inc is not known to this context
   at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:261)
   at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
   at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:110)
   at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
   at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
   ……
   ……
   ……
   ……
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.SAXException2: org.activiti.engine.impl.webservice.Inc is not known to this context
javax.xml.bind.JAXBException: org.activiti.engine.impl.webservice.Inc is not known to this context]
   at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:326)
   at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251)
   at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95)
   at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:554)
   at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:236)
   … 134 more
Caused by: com.sun.istack.SAXException2: org.activiti.engine.impl.webservice.Inc is not known to this context
javax.xml.bind.JAXBException: org.activiti.engine.impl.webservice.Inc is not known to this context
   at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:247)
   at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:262)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:148)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:131)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:333)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:340)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:76)
   at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
   at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323)
   … 138 more
Caused by: javax.xml.bind.JAXBException: org.activiti.engine.impl.webservice.Inc is not known to this context
   at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:619)
   at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:145)
   … 144 more

Outcomes