The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Don Stadler (74) [Avatar] Offline
#1
I ran the Mule example using the test client, and then ran the hybrid Servicemix example by firing up the Mule WS and dropping the query1.xml file into the mule
chapter7 in box and watching it eat the file and create a DAT file.

Unfortunately I don't see how the ServiceMix consumer is working at all here. I deployed the consumer to Servicemix, but any attempt to start Servicemix falls over with a port in use exception. So I drop the file into the Mule folder and it works - that isn't testing Servicemix because it isn't running.

Just to be perverse I decided to stop Mule and start Servicemix with both provider and consumer deployed, then drop the query1.xml test file into the in box on Servicemix chapter7/consumer. I got this error:

[java] [Fatal Error] query1.xml:1:1: Content is not allowed in prolog.
[java] ERROR - CxfBcComponent - Error processing exchange I
nOut[
[java] id: ID:192.168.1.64-11e32ed6d27-7:3
[java] status: Active
[java] role: provider
[java] service: {http://opensource.esb.org/CoC/}ChamberOfCommerceServiceI
mplService
[java] endpoint: ChamberOfCommerceServiceImplPort
[java] operation: {http://opensource.esb.org/CoC/}getCompany
[java] in: Unable to display: java.io.IOException: Stream closed
[java] ]
[java] javax.xml.transform.TransformerException: org.xml.sax.SAXParseExcept
ion: Content is not allowed in prolog.
[java] at org.apache.xalan.transformer.TransformerIdentityImpl.transfor
m(TransformerIdentityImpl.java:501)
[java] at org.apache.cxf.transport.jbi.JBIMessageHelper.convertMessageT
oInputStream(JBIMessageHelper.java:51)
[java] at org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvid
er.java:136)
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(Asy
ncBaseLifeCycle.java:53smilie
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchan
ge(AsyncBaseLifeCycle.java:490)
[java] at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(
BaseLifeCycle.java:46)
[java] at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.proce
ssInBound(DeliveryChannelImpl.java:610)
[java] at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(Abs
tractFlow.java:170)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(Se
daFlow.java:167)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQ
ueue.java:134)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Thread
PoolExecutor.java:885)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:907)
[java] at java.lang.Thread.run(Thread.java:619)
[java] Caused by: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
[java] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
rce)
[java] at org.apache.xalan.transformer.TransformerIdentityImpl.transfor
m(TransformerIdentityImpl.java:484)
[java] ... 12 more
[java] ---------
[java] org.xml.sax.SAXParseException: Content is not allowed in prolog.
[java] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
rce)
[java] at org.apache.xalan.transformer.TransformerIdentityImpl.transfor
m(TransformerIdentityImpl.java:484)
[java] at org.apache.cxf.transport.jbi.JBIMessageHelper.convertMessageT
oInputStream(JBIMessageHelper.java:51)
[java] at org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvid
er.java:136)
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(Asy
ncBaseLifeCycle.java:53smilie
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchan
ge(AsyncBaseLifeCycle.java:490)
[java] at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(
BaseLifeCycle.java:46)
[java] at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.proce
ssInBound(DeliveryChannelImpl.java:610)
[java] at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(Abs
tractFlow.java:170)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(Se
daFlow.java:167)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQ
ueue.java:134)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Thread
PoolExecutor.java:885)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:907)
[java] at java.lang.Thread.run(Thread.java:619)
[java] ERROR - FileComponent - Failed to process file: cha
pter7wsdl-consumeinquery1.xml. Reason: javax.xml.transform.TransformerExcepti
on: org.xml.sax.SAXParseException: Content is not allowed in prolog.
[java] javax.xml.transform.TransformerException: org.xml.sax.SAXParseExcept
ion: Content is not allowed in prolog.
[java] at org.apache.xalan.transformer.TransformerIdentityImpl.transfor
m(TransformerIdentityImpl.java:501)
[java] at org.apache.cxf.transport.jbi.JBIMessageHelper.convertMessageT
oInputStream(JBIMessageHelper.java:51)
[java] at org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvid
er.java:136)
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(Asy
ncBaseLifeCycle.java:53smilie
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchan
ge(AsyncBaseLifeCycle.java:490)
[java] at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(
BaseLifeCycle.java:46)
[java] at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.proce
ssInBound(DeliveryChannelImpl.java:610)
[java] at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(Abs
tractFlow.java:170)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(Se
daFlow.java:167)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQ
ueue.java:134)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Thread
PoolExecutor.java:885)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:907)
[java] at java.lang.Thread.run(Thread.java:619)
[java] Caused by: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
[java] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
rce)
[java] at org.apache.xalan.transformer.TransformerIdentityImpl.transfor
m(TransformerIdentityImpl.java:484)
[java] ... 12 more
[java] ---------
[java] org.xml.sax.SAXParseException: Content is not allowed in prolog.
[java] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
rce)
[java] at org.apache.xalan.transformer.TransformerIdentityImpl.transfor
m(TransformerIdentityImpl.java:484)
[java] at org.apache.cxf.transport.jbi.JBIMessageHelper.convertMessageT
oInputStream(JBIMessageHelper.java:51)
[java] at org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvid
er.java:136)
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(Asy
ncBaseLifeCycle.java:53smilie
[java] at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchan
ge(AsyncBaseLifeCycle.java:490)
[java] at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(
BaseLifeCycle.java:46)
[java] at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.proce
ssInBound(DeliveryChannelImpl.java:610)
[java] at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(Abs
tractFlow.java:170)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(Se
daFlow.java:167)
[java] at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQ
ueue.java:134)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Thread
PoolExecutor.java:885)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:907)
[java] at java.lang.Thread.run(Thread.java:619)
Terminate batch job (Y/N)? y
tijs.rademakers (494) [Avatar] Offline
#2
Re: Chapter 7 WS-Consume examples
Don,

