You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by vinh <vi...@faa.gov> on 2010/07/14 17:26:05 UTC

How to send a request to a nmr service?

I was wondering if there was an easy way to send a message from a service on
the nmr to another service.  Something like the interaction between a cxfbc
and a cxfse.   I've been able to expose a service on the nmr by following
the cxf-nmr example and I was trying to use client part of the nmr example
to talk to my exposed service, but it doesn't want to work.  Is there a way
to send a message to the another service without having to write an
onMessage method? I wanted to have internal services that can be used be
other services.  
I'm currently getting this exception:
javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: Source object passed to ''{0}''
has no contents.
	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:719)
	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
	at
org.apache.servicemix.cxf.transport.nmr.NMRMessageHelper.convertMessageToInputStream(NMRMessageHelper.java:51)
	at
org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:127)
	at
org.apache.servicemix.nmr.core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86)
	at org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java:255)
	at org.apache.servicemix.nmr.core.ChannelImpl$1.run(ChannelImpl.java:215)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.transform.TransformerException: Source object passed to
''{0}'' has no contents.
	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:667)
	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:707)
	... 9 more

Thanks
Vinh

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1092879.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Man, since I'm not seeing the proper exception back.  Should I submit this as
a bug?

Thanks,
Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2263351.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Verified this is an issue in your test case and added comment for  
SMXCOMP-786, you can get details there.

Freeman
On 2010-8-5, at 上午5:22, vinh wrote:

>
> I've opened up an issue in jira.
> https://issues.apache.org/activemq/browse/SMXCOMP-786
> https://issues.apache.org/activemq/browse/SMXCOMP-786
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2264683.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
I've opened up an issue in jira. 
https://issues.apache.org/activemq/browse/SMXCOMP-786
https://issues.apache.org/activemq/browse/SMXCOMP-786  
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2264683.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Although I'm not sure it's a bug, as our testcase working correctly.

But yeah, go ahead to create a jira ticket, and append your testcase,  
it's always better trackable with jira even it's not a bug.

Freeman
On 2010-8-4, at 上午4:09, vinh wrote:

>
> Man, I'm just not seeing the exception that I'm expecting.  So  
> should I then
> submit this as a bug?
>
> Thanks,
> Vinh
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2263353.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Man, I'm just not seeing the exception that I'm expecting.  So should I then
submit this as a bug? 

Thanks,
Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2263353.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
On 2010-8-2, at 下午10:47, vinh wrote:

>
> Hi,
> I've looked at the test case and it doesn't seem to be that much  
> different
> from how I'm throwing and catching the my fault.  And there wasn't any
> special configuration in the xbeans.xml outside of the proxy setup  
> that I
> could see.  I see that the test was submitted to cxf-se ver 2010.02,  
> what
> version was the implemented code in?  I'm currently running
> cxf-se-2010.01-fuse-02.
The cxf-se-2010.01-fuse-02 you are using already include the  
implemented code to catch pre-defined fault type. I just added a  
testcase to demonstrate how it works very recently.
Freeman
>
> Vinh
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2261816.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Hi,
I've looked at the test case and it doesn't seem to be that much different
from how I'm throwing and catching the my fault.  And there wasn't any
special configuration in the xbeans.xml outside of the proxy setup that I
could see.  I see that the test was submitted to cxf-se ver 2010.02, what
version was the implemented code in?  I'm currently running
cxf-se-2010.01-fuse-02.  

Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2261816.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Actually I just add a testcase to demonstrate how cxf se proxy catch  
wsdl pre-defined fault type,  SMXCOMP-784[1] tracked it, you may need  
take a look at it.

[1]https://issues.apache.org/activemq/browse/SMXCOMP-784
Freeman
On 2010-8-2, at 上午11:39, vinh wrote:

