camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Freeman Fang <freeman.f...@gmail.com>
Subject Re: Getting NullPointerException when talking to NMR Endpoint
Date Thu, 29 Apr 2010 14:46:33 GMT
Hi,

My comment inlien
On 2010-4-29, at 下午6:25, Harbeer Kadian wrote:

>
> Hi,
>
> I am using following version of servicemix
> FUSE ESB v. 4.2.0
>
> Also I am giving more description of what I did.
> I have a cxf webservice exposed as nmr endpoint using following
> configuration.
> jaxws:endpoint id="PersonEndPointWebService"
>                    implementor="#PersonEndPoint"
>                    address="nmr:Persons"/>
>
> And my another bundle contains a route
> from("direct:Initiator")
> .to("nmr:Persons");
>
> Also I went through following content given on this webpage.
> It tells that you have to use a certain format while defining any nmr
> endpoint on a weservice annotated class.
> nmr:endpoint:serviceNamespace[sep]serviceName[sep]endpointName
>
> Do I also need to add all this information in my spring beans file.
No, you needn't,  use nmr: endpointName only should be ok in your case.

And the NPE you encounter is caused by can't get NMR service from OSGi  
Service Registry.
Could you use osgi:list to see if "Apache ServiceMix NMR OSGi" start  
correctly?
It should be something like
[  54] [Active     ] [Created     ] [       ] [   60] Apache  
ServiceMix NMR OSGi (1.2.0.fuse-01-00)

Also, you can use osgi:ls to see the OSGi services provided by "Apache  
ServiceMix NMR OSGi"bundle.
There should be something like
Apache ServiceMix NMR OSGi (54) provides:
-----------------------------------------
org.apache.servicemix.nmr.api.security.AuthorizationEntry
org.apache.servicemix.nmr.api.NMR
...

If the bundle not start correctly or the  
org.apache.servicemix.nmr.api.NMR service missing, you need check your  
log the see if there's any exception.

Btw, you also need ensure camel-nmr and cxf-nmr features get installed  
before you run your testcase.
You can use "features:list" to get status of those feature and use  
"features:install" to install them if they are not installed  yet.

Freeman
>
> With Regards
> Harbeer Kadian
>
>
>
> Freeman Fang wrote:
>>
>> Hi,
>>
>> Please tell me the exact smx 4 version you are using, I checked  
>> apache
>> servicemix 4.0 code, but ServiceMixProducer.java:44 won't throw NPE.
>>
>> Thanks
>>
>> Freeman
>> On 2010-4-28, at 下午5:18, Harbeer Kadian wrote:
>>
>>>
>>> HI,
>>>
>>> The CXF Bundle is deployed properly.
>>> I had these lines in the log files.
>>>
>>> Creating Service {http://
>>> impl.ws.esb.com/}PersonEndPointImplImplService from
>>> class com.esb.ws.impl.PersonEndPointImpl
>>> ServerImpl                       |
>>> g.apache.cxf.endpoint.ServerImpl   91 |
>>> Setting the server's publish address to be nmr:Persons
>>>
>>> Also I did not received any exception when starting the CXF Bundle.
>>>
>>> With Regards
>>> Harbeer Kadian
>>>
>>>
>>>
>>> willem.jiang wrote:
>>>>
>>>> Can you make sure the cxf bundle is started rightly before the  
>>>> camel
>>>> route bundle?
>>>> For the stack trace , I think the CXF endpoint is not start  
>>>> rightly.
>>>>
>>>> Willem
>>>>
>>>> Harbeer Kadian wrote:
>>>>> Hi,
>>>>>
>>>>> I checked the example given in servicemix 4.0 CXF-Camel NMR.
>>>>> I tried to follow the example.
>>>>>
>>>>> I created a CXF Stack webservice and deployed it as an OSGI Bundle
>>>>> in the
>>>>> servicemix.
>>>>> I used the nmr endpoint instead of hosting it on http port.
>>>>> My spring config file is as follows
>>>>> <jaxws:endpoint id="PersonEndPointWebService"
>>>>>                   implementor="#PersonEndPoint"
>>>>>                   address="nmr:Persons"/>
>>>>>
>>>>> I had another bundle which has following route inside it.
>>>>> from("direct:NMR")
>>>>>       .to("nmr:Persons");
>>>>>
>>>>> I sent a soap envelope message on the Direct EndPoint.
>>>>> The problem here is that the message is not reaching to the NMR
>>>>> Endpoint.
>>>>> It is giving following exception.
>>>>> java.lang.NullPointerException
>>>>> 	at
>>>>> org
>>>>> .apache
>>>>> .servicemix
>>>>> .camel.nmr.ServiceMixProducer.process(ServiceMixProducer.java:44)
>>>>> 	at
>>>>> org.apache.camel.processor.SendProcessor
>>>>> $1.doInProducer(SendProcessor.java:97)
>>>>> 	at
>>>>> org.apache.camel.processor.SendProcessor
>>>>> $1.doInProducer(SendProcessor.java:95)
>>>>>
>>>>> The surprising thing here is that the example provided with the
>>>>> servicemix
>>>>> 4.0 CXF-Camel NMR is working fine. The only change I observed is
>>>>> that the
>>>>> example is keeping all the things in the same bundle whereas in my
>>>>> case
>>>>> the
>>>>> NMR endpoint and the router are in different bundles.
>>>>>
>>>>> Please help.
>>>>>
>>>>> With Regards
>>>>> Harbeer Kadian
>>>>
>>>>
>>>>
>>>
>>> -- 
>>> View this message in context:
>>> http://old.nabble.com/Getting-NullPointerException-when-talking-to-NMR-Endpoint-tp28376375p28386474.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>>
>> -- 
>> Freeman Fang
>> ------------------------
>> Open Source SOA: http://fusesource.com
>>
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/Getting-NullPointerException-when-talking-to-NMR-Endpoint-tp28376375p28398836.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message