You can't implement a consumer and provider in ServiceMix for the same web service. This is due to service names conflicts, because ServiceMix uses WSDL port names for both the consumer as well as the provider. Therefore we created the Swing test client, so the best option is to use the Swing test client.

Best regards,

Tijs
Don Stadler (74) [Avatar] Offline
#3
Mule Consume example: Network is unreachable
Ran the Mule consume example, recieved the following error:

[java] ********************************************************************
*
[java] INFO - TransactionTemplate - Exception Caught in Transac
ion template. Handing off to exception handler: org.mule.service.DefaultServic
ExceptionStrategy@3afc0c
[java] ERROR - DefaultServiceExceptionStrategy -
[java] ********************************************************************
***********
[java] Message : Initialisation Failure: Could not resolve UR
"http://localhost:8080/services/cocService?wsdl".
[java] Type : org.mule.transport.ConnectException
[java] Code : MULE_ERROR-84
[java] JavaDoc : http://mule.mulesource.org/docs/apidocs/org/
ule/transport/ConnectException.html
[java] Object : CxfWsdlMessageDispatcher{this=a159bb, endpoi
t=http://localhost:8080/services/cocService?wsdl&method=getCompany, disposed=fa
se}
[java] ********************************************************************
***********
[java] Exception stack is:
[java] 1. Network is unreachable: connect (java.net.SocketException)
[java] java.net.PlainSocketImpl:-2 (null)
[java] 2. Could not resolve URL "http://localhost:8080/services/cocService?
sdl". (org.apache.cxf.service.factory.ServiceConstructionException)
[java] org.apache.cxf.endpoint.dynamic.DynamicClientFactory:406 (null)
[java] 3. Initialisation Failure: Could not resolve URL "http://localhost:8
80/services/cocService?wsdl". (org.mule.transport.ConnectException)
[java] org.mule.transport.AbstractConnectable:222 (http://mule.mulesource
org/docs/apidocs/org/mule/transport/ConnectException.html)
[java] ********************************************************************
***********
[java] Root Exception stack trace:
[java] java.net.SocketException: Network is unreachable: connect
[java] at java.net.PlainSocketImpl.socketConnect(Native Method)
[java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
[java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.jav
:195)
[java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
[java] at java.net.Socket.connect(Socket.java:519)
[java] at java.net.Socket.connect(Socket.java:469)
[java] at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
[java] at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
[java] at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
[java] at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
[java] at sun.net.www.http.HttpClient.New(HttpClient.java:306)
[java] at sun.net.www.http.HttpClient.New(HttpClient.java:323)
[java] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(
ttpURLConnection.java:78smilie
[java] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Http
RLConnection.java:729)
[java] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLCo
nection.java:654)
[java] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Ht
pURLConnection.java:977)
[java] at org.apache.cxf.resource.URIResolver.tryFileSystem(URIResolver
java:133)
[java] at org.apache.cxf.resource.URIResolver.<init>(URIResolver.java:7
)
[java] at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.composeU
l(DynamicClientFactory.java:39smilie
[java] at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createCl
ent(DynamicClientFactory.java:15smilie
[java] at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createCl
ent(DynamicClientFactory.java:151)
[java] at org.mule.transport.cxf.wsdl.CxfWsdlMessageDispatcher$1.initia
ize(CxfWsdlMessageDispatcher.java:73)
[java] at org.mule.transport.cxf.wsdl.CxfWsdlMessageDispatcher.doConnec
(CxfWsdlMessageDispatcher.java:84)
[java] at org.mule.transport.AbstractConnectable.connect(AbstractConnec
able.java:201)
[java] at org.mule.transport.SingleAttemptConnectionStrategy.doConnect(
ingleAttemptConnectionStrategy.java:25)
[java] at org.mule.transport.AbstractConnectionStrategy.connect(Abstrac
ConnectionStrategy.java:10smilie
[java] at org.mule.transport.AbstractConnectable.connect(AbstractConnec
able.java:190)
[java] at org.mule.transport.SingleAttemptConnectionStrategy.doConnect(
ingleAttemptConnectionStrategy.java:25)
[java] at org.mule.transport.AbstractConnectionStrategy.connect(Abstrac
ConnectionStrategy.java:10smilie
[java] at org.mule.transport.AbstractMessageDispatcher.send(AbstractMes
ageDispatcher.java:155)
[java] at org.mule.transport.AbstractConnector.send(AbstractConnector.j
va:1890)
[java] at org.mule.endpoint.DefaultOutboundEndpoint.send(DefaultOutboun
Endpoint.java:76)
[java] at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java
327)
[java] at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java
213)
[java] at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransa
tion(AbstractOutboundRouter.java:14smilie
[java] at org.mule.transaction.TransactionTemplate.execute(TransactionT
mplate.java:99)
[java] at org.mule.routing.outbound.AbstractOutboundRouter.send(Abstrac
OutboundRouter.java:155)
[java] at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter
java:67)
[java] at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.d
InTransaction(DefaultOutboundRouterCollection.java:64)
[java] at org.mule.transaction.TransactionTemplate.execute(TransactionT
mplate.java:45)
[java] at org.mule.routing.outbound.DefaultOutboundRouterCollection.rou
e(DefaultOutboundRouterCollection.java:69)
[java] at org.mule.service.AbstractService.dispatchToOutboundRouter(Abs
ractService.java:883)
[java] at org.mule.model.seda.SedaService.dispatchToOutboundRouter(Seda
ervice.java:514)
[java] at org.mule.model.seda.SedaService$ComponentStageWorker.run(Seda
ervice.java:537)
[java] at org.mule.work.WorkerContext.run(WorkerContext.java:310)
[java] at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExec
tor.runWorker(ThreadPoolExecutor.java:1061)
[java] at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExec
tor$Worker.run(ThreadPoolExecutor.java:575)
[java] at java.lang.Thread.run(Thread.java:619)
[java]
[java] ********************************************************************
***********
[java]
[java] ERROR - DefaultServiceExceptionStrategy -
[java] ********************************************************************
***********
[java] Message : Initialisation Failure: Could not resolve UR
"http://localhost:8080/services/cocService?wsdl".
[java] Type : org.mule.transport.ConnectException
[java] Code : MULE_ERROR-84
[java] JavaDoc : http://mule.mulesource.org/docs/apidocs/org/
ule/transport/ConnectException.html
[java] Object : CxfWsdlMessageDispatcher{this=a159bb, endpoi
t=http://localhost:8080/services/cocService?wsdl&method=getCompany, disposed=fa
se}
[java] ********************************************************************
***********
[java] Exception stack is:
[java] 1. Network is unreachable: connect (java.net.SocketException)
[java] java.net.PlainSocketImpl:-2 (null)
[java] 2. Could not resolve URL "http://localhost:8080/services/cocService?
sdl". (org.apache.cxf.service.factory.ServiceConstructionException)
[java] org.apache.cxf.endpoint.dynamic.DynamicClientFactory:406 (null)
[java] 3. Initialisation Failure: Could not resolve URL "http://localhost:8
80/services/cocService?wsdl". (org.mule.transport.ConnectException)
[java] org.mule.transport.AbstractConnectable:222 (http://mule.mulesource
org/docs/apidocs/org/mule/transport/ConnectException.html)
[java] ********************************************************************
***********
[java] Root Exception stack trace:
[java] java.net.SocketException: Network is unreachable: connect
[java] at java.net.PlainSocketImpl.socketConnect(Native Method)
[java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
[java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.jav
:195)
[java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
[java] at java.net.Socket.connect(Socket.java:519)
[java] at java.net.Socket.connect(Socket.java:469)
[java] at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
[java] at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
[java] at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
[java] at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
[java] at sun.net.www.http.HttpClient.New(HttpClient.java:306)
[java] at sun.net.www.http.HttpClient.New(HttpClient.java:323)
[java] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(
ttpURLConnection.java:78smilie
[java] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Http
RLConnection.java:729)
[java] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLCo
nection.java:654)
[java] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Ht
pURLConnection.java:977)
[java] at org.apache.cxf.resource.URIResolver.tryFileSystem(URIResolver
java:133)
[java] at org.apache.cxf.resource.URIResolver.<init>(URIResolver.java:7
)
[java] at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.composeU
l(DynamicClientFactory.java:39smilie
[java] at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createCl
ent(DynamicClientFactory.java:15smilie
[java] at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createCl
ent(DynamicClientFactory.java:151)
[java] at org.mule.transport.cxf.wsdl.CxfWsdlMessageDispatcher$1.initia
ize(CxfWsdlMessageDispatcher.java:73)
[java] at org.mule.transport.cxf.wsdl.CxfWsdlMessageDispatcher.doConnec
(CxfWsdlMessageDispatcher.java:84)
[java] at org.mule.transport.AbstractConnectable.connect(AbstractConnec
able.java:201)
[java] at org.mule.transport.SingleAttemptConnectionStrategy.doConnect(
ingleAttemptConnectionStrategy.java:25)
[java] at org.mule.transport.AbstractConnectionStrategy.connect(Abstrac
ConnectionStrategy.java:10smilie
[java] at org.mule.transport.AbstractConnectable.connect(AbstractConnec
able.java:190)
[java] at org.mule.transport.SingleAttemptConnectionStrategy.doConnect(
ingleAttemptConnectionStrategy.java:25)
[java] at org.mule.transport.AbstractConnectionStrategy.connect(Abstrac
ConnectionStrategy.java:10smilie
[java] at org.mule.transport.AbstractMessageDispatcher.send(AbstractMes
ageDispatcher.java:155)
[java] at org.mule.transport.AbstractConnector.send(AbstractConnector.j
va:1890)
[java] at org.mule.endpoint.DefaultOutboundEndpoint.send(DefaultOutboun
Endpoint.java:76)
[java] at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java
327)
[java] at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java
213)
[java] at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransa
tion(AbstractOutboundRouter.java:14smilie
[java] at org.mule.transaction.TransactionTemplate.execute(TransactionT
mplate.java:99)
[java] at org.mule.routing.outbound.AbstractOutboundRouter.send(Abstrac
OutboundRouter.java:155)
[java] at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter
java:67)
[java] at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.d
InTransaction(DefaultOutboundRouterCollection.java:64)
[java] at org.mule.transaction.TransactionTemplate.execute(TransactionT
mplate.java:45)
[java] at org.mule.routing.outbound.DefaultOutboundRouterCollection.rou
e(DefaultOutboundRouterCollection.java:69)
[java] at org.mule.service.AbstractService.dispatchToOutboundRouter(Abs
ractService.java:883)
[java] at org.mule.model.seda.SedaService.dispatchToOutboundRouter(Seda
ervice.java:514)
[java] at org.mule.model.seda.SedaService$ComponentStageWorker.run(Seda
ervice.java:537)
[java] at org.mule.work.WorkerContext.run(WorkerContext.java:310)
[java] at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExec
tor.runWorker(ThreadPoolExecutor.java:1061)
[java] at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExec
tor$Worker.run(ThreadPoolExecutor.java:575)
[java] at java.lang.Thread.run(Thread.java:619)
[java]
[java] ********************************************************************
***********
[java]