>
> Right that what I thought should happen, but I'm not seeing that. My  
> target
> service is throwing a known exception, both the client and server side
> generated the exception with wsdl2java.
>
> Here's my test case if you want to check it out.
> http://servicemix.396122.n5.nabble.com/file/n2261366/proxy-w-fault.zip
> proxy-w-fault.zip
>
> Here's my stack trace:
> 23:29:09,282 | WARN  | -cxf-se-thread-2 |  
> PhaseInterceptorChain            |
> ache.cxf.common.logging.LogUtils  365 | Application
> {http://proto.mycompany.com/proxy}HelloWorldService#{http://proto.mycompany.com/proxy 
> }sayHi
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: org.apache.cxf.binding.jbi.JBIFault:
> faultstring
> 	at
> org 
> .apache 
> .cxf 
> .service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
> 	at
> org 
> .apache 
> .cxf 
> .jaxws 
> .AbstractJAXWSMethodInvoker 
> .createFault(AbstractJAXWSMethodInvoker.java:86)
> 	at
> org 
> .apache 
> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
> 	at
> org 
> .apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java: 
> 60)
> 	at
> org 
> .apache 
> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
> 	at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor 
> $1.run(ServiceInvokerInterceptor.java:58)
> 	at java.util.concurrent.Executors 
> $RunnableAdapter.call(Executors.java:441)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> 	at
> org 
> .apache 
> .cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java: 
> 37)
> 	at
> org 
> .apache 
> .cxf 
> .interceptor 
> .ServiceInvokerInterceptor 
> .handleMessage(ServiceInvokerInterceptor.java:106)
> 	at
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 243)
> 	at
> org 
> .apache 
> .cxf 
> .transport 
> .ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
> 	at
> org 
> .apache 
> .cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java: 
> 156)
> 	at
> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java: 
> 455)
> 	at
> org 
> .apache 
> .servicemix 
> .common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:617)
> 	at
> org 
> .apache 
> .servicemix 
> .common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java: 
> 571)
> 	at
> org 
> .apache 
> .servicemix 
> .common 
> .AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:468)
> 	at
> org.apache.servicemix.common.AsyncBaseLifeCycle 
> $2.run(AsyncBaseLifeCycle.java:347)
> 	at
> java.util.concurrent.ThreadPoolExecutor 
> $Worker.runTask(ThreadPoolExecutor.java:886)
> 	at
> java.util.concurrent.ThreadPoolExecutor 
> $Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.xml.ws.WebServiceException:
> org.apache.cxf.binding.jbi.JBIFault: faultstring
> 	at  
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
> 154)
> 	at $Proxy130.getPerson(Unknown Source)
> 	at  
> com.mycompany.proto.proxy.HelloWorldImpl.sayHi(HelloWorldImpl.java:46)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org 
> .apache 
> .cxf 
> .service 
> .invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
> 	at
> org 
> .apache 
> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
> 	... 19 more
> Caused by: org.apache.cxf.binding.jbi.JBIFault: faultstring
> 	at
> org 
> .apache 
> .cxf 
> .binding 
> .jbi 
> .interceptor 
> .JBIFaultInInterceptor.handleMessage(JBIFaultInInterceptor.java:61)
> 	at
> org 
> .apache 
> .cxf 
> .binding 
> .jbi 
> .interceptor 
> .JBIFaultInInterceptor.handleMessage(JBIFaultInInterceptor.java:44)
> 	at
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 243)
> 	at
> org 
> .apache 
> .cxf 
> .interceptor 
> .AbstractFaultChainInitiatorObserver 
> .onMessage(AbstractFaultChainInitiatorObserver.java:99)
> 	at
> org 
> .apache 
> .cxf 
> .binding 
> .jbi 
> .interceptor 
> .JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java: 
> 95)
> 	at
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 243)
> 	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:700)
> 	at
> org 
> .apache 
> .cxf 
> .transport 
> .jbi 
> .JBIConduitOutputStream 
> .commitOutputMessage(JBIConduitOutputStream.java:185)
> 	at
> org 
> .apache 
> .cxf 
> .transport 
> .jbi.JBIConduitOutputStream.doClose(JBIConduitOutputStream.java:81)
> 	at  
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java: 
> 185)
> 	at  
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java: 
> 66)
> 	at
> org.apache.cxf.interceptor.MessageSenderInterceptor 
> $ 
> MessageSenderEndingInterceptor 
> .handleMessage(MessageSenderInterceptor.java:62)
> 	at
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 243)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> 	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java: 
> 73)
> 	at  
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
> 124)
> 	... 27 more
>
>
> Thanks,
> Vinh
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2261366.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Right that what I thought should happen, but I'm not seeing that. My target
service is throwing a known exception, both the client and server side
generated the exception with wsdl2java.  

Here's my test case if you want to check it out. 
http://servicemix.396122.n5.nabble.com/file/n2261366/proxy-w-fault.zip
proxy-w-fault.zip  

Here's my stack trace:
23:29:09,282 | WARN  | -cxf-se-thread-2 | PhaseInterceptorChain            |
ache.cxf.common.logging.LogUtils  365 | Application
{http://proto.mycompany.com/proxy}HelloWorldService#{http://proto.mycompany.com/proxy}sayHi
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: org.apache.cxf.binding.jbi.JBIFault:
faultstring
	at
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
	at
org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
	at
org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
	at
org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
	at
org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:455)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:617)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:571)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:468)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:347)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.ws.WebServiceException:
org.apache.cxf.binding.jbi.JBIFault: faultstring
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:154)
	at $Proxy130.getPerson(Unknown Source)
	at com.mycompany.proto.proxy.HelloWorldImpl.sayHi(HelloWorldImpl.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
	... 19 more
Caused by: org.apache.cxf.binding.jbi.JBIFault: faultstring
	at
org.apache.cxf.binding.jbi.interceptor.JBIFaultInInterceptor.handleMessage(JBIFaultInInterceptor.java:61)
	at
org.apache.cxf.binding.jbi.interceptor.JBIFaultInInterceptor.handleMessage(JBIFaultInInterceptor.java:44)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
	at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:99)
	at
org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:95)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:700)
	at
org.apache.cxf.transport.jbi.JBIConduitOutputStream.commitOutputMessage(JBIConduitOutputStream.java:185)
	at
org.apache.cxf.transport.jbi.JBIConduitOutputStream.doClose(JBIConduitOutputStream.java:81)
	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:185)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
	... 27 more


Thanks,
Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2261366.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Proxy can catch the execption/fault type which already defined in the  
wsdl for a certain method, this kind of exception/fault is clearly  
described in the interface, so it's known for both client and server  
side.
For other RuntimeException, the proxy(which play the role as a client)  
side just catch JBIFault.

