Hi Scott,
Look at the MessageExchange details
10:04:23,756 | WARN | @qtp-136071871-0 |
NMR | .servicemix.nmr.core.ChannelImpl
293 | 84 - org.apache.servicemix.nmr.core - 1.3.0.fuse-02-00 | Error
processing exchange [
id: 04761a54-c845-46b8-94fc-598f9f49091e
mep: InOut
status: Active
role: Consumer
target: PropertyMatchingReference[{SERVICE_NAME=RouterService}]
operation: {http://servicemix.apache.org/samples/wsdl-first}GetPerson
properties: [
org.apache.servicemix.senderEndpoint = {http://servicemix.apache.org/samples/wsdl-first
}PersonService:soap
javax.jbi.messaging.MessageExchange =
org.apache.servicemix.jbi.runtime.impl.inouti...@19fab791
javax.jbi.messaging.sendSync = <null>
javax.jbi.InterfaceName = <null>
javax.jbi.transaction.jta = <null>
org.apache.servicemix.correlationId = 04761a54-
c845-46b8-94fc-598f9f49091e
javax.jbi.ServiceName = RouterService
]
In: [
content: org.apache.servicemix.soap.util.stax.staxsou...@1b299dea
properties: [
javax.jbi.messaging.protocol.headers = {}
]
]
]
Especially this line
target: PropertyMatchingReference[{SERVICE_NAME=RouterService}]
The camel router register SERVICE_NAME as {http://it.ojp.gov/GlobalJRA/TSCEncounter/router
}RouterService, but here the dispatch target
SERVICE_NAME=RouterService(without namespace), this mismatch cause the
org.apache.servicemix.nmr.api.ServiceMixException: Could not dispatch
exchange. No matching endpoints.
So there must be something wrong where you specify the targetService
for your cxf bc consumer.
Look at ReportEncounterService_WS/src/main/resources/xbean.xml in your
testcase,
You have
router="http://it.ojp.gov/GlobalJRA/TSCEncounter/router"
This is incorrect, it should be
xmlns:router="http://it.ojp.gov/GlobalJRA/TSCEncounter/router"
for a namespace declaration, correct it you will see your testcase
working.
Regards
Freeman
On 2011-1-10, at 上午12:17, Scott Came wrote:
Thanks, Freeman. I made that change, and still see the same kind of
result. (The outcome of your suggestion, it seems, is that Camel
now creates the service with a name of "router" (the next-to-last
segment of the URI in camel-context) with an endpoint name of
"RouterService". I confirmed this with an nmr:list.)
I set the log level to debug and have attached the resulting log. I
can’t see anything obvious to indicate a problem. If you would be
willing to take a look I’d appreciate it.
I did notice some stack traces that now appear...here is an example:
java.io.FileNotFoundException: /org/apache/camel/component/file (No
such file or directory)
at java.io.FileInputStream.open(Native Method)[:1.6.0_22]
at java.io.FileInputStream.<init>(FileInputStream.java:106)[:
1.6.0_22]
at
org
.apache
.camel
.impl
.DefaultPackageScanClassResolver
.find(DefaultPackageScanClassResolver.java:284)
[72:org.apache.camel.camel-core:2.4.0.fuse-02-00]
at
org
.apache
.camel
.impl
.DefaultPackageScanClassResolver
.find(DefaultPackageScanClassResolver.java:191)
[72:org.apache.camel.camel-core:2.4.0.fuse-02-00]
at
org
.apache
.camel
.impl
.DefaultPackageScanClassResolver
.findAnnotated(DefaultPackageScanClassResolver.java:111)
[72:org.apache.camel.camel-core:2.4.0.fuse-02-00]
at
org
.apache
.camel
.impl
.converter
.AnnotationTypeConverterLoader
.load(AnnotationTypeConverterLoader.java:64)
[72:org.apache.camel.camel-core:2.4.0.fuse-02-00]
at
org
.apache
.camel
.impl
.converter
.DefaultTypeConverter.loadTypeConverters(DefaultTypeConverter.java:
384)[72:org.apache.camel.camel-core:2.4.0.fuse-02-00]
at
org
.apache
.camel
.impl
.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:
410)[72:org.apache.camel.camel-core:2.4.0.fuse-02-00]
at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:56)
[72:org.apache.camel.camel-core:2.4.0.fuse-02-00]
at
org
.apache
.servicemix.nmr.core.CamelConverter.<init>(CamelConverter.java:37)
[84:org.apache.servicemix.nmr.core:1.3.0.fuse-02-00]
at
org
.apache
.servicemix.nmr.core.ExchangeImpl.getConverter(ExchangeImpl.java:468)
[84:org.apache.servicemix.nmr.core:1.3.0.fuse-02-00]
at
org
.apache.servicemix.nmr.core.ExchangeImpl.convert(ExchangeImpl.java:
460)[84:org.apache.servicemix.nmr.core:1.3.0.fuse-02-00]
at
org
.apache
.servicemix.nmr.core.ExchangeImpl.getProperty(ExchangeImpl.java:187)
[84:org.apache.servicemix.nmr.core:1.3.0.fuse-02-00]
at
org
.apache
.servicemix
.jbi
.runtime
.impl.MessageExchangeImpl.getInterfaceName(MessageExchangeImpl.java:
266)[95:org.apache.servicemix.jbi.runtime:1.3.0.fuse-02-00]
at
org
.apache
.servicemix
.jbi
.runtime
.impl.MessageExchangeImpl.getInterfaceName(MessageExchangeImpl.java:
240)[95:org.apache.servicemix.jbi.runtime:1.3.0.fuse-02-00]
at
org
.apache
.servicemix
.common
.endpoints
.ConsumerEndpoint.configureExchangeTarget(ConsumerEndpoint.java:171)
[94:servicemix-common:2010.02.0.fuse-02-00]
at org.apache.servicemix.cxfbc.CxfBcConsumer.access
$200(CxfBcConsumer.java:129)[143:servicemix-cxf-bc:
2010.02.0.fuse-02-00]
at org.apache.servicemix.cxfbc.CxfBcConsumer
$JbiInvokerInterceptor.handleMessage(CxfBcConsumer.java:820)
[143:servicemix-cxf-bc:2010.02.0.fuse-02-00]
at
org
.apache
.cxf
.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:
243)[141:org.apache.cxf.bundle:2.2.11.fuse-00-00]
at
org
.apache
.cxf
.transport
.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)
[141:org.apache.cxf.bundle:2.2.11.fuse-00-00]
at org.apache.servicemix.cxfbc.CxfBcConsumer
$JbiChainInitiationObserver.onMessage(CxfBcConsumer.java:739)
[143:servicemix-cxf-bc:2010.02.0.fuse-02-00]
at
org
.apache
.cxf
.transport
.http_jetty
.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:311)
[141:org.apache.cxf.bundle:2.2.11.fuse-00-00]
at
org
.apache
.cxf
.transport
.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:
275)[141:org.apache.cxf.bundle:2.2.11.fuse-00-00]
at
org
.apache
.cxf
.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:
70)[141:org.apache.cxf.bundle:2.2.11.fuse-00-00]
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
766)[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at
org
.mortbay
.jetty
.handler
.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at
org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at org.mortbay.jetty.Server.handle(Server.java:322)
[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:945)
[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at
org
.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
410)[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
[104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse]
However I wonder if these are critical since they only show up when
the log level is set to DEBUG…
This seems like such a common scenario… csfbc:consumer -> Camel
route. I’m surprised there’s not an example…one I get this
working I would be happy to share an example back, if that would be
of interest. Does anyone have this kind of application working…and
if so would you be willing to share your code to see if I can get it
working?
Any help you all can offer would be most appreciated.
Thanks.
--Scott
-----Original Message-----
From: Freeman Fang [mailto:[email protected]]
Sent: Sunday, January 09, 2011 5:35 AM
To: [email protected]
Subject: Re: Problems with endpoint resolution (CXF -> Camel)
Hi,
How about you change from endpoint in
./ReportEncounterServiceRouter/src/main/resources/camel-context.xml
to
<from
uri="jbi:endpoint:http://it.ojp.gov/GlobalJRA/TSCEncounter/router/RouterService
"/>
If it doesn't work, could you please turn on DEBUG level bug, which
will print the MessageExchange into log with dispatch necessary
properties, this may give you more idea what happened.
Freeman
On 2011-1-9, at 上午2:45, Scott Came wrote:
I have spent upwards of 8 hours on this now and figure it’s time to
ask the experts…
I am trying to get a simple application working in Servicemix 4.3.0
– FUSE – 03 – 00. I am running on Mac OS X, JDK 1.6.0_22, and
using the Maven tooling (fuse archetypes) within Eclipse Galileo to
setup and build my projects.
The project uses cxfbc to receive a web service message (I’m using
the person.wsdl from one of the examples in the distro). It passes
the web service message to a Camel route, which simply logs the
message using the log component in Camel core. I’ve attached the
three Eclipse projects that I’m using: one is a JBI service
assembly, one is a service unit with the cxfbc consumer, and one is
a service unit with the camel route. The SA has a pom dependency on
the other two.
Everything builds and deploys fine; I can see all the endpoints in
nmr:list. However, when I send a message to the web service from
SoapUI, I get exceptions in the servicemix log:
“org.apache.servicemix.nmr.api.ServiceMixException: Could not
dispatch exchange. No matching endpoints.” Just before that in the
log, I see:
10:16:40,606 | WARN | qtp-1588661337-0 |
CxfBcComponent | ommon.endpoints.ConsumerEndpoint
184 | 94 - servicemix-common - 2010.02.0.fuse-02-00 | Target service
(RouterService) and endpoint (RouterServiceEndpoint) specified, but
no matching endpoint found. Only the service will be used for
routing.
Yet the appropriate line from nmr:list says:
{http://it.ojp.gov/GlobalJRA/TSCEncounter/router
}RouterService:RouterServiceEndpoint. That to me looks like
service=RouterService, and endpoint=RouterServiceEndpoint. Why is
cxfbc:consumer not finding it??
I have checked the JBI URI and the targetService and targetEndpoint
parameters many, many times…I have also tried as many different
variations on them as I can think of. Nothing works; I always get
these same exceptions/messages. I also note that there are several
posts in the forum about people having similar problems, but the
ones I saw did not offer any definitive resolution to what I’m
seeing.
Any idea what’s going wrong, and what I need to do to fix this?
I’m sure it’s some little configuration thing…perhaps missing
maven dependencies or references in my xbean or camel-context files??
Thanks for any help you can offer.
--Scott
<ReportEncounterService_SA-0.0.1-
SNAPSHOT
.zip
<
ReportEncounterService_Router
.zip><ReportEncounterService_WS.zip><ReportEncounterService_SA.zip>
--
Freeman Fang
------------------------
FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org
<servicemix.log.zip>
--
Freeman Fang
------------------------
FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org