#1 2012-03-07 15:52:08

jpfortin
Member
Company: HPSi
Registered: 2010-04-29
Posts: 21
Website

Web Service works in ESB Studio but not in OSGi

Tags: [esb, web service]

Service works well within Talend ESB studio 5.0.1 but not when deployed to OSGi container.  I get the following error:

09:36:55,383 | INFO  | qtp913802640-105 | ernal.GenericServiceProviderImpl   69 |  -  -  | Invoke operation '{http://www.rst1.com/service/}createProduct'
09:36:55,386 | WARN  | qtp913802640-105 | ache.cxf.common.logging.LogUtils  372 |  -  -  | Application {http://www.rst1.com/service/}ProductMediationWS#{http://www.rst1.com/service/}createProduct has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Talend job execution error
    at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:61)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[141:org.apache.cxf.bundle:2.5.0]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_30]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_30]
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_30]
    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:206)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)[141:org.apache.cxf.bundle:2.5.0]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:107)[141:org.apache.cxf.bundle:2.5.0]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)[50:org.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:163)[141:org.apache.cxf.bundle:2.5.0]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538)[61:org.eclipse.jetty.servlet:7.4.5.v20110725]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)[61:org.eclipse.jetty.servlet:7.4.5.v20110725]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)[70:org.ops4j.pax.web.pax-web-jetty:1.0.7]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)[60:org.eclipse.jetty.security:7.4.5.v20110725]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:937)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:116)[70:org.ops4j.pax.web.pax-web-jetty:1.0.7]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)[61:org.eclipse.jetty.servlet:7.4.5.v20110725]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:871)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:72)[70:org.ops4j.pax.web.pax-web-jetty:1.0.7]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.server.Server.handle(Server.java:346)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1065)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:823)[55:org.eclipse.jetty.http:7.4.5.v20110725]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)[55:org.eclipse.jetty.http:7.4.5.v20110725]
    at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)[59:org.eclipse.jetty.server:7.4.5.v20110725]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)[54:org.eclipse.jetty.io:7.4.5.v20110725]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)[54:org.eclipse.jetty.io:7.4.5.v20110725]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)[53:org.eclipse.jetty.util:7.4.5.v20110725]
    at java.lang.Thread.run(Thread.java:662)[:1.6.0_30]
Caused by: java.lang.RuntimeException: Talend job execution error
    at rst_mediation_2.productmediationws_createproduct_0_1.ProductMediationWS_createProduct$ESBProviderCallbackTalendJobWrapper_tESBProviderRequest_1.sendFault(ProductMediationWS_createProduct.java:644)[195:ProductMediationWS_createProduct:0.1]
    at rst_mediation_2.productmediationws_createproduct_0_1.ProductMediationWS_createProduct.tESBProviderRequest_1_LoopProcess(ProductMediationWS_createProduct.java:4087)[195:ProductMediationWS_createProduct:0.1]
    at rst_mediation_2.productmediationws_createproduct_0_1.ProductMediationWS_createProduct.runJobInTOS(ProductMediationWS_createProduct.java:4280)[195:ProductMediationWS_createProduct:0.1]
    at org.talend.esb.job.controller.internal.OperationTask.run(OperationTask.java:47)[176:org.talend.esb.job.controller:5.0.1]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_30]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_30]
    ... 1 more
Caused by: java.lang.NoClassDefFoundError: javax/wsdl/WSDLException
    at com.salesforce.soap.partner.SforceServiceStub.populateAxisService(SforceServiceStub.java:37)
    at com.salesforce.soap.partner.SforceServiceStub.<init>(SforceServiceStub.java:863)
    at com.salesforce.soap.partner.SforceServiceStub.<init>(SforceServiceStub.java:854)
    at com.salesforce.soap.partner.SforceServiceStub.<init>(SforceServiceStub.java:896)
    at org.talend.salesforce.SforceManagementImpl.login(SforceManagementImpl.java:213)
    at rst_mediation_2.productmediationws_createproduct_0_1.ProductMediationWS_createProduct.tESBProviderRequest_1_LoopProcess(ProductMediationWS_createProduct.java:3307)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: javax.wsdl.WSDLException
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)[osgi-3.6.2.R36x_v20110210.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)[osgi-3.6.2.R36x_v20110210.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)[osgi-3.6.2.R36x_v20110210.jar:]
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)[osgi-3.6.2.R36x_v20110210.jar:]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_30]
    ... 11 more

I checked my classpath and everything seems all right.


Cheers, JP

Offline

#2 2012-03-07 16:27:49

jpfortin
Member
Company: HPSi
Registered: 2010-04-29
Posts: 21
Website

Re: Web Service works in ESB Studio but not in OSGi

Hi,
My service is making a call to Salesforce and when I compared the working WSDL running in Talend ESB Studio:

<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="ProductMediationWS" targetNamespace="http://www.rst1.com/service/" xmlns:ens="urn:sobject.enterprise.soap.sforce.com" xmlns:glb="http://www.rst1.com/Global" xmlns:prd="http://www.rst1.com/Product" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.rst1.com/service/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">


with the one that generate the WSDL exception in the OSGi:

<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="ProductMediationWS" targetNamespace="http://www.rst1.com/service/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.rst1.com/service/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

I noticed when it is deployed to the OSGi container it is missing the following reference: xmlns:ens="urn:sobject.enterprise.soap.sforce.com"

Which translate into the following error (cannot find file in classpath):

Caused by: java.lang.NoClassDefFoundError: javax/wsdl/WSDLException
    at com.salesforce.soap.partner.SforceServiceStub.populateAxisService(SforceServiceStub.java:37)
    at com.salesforce.soap.partner.SforceServiceStub.<init>(SforceServiceStub.java:863)
    at com.salesforce.soap.partner.SforceServiceStub.<init>(SforceServiceStub.java:854)
    at com.salesforce.soap.partner.SforceServiceStub.<init>(SforceServiceStub.java:896)
    at org.talend.salesforce.SforceManagementImpl.login(SforceManagementImpl.java:213)
    at rst_mediation_2.productmediationws_createproduct_0_1.ProductMediationWS_createProduct.tESBProviderRequest_1_LoopProcess(ProductMediationWS_createProduct.java:3307)
    ... 5 more

OK, but when I drilled down within my KAR file in the container deploy folder, I could see the Salesforce jar (salesforceCRMManagement.jar) within the lib folder of my service JAR (ProductMediationWS_createProduct.jar).

What's going on?

Cheers, JP


Cheers, JP

Offline

#3 2012-03-08 12:03:45

zbe
Member
Registered: 2011-05-31
Posts: 59

Re: Web Service works in ESB Studio but not in OSGi

Looks to me as if the the WSDL4J library was not embedded in the job bundle, which causes the NoClassDefFoundError. To check whether wsdl included in the bundle is broken we need the complete wsdl the incriminated namespace might well have moved down in the xml document. I think this is worth filing an issue. It should include your studio project, the stacktrace and optionally the kar file.

Cheers,
Zsolt

Offline

#4 2012-05-27 04:34:27

mtemelk
New member
Registered: 2007-04-29
Posts: 3

Re: Web Service works in ESB Studio but not in OSGi

I have similar problem. Service works well within Talend ESB studio 5.1.0 but not when deployed to OSGi container.

SayHelloConsumer created and configured as in Talend ESB Getting Started user guide. Runs pefectly in Talend Studio, but does not run in OSGi container.

Environment: Windows 7, TOS_ESB-V5.1.0, generated language: java

I get the following errors:
SayHelloConsumer Job (fault message received for each name, 3 times total):
{http://schemas.xmlsoap.org/soap/envelope/}Server|org.dom4j.DocumentException: Error on line 1 of document  : The prefix "tns" for element "tns:SayHelloServiceOperationRequest" is not bound. Nested exception: The prefix "tns" for element "tns:SayHelloServiceOperationRequest" is not bound.||||

karaf error:

karaf@trun> java.lang.IllegalArgumentException: Unknown configuration option indent-number
        at net.sf.saxon.Configuration.setConfigurationProperty(Configuration.java:3815)
        at net.sf.saxon.TransformerFactoryImpl.setAttribute(TransformerFactoryImpl.java:268)
        at org.apache.cxf.helpers.XMLUtils.newTransformer(XMLUtils.java:123)
        at org.apache.cxf.wsdl11.SchemaSerializer.writeXml(SchemaSerializer.java:57)
        at org.apache.cxf.wsdl11.SchemaSerializer.marshall(SchemaSerializer.java:50)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printExtensibilityElements(Unknown Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printTypes(Unknown Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printDefinition(Unknown Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
        at org.apache.cxf.frontend.WSDLGetUtils.getDocument(WSDLGetUtils.java:222)
        at org.apache.cxf.frontend.WSDLGetInterceptor.getDocument(WSDLGetInterceptor.java:158)
        at org.apache.cxf.frontend.WSDLGetInterceptor.handleMessage(WSDLGetInterceptor.java:110)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193)
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:480)
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:72)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
        at org.eclipse.jetty.server.Server.handle(Server.java:345)
        at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
        at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)

Offline

#5 2012-05-29 11:34:30

cschneider
Talend Team
Registered: 2011-05-27
Posts: 23
Website

Re: Web Service works in ESB Studio but not in OSGi

This sounds a bit like the saxon libarary is not compatible with the CXF version. Can you provide us with a small test project that reproduces the behaviour?

Offline

Board footer

Powered by FluxBB