Freeman
On 2010-7-31, at 上午7:26, vinh wrote:

>
> I hope this is not a duplicate.  I'm sorry if it is.
> Anyway, thanks for pointing out the service name mistake.  I totally  
> didn't
> forgot to check the endpoints names, stupid me.  I do have another  
> question
> for you.  When the proxy's target endpoint throw an exception/fault,  
> it
> seems like that the proxy always receives that fault as a JBIFault.   
> Is that
> normal and if yes, it is possible to retrieve the original fault  
> that was
> threw?
>
> Thanks,
> Vinh
>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2260202.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
I hope this is not a duplicate.  I'm sorry if it is.
Anyway, thanks for pointing out the service name mistake.  I totally didn't
forgot to check the endpoints names, stupid me.  I do have another question
for you.  When the proxy's target endpoint throw an exception/fault, it
seems like that the proxy always receives that fault as a JBIFault.  Is that
normal and if yes, it is possible to retrieve the original fault that was
threw?

Thanks, 
Vinh

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p2260202.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

My comment inline.
On 2010-7-22, at 下午11:56, vinh wrote:

>
> Hi, thank you for the tip I was able to deploy the proxy with that,  
> but I
> still can't get it to work.  I'm getting "No matching endpoint" when  
> the
> proxy is trying to talk to the target-se.  Also I found it weird  
> that I had
> to move the wsdl2java generated code for the my proxy to a different
> package, in order for it start successfully.  It seem like you can't  
> have
> the same targetnamespace for two different services.
Actually you can't have same SERVICE_NAME/ENDPOINT_NAME for two  
different services.
In your case, you change the targetnamespace, so that the SERVICE_NAME  
isn't same. You also can change the local part of SERVICE_NAME to make  
it different.
>
> Anyways here's my update code with a client plus the changes you  
> suggested.
> http://servicemix.396122.n5.nabble.com/file/n1842468/proto.proxy.zip
> proto.proxy.zip
>
>
> My error
> 11:15:00,315 | WARN  | cxf-se-thread-11 |  
> NMR                              |
> .servicemix.nmr.core.ChannelImpl  293 | Error processing exchange [
>  id:        4adc0d98-91d2-4a8d-9033-cdb8bb2e5dc4
>  mep:       InOut
>  status:    Active
>  role:      Consumer
>  target:
> PropertyMatchingReference[{SERVICE_NAME={http:// 
> proto.mycompany.com/}PersonService}]
>  operation: {http://proto.mycompany.com}GetPerson
>  properties: [
>      javax.jbi.messaging.MessageExchange =
> org.apache.servicemix.jbi.runtime.impl.InOutImpl@11be5be
>      javax.jbi.messaging.sendSync = true
>      javax.jbi.InterfaceName = {http://proto.mycompany.com}Person
>      javax.jbi.ServiceName = {http:// 
> proto.mycompany.com/}PersonService
>  ]
>  In: [
>    content: javax.xml.transform.stream.StreamSource@883936
>    properties: [
>      org.apache.cxf.message.Message.ENDPOINT_ADDRESS =
> jbi://ID-172-26-162-232-129fa8e75f7-6-0
>    ]
>  ]
> ]

Well, when you deploy each JBI endpoint, you should see the log about  
the SERVICE_NAME, ENDPOINT of the JBI endpoint, for the target-se, it's

10:05:26,205 | INFO  | xtenderThread-50 |  
ManagementEndpointRegistry       | ement.ManagementEndpointRegistry    
56 | Registering endpoint:  
org.apache.servicemix.nmr.core.InternalEndpointWrapper@6385ff32 with  
properties {jbi.internal=true, NAME={http:// 
proto.mycompany.com/}PersonelService:PersonServiceImplPort,  
WSDL_URL=document:4, service.id=269,  
objectClass=[Ljava.lang.String;@71303fed,  
ENDPOINT_NAME=PersonServiceImplPort, SERVICE_NAME={http://proto.mycompany.com/ 
}PersonelService}
10:05:26,223 | INFO  | xtenderThread-50 | ActiveMQMessageConsumer

so the SERVICE_NAME of target-se is {http:// 
proto.mycompany.com/}PersonelService


But also from the log, the message try to send to target-se with  
SERVICE_NAME {http://proto.mycompany.com/}PersonService

This mismatch cause the problem.
You need edit
./proto.proxy.target-se/src/main/java/com/mycompany/proto/ 
PersonServiceImpl.java

change the servicename from Person1Service to PersonService.


Freeman




>
> org.apache.servicemix.nmr.api.ServiceMixException: Could not dispatch
> exchange. No matching endpoints.
> 	at
> org 
> .apache 
> .servicemix.nmr.core.FlowRegistryImpl.dispatch(FlowRegistryImpl.java: 
> 110)
> 	at
> org.apache.servicemix.nmr.core.ChannelImpl.dispatch(ChannelImpl.java: 
> 286)
> 	at
> org.apache.servicemix.nmr.core.ChannelImpl.sendSync(ChannelImpl.java: 
> 141)
> 	at
> org.apache.servicemix.nmr.core.ChannelImpl.sendSync(ChannelImpl.java: 
> 127)
> 	at
> org 
> .apache 
> .servicemix 
> .jbi 
> .runtime.impl.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java: 
> 187)
> 	at
> org 
> .apache 
> .cxf 
> .transport 
> .jbi 
> .JBIConduitOutputStream 
> .commitOutputMessage(JBIConduitOutputStream.java:152)
> 	at
> org 
> .apache 
> .cxf 
> .transport 
> .jbi.JBIConduitOutputStream.doClose(JBIConduitOutputStream.java:81)
> 	at  
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java: 
> 185)
> 	at  
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java: 
> 66)
> 	at
> org.apache.cxf.interceptor.MessageSenderInterceptor 
> $ 
> MessageSenderEndingInterceptor 
> .handleMessage(MessageSenderInterceptor.java:62)
> 	at
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 243)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> 	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java: 
> 73)
> 	at  
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
> 124)
> 	at $Proxy116.getPerson(Unknown Source)
> 	at  
> com.mycompany.proto.proxy.HelloWorldImpl.sayHi(HelloWorldImpl.java:45)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org 
> .apache 
> .cxf 
> .service 
> .invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
> 	at
> org 
> .apache 
> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
> 	at
> org 
> .apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java: 
> 60)
> 	at
> org 
> .apache 
> .cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
> 	at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor 
> $1.run(ServiceInvokerInterceptor.java:58)
> 	at java.util.concurrent.Executors 
> $RunnableAdapter.call(Executors.java:441)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> 	at
> org 
> .apache 
> .cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java: 
> 37)
> 	at
> org 
> .apache 
> .cxf 
> .interceptor 
> .ServiceInvokerInterceptor 
> .handleMessage(ServiceInvokerInterceptor.java:106)
> 	at
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 243)
> 	at
> org 
> .apache 
> .cxf 
> .transport 
> .ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
> 	at
> org 
> .apache 
> .cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java: 
> 156)
> 	at
> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java: 
> 455)
> 	at
> org 
> .apache 
> .servicemix 
> .common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:617)
> 	at
> org 
> .apache 
> .servicemix 
> .common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java: 
> 571)
> 	at
> org 
> .apache 
> .servicemix 
> .common 
> .AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:468)
> 	at
> org.apache.servicemix.common.AsyncBaseLifeCycle 
> $2.run(AsyncBaseLifeCycle.java:347)
> 	at
> java.util.concurrent.ThreadPoolExecutor 
> $Worker.runTask(ThreadPoolExecutor.java:886)
> 	at
> java.util.concurrent.ThreadPoolExecutor 
> $Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)
>
>
> Thanks,
> Vinh
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1842468.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Hi, thank you for the tip I was able to deploy the proxy with that, but I
still can't get it to work.  I'm getting "No matching endpoint" when the
proxy is trying to talk to the target-se.  Also I found it weird that I had
to move the wsdl2java generated code for the my proxy to a different
package, in order for it start successfully.  It seem like you can't have
the same targetnamespace for two different services.  

Anyways here's my update code with a client plus the changes you suggested. 
http://servicemix.396122.n5.nabble.com/file/n1842468/proto.proxy.zip
proto.proxy.zip 


My error
11:15:00,315 | WARN  | cxf-se-thread-11 | NMR                              |
.servicemix.nmr.core.ChannelImpl  293 | Error processing exchange [
  id:        4adc0d98-91d2-4a8d-9033-cdb8bb2e5dc4
  mep:       InOut
  status:    Active
  role:      Consumer
  target:   
PropertyMatchingReference[{SERVICE_NAME={http://proto.mycompany.com/}PersonService}]
  operation: {http://proto.mycompany.com}GetPerson
  properties: [
      javax.jbi.messaging.MessageExchange =
org.apache.servicemix.jbi.runtime.impl.InOutImpl@11be5be
      javax.jbi.messaging.sendSync = true
      javax.jbi.InterfaceName = {http://proto.mycompany.com}Person
      javax.jbi.ServiceName = {http://proto.mycompany.com/}PersonService
  ]
  In: [
    content: javax.xml.transform.stream.StreamSource@883936
    properties: [
      org.apache.cxf.message.Message.ENDPOINT_ADDRESS =
jbi://ID-172-26-162-232-129fa8e75f7-6-0
    ]
  ]
]

org.apache.servicemix.nmr.api.ServiceMixException: Could not dispatch
exchange. No matching endpoints.
	at
org.apache.servicemix.nmr.core.FlowRegistryImpl.dispatch(FlowRegistryImpl.java:110)
	at
org.apache.servicemix.nmr.core.ChannelImpl.dispatch(ChannelImpl.java:286)
	at
org.apache.servicemix.nmr.core.ChannelImpl.sendSync(ChannelImpl.java:141)
	at
org.apache.servicemix.nmr.core.ChannelImpl.sendSync(ChannelImpl.java:127)
	at
org.apache.servicemix.jbi.runtime.impl.DeliveryChannelImpl.sendSync(DeliveryChannelImpl.java:187)
	at
org.apache.cxf.transport.jbi.JBIConduitOutputStream.commitOutputMessage(JBIConduitOutputStream.java:152)
	at
org.apache.cxf.transport.jbi.JBIConduitOutputStream.doClose(JBIConduitOutputStream.java:81)
	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:185)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
	at $Proxy116.getPerson(Unknown Source)
	at com.mycompany.proto.proxy.HelloWorldImpl.sayHi(HelloWorldImpl.java:45)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
	at
org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:60)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
	at
org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
	at
org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:455)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:617)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:571)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:468)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:347)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)


Thanks,
Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1842468.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

You need edit proto.proxy.se/pom.xml, add
          META-INF.cxf.transport.jbi,
          META-INF.cxf.binding.jbi,
         org.apache.cxf.transport.jbi,
         org.apache.cxf.binding.jbi,
into Import-Package.

Also, you need edit proto.proxy.se/src/main/resources/META-INF/spring/ 
beans.xml, add
<osgi:reference id="servicemix-cxf-se"
                     interface="javax.jbi.component.Component"
                     cardinality="1..1" filter="(NAME=servicemix-cxf- 
se)"/>
Ensure you add osgi namespace declaration already, like
xmlns:osgi="http://www.springframework.org/schema/osgi"
and
http://www.springframework.org/schema/osgi
   http://www.springframework.org/schema/osgi/spring-osgi.xsd
in xsi:schemaLocation.

Then you can deploy proto.proxy.se-0.0.1-SNAPSHOT.jar bundle  
successfully.


Freeman

On 2010-7-21, at 下午11:07, vinh wrote:

>
> Hi,
>
> Now it says that it can't find
> META-INF/cxf/transport/jbi/cxf-transport-jbi.xml
>
> I've have a test project you can run to see the error(
> http://servicemix.396122.n5.nabble.com/file/n1727567/proto.proxy.zip
> proto.proxy.zip ).
>
> Here's the stacktrace:
> 11:03:23,200 | ERROR | xtenderThread-51 |  
> ContextLoaderListener            |
> BundleApplicationContextListener   50 | Application context refresh  
> failed
> (OsgiBundleXmlApplicationContext(bundle=proto.proxy.se,
> config=osgibundle:/META-INF/spring/*.xml))
> org 
> .springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Failed to import bean definitions from URL  
> location
> [classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml]
> Offending resource: URL
> [bundleentry://181.fwk13671123/META-INF/spring/beans.xml]; nested  
> exception
> is org.springframework.beans.factory.BeanDefinitionStoreException:
> IOException parsing XML document from OSGi
> resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml| 
> bnd.id=181|bnd.sym=proto.proxy.se];
> nested exception is java.io.FileNotFoundException: OSGi
> resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml| 
> bnd.id=181|bnd.sym=proto.proxy.se]
> cannot be resolved to URL because it does not exist
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .parsing.FailFastProblemReporter.error(FailFastProblemReporter.java: 
> 68)
> 	at
> org 
> .springframework 
> .beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
> 	at
> org 
> .springframework 
> .beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .DefaultBeanDefinitionDocumentReader 
> .importBeanDefinitionResource 
> (DefaultBeanDefinitionDocumentReader.java:182)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .DefaultBeanDefinitionDocumentReader 
> .parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .DefaultBeanDefinitionDocumentReader 
> .parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .DefaultBeanDefinitionDocumentReader 
> .registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .support 
> .AbstractBeanDefinitionReader 
> .loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .support 
> .AbstractBeanDefinitionReader 
> .loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .support 
> .AbstractBeanDefinitionReader 
> .loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
> 	at
> org 
> .springframework 
> .osgi 
> .context 
> .support 
> .OsgiBundleXmlApplicationContext 
> .loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)
> 	at
> org 
> .springframework 
> .osgi 
> .context 
> .support 
> .OsgiBundleXmlApplicationContext 
> .loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
> 	at
> org 
> .springframework 
> .context 
> .support 
> .AbstractRefreshableApplicationContext 
> .refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
> 	at
> org 
> .springframework 
> .context 
> .support 
> .AbstractApplicationContext 
> .obtainFreshBeanFactory(AbstractApplicationContext.java:422)
> 	at
> org 
> .springframework 
> .osgi 
> .context.support.AbstractDelegatedExecutionApplicationContext.access 
> $800(AbstractDelegatedExecutionApplicationContext.java:69)
> 	at
> org 
> .springframework 
> .osgi.context.support.AbstractDelegatedExecutionApplicationContext 
> $3.run(AbstractDelegatedExecutionApplicationContext.java:269)
> 	at
> org 
> .springframework 
> .osgi 
> .util 
> .internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java: 
> 85)
> 	at
> org 
> .springframework 
> .osgi 
> .context 
> .support 
> .AbstractDelegatedExecutionApplicationContext 
> .startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
> 	at
> org 
> .springframework 
> .osgi 
> .extender 
> .internal 
> .dependencies 
> .startup 
> .DependencyWaiterApplicationContextExecutor 
> .stageOne(DependencyWaiterApplicationContextExecutor.java:222)
> 	at
> org 
> .springframework 
> .osgi 
> .extender 
> .internal 
> .dependencies 
> .startup 
> .DependencyWaiterApplicationContextExecutor 
> .refresh(DependencyWaiterApplicationContextExecutor.java:175)
> 	at
> org 
> .springframework 
> .osgi 
> .context 
> .support 
> .AbstractDelegatedExecutionApplicationContext 
> .refresh(AbstractDelegatedExecutionApplicationContext.java:175)
> 	at
> org 
> .springframework 
> .osgi.extender.internal.activator.ContextLoaderListener 
> $2.run(ContextLoaderListener.java:718)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by:  
> org.springframework.beans.factory.BeanDefinitionStoreException:
> IOException parsing XML document from OSGi
> resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml| 
> bnd.id=181|bnd.sym=proto.proxy.se];
> nested exception is java.io.FileNotFoundException: OSGi
> resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml| 
> bnd.id=181|bnd.sym=proto.proxy.se]
> cannot be resolved to URL because it does not exist
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .support 
> .AbstractBeanDefinitionReader 
> .loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .support 
> .AbstractBeanDefinitionReader 
> .loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .DefaultBeanDefinitionDocumentReader 
> .importBeanDefinitionResource 
> (DefaultBeanDefinitionDocumentReader.java:174)
> 	... 23 more
> Caused by: java.io.FileNotFoundException: OSGi
> resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml| 
> bnd.id=181|bnd.sym=proto.proxy.se]
> cannot be resolved to URL because it does not exist
> 	at
> org 
> .springframework 
> .osgi.io.OsgiBundleResource.getURL(OsgiBundleResource.java:228)
> 	at
> org 
> .springframework 
> .osgi.io.OsgiBundleResource.getInputStream(OsgiBundleResource.java: 
> 180)
> 	at
> org 
> .springframework 
> .beans 
> .factory 
> .xml 
> .XmlBeanDefinitionReader 
> .loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
> 	... 27 more
>
>
> Thanks,
> Vinh
>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1727567.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Hi,

Now it says that it can't find
META-INF/cxf/transport/jbi/cxf-transport-jbi.xml

I've have a test project you can run to see the error( 
http://servicemix.396122.n5.nabble.com/file/n1727567/proto.proxy.zip
proto.proxy.zip ).   

Here's the stacktrace:
11:03:23,200 | ERROR | xtenderThread-51 | ContextLoaderListener            |
BundleApplicationContextListener   50 | Application context refresh failed
(OsgiBundleXmlApplicationContext(bundle=proto.proxy.se,
config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Failed to import bean definitions from URL location
[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml]
Offending resource: URL
[bundleentry://181.fwk13671123/META-INF/spring/beans.xml]; nested exception
is org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from OSGi
resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml|bnd.id=181|bnd.sym=proto.proxy.se];
nested exception is java.io.FileNotFoundException: OSGi
resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml|bnd.id=181|bnd.sym=proto.proxy.se]
cannot be resolved to URL because it does not exist
	at
org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
	at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
	at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:182)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	at
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)
	at
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
	at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
	at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
	at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
	at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)
	at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
	at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
	at
org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from OSGi
resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml|bnd.id=181|bnd.sym=proto.proxy.se];
nested exception is java.io.FileNotFoundException: OSGi
resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml|bnd.id=181|bnd.sym=proto.proxy.se]
cannot be resolved to URL because it does not exist
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:174)
	... 23 more
Caused by: java.io.FileNotFoundException: OSGi
resource[classpath:META-INF/cxf/transport/jbi/cxf-transport-jbi.xml|bnd.id=181|bnd.sym=proto.proxy.se]
cannot be resolved to URL because it does not exist
	at
org.springframework.osgi.io.OsgiBundleResource.getURL(OsgiBundleResource.java:228)
	at
org.springframework.osgi.io.OsgiBundleResource.getInputStream(OsgiBundleResource.java:180)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
	... 27 more


Thanks,
Vinh

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1727567.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Add
<import resource="classpath:META-INF/cxf/transport/jbi/cxf-transport- 
jbi.xml" />

Also, the xsi:schemaLocation part should be

xsi:schemaLocation="
                 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                 http://servicemix.apache.org/cxfse/1.0 http://servicemix.apache.org/cxfse/1.0/servicemix-cxf-se.xsd 
"

Btw, could you post whole log including the exception when you still  
see the problem?
Probably append a testcase (I can modify,build and deploy) which can  
reproduce this problem?
Freeman
On 2010-7-21, at 上午1:26, vinh wrote:

>
> No I didn't import it in my beans.xml
>
> Here's the contents of my beans.xml:
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
> xmlns:hello="http://proto.mycompany.com/"
> 	xmlns:person="http://www.abc.com"
> 	xsi:schemaLocation="
>                http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>                http://servicemix.apache.org/cxfse/1.0
> http://servicemix.apache.org/schema/servicemix-cxf-se-2009.01.xsd">
>
> 	<cxfse:endpoint>
> 		<cxfse:pojo>
> 			<bean class="com.mycompany.proto.nmr.HelloWorldImpl">
> 				<property name="person">
> 					<cxfse:proxy service="person:PersonService"  
> type="com.abc.Person"/>
> 				</property>
> 			</bean>
> 		</cxfse:pojo>
> 	</cxfse:endpoint>
>
> 	<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
>
>
> </beans>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1628923.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
No I didn't import it in my beans.xml 

Here's the contents of my beans.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
xmlns:hello="http://proto.mycompany.com/"
	xmlns:person="http://www.abc.com"
	xsi:schemaLocation="
                http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
                http://servicemix.apache.org/cxfse/1.0
http://servicemix.apache.org/schema/servicemix-cxf-se-2009.01.xsd">

	<cxfse:endpoint>
		<cxfse:pojo>
			<bean class="com.mycompany.proto.nmr.HelloWorldImpl">
				<property name="person">
					<cxfse:proxy service="person:PersonService" type="com.abc.Person"/>
				</property>
			</bean>
		</cxfse:pojo>
	</cxfse:endpoint>

	<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />


</beans>
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1628923.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Do you explicitly import META-INF/cxf/transport/jbi/cxf-transport- 
jbi.xml in your beans.xml?
If so, could you post it here?

Freeman

On 2010-7-20, at 下午9:41, vinh wrote:

>
> Yes I have Apache CXF Runtime JBI Transport bundle install and  
> active.  I'm
> running SMX-4.2.0-fuse-02-00 btw.
>
> Vinh
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1618583.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Yes I have Apache CXF Runtime JBI Transport bundle install and active.  I'm
running SMX-4.2.0-fuse-02-00 btw.

Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1618583.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Could you check if "Apache CXF Runtime JBI Transport" bundle get  
installed and started correctly?

Freeman
On 2010-7-20, at 下午12:20, vinh wrote:

>
> Hi, I've tried it with and without META-INF.cxf, but I still get the  
> same
> error.
>
> Vinh
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1569440.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Hi, I've tried it with and without META-INF.cxf, but I still get the same
error. 

Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1569440.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

My comment inline.
On 2010-7-20, at 上午3:19, vinh wrote:

>
> Ok I've tried to implement the proxy like how the
> http://servicemix.apache.org/servicemix-cxf-se.html page described  
> it.  But
> I keep running into a wall.  I'm getting this now: "Failed to load
> configuration META-INF/cxf/transport/jbi/cxf-transport-jbi.xml"  It  
> seem
> like someone else had some similar problems that I'm having right  
> now on
> this thread "Invoking external web service from SE".  Implementing  
> clues
> from that thread, I'm still lost.
>
> Here's my bundle config for the proxy
>  <plugin>
> 	<groupId>org.apache.felix</groupId>
> 	<artifactId>maven-bundle-plugin</artifactId>
> 	<extensions>true</extensions>
> 	<configuration>
> 	  <instructions>
>  		  <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> 			<Import-Package>
You should also add META-INF.cxf, for Import-Package.

Freeman
> 			*,
> 			javax.jws,
> 			javax.wsdl,
> 			javax.xml.bind,
> 			javax.xml.bind.annotation,
> 			javax.xml.namespace,
> 			javax.xml.soap,
> 			javax.xml.ws,
> 			org.apache.cxf.bus,
> 			org.apache.cxf.bus.spring,
> 			org.apache.cxf.bus.resource,
> 			org.apache.cxf.configuration.spring,
> 			org.apache.cxf.resource,
> 			org.apache.servicemix.cxfse,
> 			org.springframework.beans.factory.config,
> 			org.apache.servicemix.common.osgi
> 		</Import-Package>
> 	       <Private-Package>com.mycompany.proto.nmr</Private-Package>
> 	       <Require-Bundle>org.apache.cxf.bundle</Require-Bundle>
>            </instructions>
>        </configuration>
>    </plugin>
>
> my beans conf:
>  <cxfse:endpoint>
>    <cxfse:pojo>
> 	<bean class="com.mycompany.proto.nmr.HelloWorldImpl">
>   	  <property name="person">
> 	     <cxfse:proxy service="person:PersonService"  
> type="com.abc.Person"/>
> 	  </property>
> 	</bean>
>     </cxfse:pojo>
>   </cxfse:endpoint>
>
>  <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
>
> Thanks,
> Vinh
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1459463.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Ok I've tried to implement the proxy like how the
http://servicemix.apache.org/servicemix-cxf-se.html page described it.  But
I keep running into a wall.  I'm getting this now: "Failed to load
configuration META-INF/cxf/transport/jbi/cxf-transport-jbi.xml"  It seem
like someone else had some similar problems that I'm having right now on
this thread "Invoking external web service from SE".  Implementing clues
from that thread, I'm still lost. 

Here's my bundle config for the proxy
  <plugin>
	<groupId>org.apache.felix</groupId>
	<artifactId>maven-bundle-plugin</artifactId>
	<extensions>true</extensions>
	<configuration>
	  <instructions>
  		  <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
			<Import-Package>
			*,
			javax.jws,
			javax.wsdl,
			javax.xml.bind,
			javax.xml.bind.annotation,
			javax.xml.namespace,
			javax.xml.soap,
			javax.xml.ws,
			org.apache.cxf.bus,
			org.apache.cxf.bus.spring,
			org.apache.cxf.bus.resource,
			org.apache.cxf.configuration.spring,
			org.apache.cxf.resource,
			org.apache.servicemix.cxfse,
			org.springframework.beans.factory.config,
			org.apache.servicemix.common.osgi
		</Import-Package>
	       <Private-Package>com.mycompany.proto.nmr</Private-Package>
	       <Require-Bundle>org.apache.cxf.bundle</Require-Bundle>
            </instructions>
        </configuration>
    </plugin>

my beans conf:
  <cxfse:endpoint>
    <cxfse:pojo>
	<bean class="com.mycompany.proto.nmr.HelloWorldImpl">
   	  <property name="person">
	     <cxfse:proxy service="person:PersonService" type="com.abc.Person"/>
	  </property>
	</bean>
     </cxfse:pojo>
   </cxfse:endpoint>

  <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />

Thanks,
Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1459463.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

If another service exposed on the nmr is cxf se endpoint or cxf bc  
provider endpoint, then you can use cxf se proxy to do so, which means  
you can inject proxy of another service into your cxf se endpoint, and  
invoke the service through proxy(just like normal java method  
invocation,  you needn't do the marshall/unmarshall yourself) from  
your cxf se endpoint.

Take a look at [1], the "Proxies" part to get more details.

[1]http://servicemix.apache.org/servicemix-cxf-se.html

Freeman
On 2010-7-18, at 下午12:08, vinh wrote:

>
> Thanks, I got it work with the springsource.  But could I ask you  
> another
> question since you seemed to be the most knowledgeable about smx.  I  
> have
> now a cxfse that could can talk to another service exposed on the nmr.
> However i have to construct and destruct the soap msg for request and
> response respectively for the nmr service.  Is there some api or  
> framework
> that can take an object and marshal it to a soap msg and unmarshal  
> it back
> to an object, like cxf?  I've tried to use the code gets generated  
> be the
> cxf wsdl2java client code in my cxfse but it doesn't seem to work.   
> I was
> getting "no conduit initiator was found for the namespace
> http://schemas.xmlsoap.org/soap/http"
>
> Thanks,
> Vinh
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1408436.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: How to send a request to a nmr service?

Posted by vinh <vi...@faa.gov>.
Thanks, I got it work with the springsource.  But could I ask you another
question since you seemed to be the most knowledgeable about smx.  I have
now a cxfse that could can talk to another service exposed on the nmr. 
However i have to construct and destruct the soap msg for request and
response respectively for the nmr service.  Is there some api or framework
that can take an object and marshal it to a soap msg and unmarshal it back
to an object, like cxf?  I've tried to use the code gets generated be the
cxf wsdl2java client code in my cxfse but it doesn't seem to work.  I was
getting "no conduit initiator was found for the namespace
http://schemas.xmlsoap.org/soap/http"

Thanks,
Vinh
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1408436.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: How to send a request to a nmr service?

Posted by Freeman Fang <fr...@gmail.com>.
On 2010-7-14, at 下午11:26, vinh wrote:

>
> I was wondering if there was an easy way to send a message from a  
> service on
> the nmr to another service.  Something like the interaction between  
> a cxfbc
> and a cxfse.   I've been able to expose a service on the nmr by  
> following
> the cxf-nmr example and I was trying to use client part of the nmr  
> example
> to talk to my exposed service, but it doesn't want to work.  Is  
> there a way
> to send a message to the another service without having to write an
> onMessage method? I wanted to have internal services that can be  
> used be
> other services.
> I'm currently getting this exception:
> javax.xml.transform.TransformerException:
> javax.xml.transform.TransformerException: Source object passed to  
> ''{0}''
> has no contents.
> 	at
Hi,

This exception means expect a Source object but the incoming is not  
Source.
You may need change the message body in nmr/client from String to  
StringSource.

Also you may need take a look at cxf-camel-nmr example to see how nmr  
endpoint could be invoked.
Freeman

> com 
> .sun 
> .org 
> .apache 
> .xalan 
> .internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java: 
> 719)
> 	at
> com 
> .sun 
> .org 
> .apache 
> .xalan 
> .internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java: 
> 313)
> 	at
> org 
> .apache 
> .servicemix 
> .cxf 
> .transport 
> .nmr 
> .NMRMessageHelper.convertMessageToInputStream(NMRMessageHelper.java: 
> 51)
> 	at
> org 
> .apache 
> .servicemix 
> .cxf.transport.nmr.NMRDestination.process(NMRDestination.java:127)
> 	at
> org 
> .apache 
> .servicemix 
> .nmr 
> .core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86)
> 	at  
> org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java: 
> 255)
> 	at org.apache.servicemix.nmr.core.ChannelImpl 
> $1.run(ChannelImpl.java:215)
> 	at
> java.util.concurrent.ThreadPoolExecutor 
> $Worker.runTask(ThreadPoolExecutor.java:886)
> 	at
> java.util.concurrent.ThreadPoolExecutor 
> $Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.xml.transform.TransformerException: Source object  
> passed to
> ''{0}'' has no contents.
> 	at
> com 
> .sun 
> .org 
> .apache 
> .xalan 
> .internal 
> .xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java: 
> 667)
> 	at
> com 
> .sun 
> .org 
> .apache 
> .xalan 
> .internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java: 
> 707)
> 	... 9 more
>
> Thanks
> Vinh
>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/How-to-send-a-request-to-a-nmr-service-tp1092879p1092879.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org