Getting NullPointerException when talking to NMR Endpoint
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 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-tp28376375p28376375.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Getting NullPointerException when talking to NMR Endpoint
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 >> > 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.
Re: Getting NullPointerException when talking to NMR Endpoint
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. 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 >>>> >>>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.
Getting error when using Apache camel inside servicemix.
8) at org.apache.camel.component.file.FileProducer.process(FileProducer.jav a:61) at com.webservice.calculator.CalculatorPortTypeImpl.sendToCamelFile(Calc ulatorPortTypeImpl.java:129) ... 31 more Please help if i am missing some thing. With Regards Harbeer Kadian -- View this message in context: http://old.nabble.com/Getting-error-when-using-Apache-camel-inside-servicemix.-tp26635824p26635824.html Sent from the Camel - Users mailing list archive at Nabble.com.
NoSuchEndpointException: getting exception when talking to http endpoint using camel
Hi, I created a new camel router to send a message to a webservice using camel-http component. The configure method of the router is as follows. public void configure() throws Exception { from("direct:ProducerUri") .to("http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager";); } The wsdl for the webservice is located at following url http://localhost:8083/ConnectPlatform?wsdl The servicemix gave exception when i tried to add this router to the camel context. org.apache.camel.NoSuchEndpointException: No endpoint could be found for: http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager, please check your classpath contains the needed camel component jar. at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) I added the camel-http component in my pom.xml org.apache.camel camel-http 1.6.2.0-fuse I also added the following packages in the OSGI Import-Package header org.apache.camel.component.http org.apache.camel.component.http.helper Still i am getting the same exception. Also when i perform command osgi/list on servicemix I found that the camel-http component is not in the Started stage. [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) Please tell if i am missing some thing required to talk to a Http Component. With Regards Harbeer Kadian -- View this message in context: http://old.nabble.com/NoSuchEndpointException%3A-getting-exception-when-talking-to-http-endpoint-using-camel-tp27026841p27026841.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: NoSuchEndpointException: getting exception when talking to http endpoint using camel
I created the camel context in following way JndiContext jndiContext = new JndiContext(); CamelContext camelContext = new DefaultCamelContext(jndiContext); I have used jndiContext because i have to bind some bean components. Ex: jndiContext.bind("endPoint", new EndPointImpl()); One more question for you. Do you know any book or any good website which comprehensively explains how to work with apache camel. With Regards Harbeer Kadian Harbeer Kadian wrote: > > Hi, > > I created a new camel router to send a message to a webservice using > camel-http component. > The configure method of the router is as follows. > public void configure() throws Exception { > from("direct:ProducerUri") > > .to("http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager";); > } > The wsdl for the webservice is located at following url > http://localhost:8083/ConnectPlatform?wsdl > > The servicemix gave exception when i tried to add this router to the camel > context. > > org.apache.camel.NoSuchEndpointException: No endpoint could be found for: > http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager, > please check your classpath contains the needed camel component jar. > at > org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) > > I added the camel-http component in my pom.xml > > org.apache.camel > camel-http > 1.6.2.0-fuse > > > I also added the following packages in the OSGI Import-Package header > org.apache.camel.component.http > org.apache.camel.component.http.helper > > Still i am getting the same exception. > > Also when i perform command osgi/list on servicemix > I found that the camel-http component is not in the Started stage. > [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) > > Please tell if i am missing some thing required to talk to a Http > Component. > > With Regards > Harbeer Kadian > -- View this message in context: http://old.nabble.com/NoSuchEndpointException%3A-getting-exception-when-talking-to-http-endpoint-using-camel-tp27026841p27055346.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: NoSuchEndpointException: getting exception when talking to http endpoint using camel
Hi, Thanks for your reply. But my problem in not regarding CamelContextFactory. When I am using a http endpoint to communicate with a web service, the servicemix is failing to find the correct jar in the classpath to create a http endpoint. Please tell what are the prerequisites for using a http endpoint. With Regards Harbeer kadian willem.jiang wrote: > > After you create the CamelContext with CamelContextFactory, you can set > the JndiContext with these codes > > CompositeRegistry compositeRegistry = new CompositeRegistry(); > compositeRegistry.addRegistry(new JndiRegistry(jndiContext)); > compositeRegistry.addRegistry(context.getRegistry()); > camelContext.setRegistry(compositeRegistry); > > You can take a look at the Camel In Action[1] > [1] http://www.manning.com/ibsen/ > > Willem > > > Harbeer Kadian wrote: >> I created the camel context in following way >> >> JndiContext jndiContext = new JndiContext(); >> CamelContext camelContext = new DefaultCamelContext(jndiContext); >> >> I have used jndiContext because i have to bind some bean components. >> Ex: >> jndiContext.bind("endPoint", new EndPointImpl()); >> >> One more question for you. >> Do you know any book or any good website which comprehensively explains >> how >> to work with apache camel. >> >> With Regards >> Harbeer Kadian >> >> >> >> >> Harbeer Kadian wrote: >>> Hi, >>> >>> I created a new camel router to send a message to a webservice using >>> camel-http component. >>> The configure method of the router is as follows. >>> public void configure() throws Exception { >>> from("direct:ProducerUri") >>> >>> .to("http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager";); >>> } >>> The wsdl for the webservice is located at following url >>> http://localhost:8083/ConnectPlatform?wsdl >>> >>> The servicemix gave exception when i tried to add this router to the >>> camel >>> context. >>> >>> org.apache.camel.NoSuchEndpointException: No endpoint could be found >>> for: >>> http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager, >>> please check your classpath contains the needed camel component jar. >>> at >>> org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) >>> at >>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) >>> at >>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) >>> at >>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) >>> >>> I added the camel-http component in my pom.xml >>> >>> org.apache.camel >>> camel-http >>> 1.6.2.0-fuse >>> >>> >>> I also added the following packages in the OSGI Import-Package header >>> org.apache.camel.component.http >>> org.apache.camel.component.http.helper >>> >>> Still i am getting the same exception. >>> >>> Also when i perform command osgi/list on servicemix >>> I found that the camel-http component is not in the Started stage. >>> [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) >>> >>> Please tell if i am missing some thing required to talk to a Http >>> Component. >>> >>> With Regards >>> Harbeer Kadian >>> >> > > > -- View this message in context: http://old.nabble.com/NoSuchEndpointException%3A-getting-exception-when-talking-to-http-endpoint-using-camel-tp27026841p27059989.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: NoSuchEndpointException: getting exception when talking to http endpoint using camel
Hi, I changed the creation of CamelContext as per your suggestions. I am getting following exception now. org.springframework.beans.factory.BeanCreationException: Error creating bean with name ConnectPlatform' defined in URL [bundle://186.0:0/META-INF/spring/bundle-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.altair.hwec.connectplatform.ConnectPlatformImpl]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/camel/osgi/CompositeRegistry I checked what all the camel jars are active in servicemix as of now Here are the details s...@root:/> osgi/list | grep camel [ 66] [Active ] [ ] [ 60] camel-core (1.6.1.fuse) [ 67] [Active ] [ ] [ 60] camel-osgi (1.6.1.fuse) [ 68] [Active ] [ ] [ 60] camel-spring (1.6.1.fuse) [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) With Regards Harbeer Kadian Harbeer Kadian wrote: > > Hi, > > I created a new camel router to send a message to a webservice using > camel-http component. > The configure method of the router is as follows. > public void configure() throws Exception { > from("direct:ProducerUri") > > .to("http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager";); > } > The wsdl for the webservice is located at following url > http://localhost:8083/ConnectPlatform?wsdl > > The servicemix gave exception when i tried to add this router to the camel > context. > > org.apache.camel.NoSuchEndpointException: No endpoint could be found for: > http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager, > please check your classpath contains the needed camel component jar. > at > org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) > > I added the camel-http component in my pom.xml > > org.apache.camel > camel-http > 1.6.2.0-fuse > > > I also added the following packages in the OSGI Import-Package header > org.apache.camel.component.http > org.apache.camel.component.http.helper > > Still i am getting the same exception. > > Also when i perform command osgi/list on servicemix > I found that the camel-http component is not in the Started stage. > [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) > > Please tell if i am missing some thing required to talk to a Http > Component. > > With Regards > Harbeer Kadian > -- View this message in context: http://old.nabble.com/NoSuchEndpointException%3A-getting-exception-when-talking-to-http-endpoint-using-camel-tp27026841p27061168.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: NoSuchEndpointException: getting exception when talking to http endpoint using camel
Hi, I checked the respective jar(camel-osgi) in cache folder. To my surprise, the CompositeRegistry class is not present there. Is it like I am using old version of camel-osgi feature. With Regards Harbeer Kadian Harbeer Kadian wrote: > > Hi, > > I changed the creation of CamelContext as per your suggestions. > I am getting following exception now. > > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name ConnectPlatform' defined in URL > [bundle://186.0:0/META-INF/spring/bundle-context.xml]: > Instantiation of bean failed; nested exception is > org.springframework.beans.BeanInstantiationException: Could not > instantiate bean class > [com.altair.hwec.connectplatform.ConnectPlatformImpl]: Constructor threw > exception; > nested exception is java.lang.NoClassDefFoundError: > org/apache/camel/osgi/CompositeRegistry > > I checked what all the camel jars are active in servicemix as of now > Here are the details > > s...@root:/> osgi/list | grep camel > [ 66] [Active ] [ ] [ 60] camel-core (1.6.1.fuse) > [ 67] [Active ] [ ] [ 60] camel-osgi (1.6.1.fuse) > [ 68] [Active ] [ ] [ 60] camel-spring (1.6.1.fuse) > [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) > > With Regards > Harbeer Kadian > > > > Harbeer Kadian wrote: >> >> Hi, >> >> I created a new camel router to send a message to a webservice using >> camel-http component. >> The configure method of the router is as follows. >> public void configure() throws Exception { >> from("direct:ProducerUri") >> >> .to("http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager";); >> } >> The wsdl for the webservice is located at following url >> http://localhost:8083/ConnectPlatform?wsdl >> >> The servicemix gave exception when i tried to add this router to the >> camel context. >> >> org.apache.camel.NoSuchEndpointException: No endpoint could be found for: >> http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager, >> please check your classpath contains the needed camel component jar. >> at >> org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) >> at >> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) >> at >> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) >> at >> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) >> >> I added the camel-http component in my pom.xml >> >> org.apache.camel >> camel-http >> 1.6.2.0-fuse >> >> >> I also added the following packages in the OSGI Import-Package header >> org.apache.camel.component.http >> org.apache.camel.component.http.helper >> >> Still i am getting the same exception. >> >> Also when i perform command osgi/list on servicemix >> I found that the camel-http component is not in the Started stage. >> [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) >> >> Please tell if i am missing some thing required to talk to a Http >> Component. >> >> With Regards >> Harbeer Kadian >> > > -- View this message in context: http://old.nabble.com/NoSuchEndpointException%3A-getting-exception-when-talking-to-http-endpoint-using-camel-tp27026841p27061333.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: NoSuchEndpointException: getting exception when talking to http endpoint using camel
Hi, I did as per your suggestion. Here is the piece of code private CamelContext camelContext; private CamelContextFactory camelContextFactory; camelContextFactory = new CamelContextFactory(); camelContext = camelContextFactory.createContext(); ((DefaultCamelContext)camelContext).setRegistry(new JndiRegistry(jndiContext)); but still i am getting the same exception. Constructor threw exception; nested exception is org.apache.camel.NoSuchEndpointException: No endpoint could be found for: http://localhost:8095/HelloWebService/services/Hello, please check your classpath contains the needed camel component jar. at org.springframework.beans.factory.support.ConstructorResolver.autowir eConstructor(ConstructorResolver.java:254) I am once again giving a detail description of my problem. My route is as follows from("direct:ProducerUri") .to("http://localhost:8095/HelloWebService/services/Hello";); I am creating the required soap message as follows String soapMessage = "http://schemas.xmlsoap.org/soap/envelope/\";>http://cxf.ws.studies.xh.org/\";>http://cxf.ws.studies.xh.org/\";>" + "Harbeer Kadian" + ""; // Camel will convert string to Document object for me exchange.getIn().setBody(soapMessage, Document.class); exchange.setPattern(ExchangePattern.InOut); exchange = producerTemplate.send("direct:ProducerUri", exchange); I am using an OSGI bundle to deploy this code in servicemix. Other than this I am not providing any information particular to http endpoint in my code or any of the configuration file bundle-context.xml bundle-context-osgi.xml Looks like all the problems are happening because of the OSGI bundle. Please tell if you have any idea about this problem. With Regards Harbeer kadian willem.jiang wrote: > > Sorry, I just realized you are using Camel 1.6.1-fuse > > You can try to use Camel 1.6.2.1-fuse or use this code. > camelContext.setRegistry(new JndiRegistry(jndiContext)); > > Willem > > Harbeer Kadian wrote: >> Hi, >> >> I checked the respective jar(camel-osgi) in cache folder. >> To my surprise, the CompositeRegistry class is not present there. >> Is it like I am using old version of camel-osgi feature. >> >> With Regards >> Harbeer Kadian >> >> >> >> Harbeer Kadian wrote: >>> Hi, >>> >>> I changed the creation of CamelContext as per your suggestions. >>> I am getting following exception now. >>> >>> org.springframework.beans.factory.BeanCreationException: Error creating >>> bean with name ConnectPlatform' defined in URL >>> [bundle://186.0:0/META-INF/spring/bundle-context.xml]: >>> Instantiation of bean failed; nested exception is >>> org.springframework.beans.BeanInstantiationException: Could not >>> instantiate bean class >>> [com.altair.hwec.connectplatform.ConnectPlatformImpl]: Constructor threw >>> exception; >>> nested exception is java.lang.NoClassDefFoundError: >>> org/apache/camel/osgi/CompositeRegistry >>> >>> I checked what all the camel jars are active in servicemix as of now >>> Here are the details >>> >>> s...@root:/> osgi/list | grep camel >>> [ 66] [Active ] [ ] [ 60] camel-core (1.6.1.fuse) >>> [ 67] [Active ] [ ] [ 60] camel-osgi (1.6.1.fuse) >>> [ 68] [Active ] [ ] [ 60] camel-spring (1.6.1.fuse) >>> [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) >>> >>> With Regards >>> Harbeer Kadian >>> >>> >>> >>> Harbeer Kadian wrote: >>>> Hi, >>>> >>>> I created a new camel router to send a message to a webservice using >>>> camel-http component. >>>> The configure method of the router is as follows. >>>> public void configure() throws Exception { >>>> from("direct:ProducerUri") >>>> >>>> .to("http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager";); >>>> } >>>> The wsdl for the webservice is located at following url >>>> http://localhost:8083/ConnectPlatform?wsdl >>>> >>>> The servicemix gave exception when i tried to add this router to the >>>> camel context. >>>> >>>> org.apache.camel.NoSuchEndpointException: No endpoint could be found >>>> for: >>>> http://localhost:8083/ConnectPlatform?supportedEndPointsRequest=DataManager, >>>> please check your classpath contains the needed camel com
Re: NoSuchEndpointException: getting exception when talking to http endpoint using camel
Hi, I have got the solution for problem. We have to add a component of type http in camelContext. Then only the camelContext is able to understand a http uri. camelContext.addComponent("http", new HttpComponent()); The String name can be any valid string. I dont know, whether it is osgi which is forcing us to add explicitly HttpComponent to talk to a http endpoint, or this is the camel way of sending messages to endpoints. Thanks for the valuable suggestions added to understand the problem. With Regads Harbeer kadian Harbeer Kadian wrote: > > Hi, > > I did as per your suggestion. > Here is the piece of code > > private CamelContext camelContext; > private CamelContextFactory camelContextFactory; > > camelContextFactory = new CamelContextFactory(); > camelContext = camelContextFactory.createContext(); > ((DefaultCamelContext)camelContext).setRegistry(new > JndiRegistry(jndiContext)); > > but still i am getting the same exception. > Constructor threw exception; nested exception is > org.apache.camel.NoSuchEndpointException: > No endpoint could be found for: > http://localhost:8095/HelloWebService/services/Hello, > please check your classpath contains the needed camel component jar. > at > org.springframework.beans.factory.support.ConstructorResolver.autowir > eConstructor(ConstructorResolver.java:254) > > I am once again giving a detail description of my problem. > My route is as follows > from("direct:ProducerUri") > .to("http://localhost:8095/HelloWebService/services/Hello";); > > I am creating the required soap message as follows > > String soapMessage = " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\";> xmlns:ns1=\"http://cxf.ws.studies.xh.org/\";> xmlns:ns2=\"http://cxf.ws.studies.xh.org/\";>" > + "Harbeer Kadian" + > ""; > > // Camel will convert string to Document object for me > exchange.getIn().setBody(soapMessage, Document.class); > exchange.setPattern(ExchangePattern.InOut); > exchange = producerTemplate.send("direct:ProducerUri", exchange); > > I am using an OSGI bundle to deploy this code in servicemix. > Other than this I am not providing any information particular to http > endpoint in my code or any of the configuration file > bundle-context.xml > bundle-context-osgi.xml > > Looks like all the problems are happening because of the OSGI bundle. > > Please tell if you have any idea about this problem. > > With Regards > Harbeer kadian > > > > > willem.jiang wrote: >> >> Sorry, I just realized you are using Camel 1.6.1-fuse >> >> You can try to use Camel 1.6.2.1-fuse or use this code. >> camelContext.setRegistry(new JndiRegistry(jndiContext)); >> >> Willem >> >> Harbeer Kadian wrote: >>> Hi, >>> >>> I checked the respective jar(camel-osgi) in cache folder. >>> To my surprise, the CompositeRegistry class is not present there. >>> Is it like I am using old version of camel-osgi feature. >>> >>> With Regards >>> Harbeer Kadian >>> >>> >>> >>> Harbeer Kadian wrote: >>>> Hi, >>>> >>>> I changed the creation of CamelContext as per your suggestions. >>>> I am getting following exception now. >>>> >>>> org.springframework.beans.factory.BeanCreationException: Error creating >>>> bean with name ConnectPlatform' defined in URL >>>> [bundle://186.0:0/META-INF/spring/bundle-context.xml]: >>>> Instantiation of bean failed; nested exception is >>>> org.springframework.beans.BeanInstantiationException: Could not >>>> instantiate bean class >>>> [com.altair.hwec.connectplatform.ConnectPlatformImpl]: Constructor >>>> threw >>>> exception; >>>> nested exception is java.lang.NoClassDefFoundError: >>>> org/apache/camel/osgi/CompositeRegistry >>>> >>>> I checked what all the camel jars are active in servicemix as of now >>>> Here are the details >>>> >>>> s...@root:/> osgi/list | grep camel >>>> [ 66] [Active ] [ ] [ 60] camel-core (1.6.1.fuse) >>>> [ 67] [Active ] [ ] [ 60] camel-osgi (1.6.1.fuse) >>>> [ 68] [Active ] [ ] [ 60] camel-spring (1.6.1.fuse) >>>> [ 165] [Active ] [ ] [ 60] camel-http (1.6.1.fuse) >>>> >>>> With Regards >>>> Harbeer Kadian >>>> >>>> >>>> >>>>
Not able to invoke webservice using http component
Hi, I deployed a simple webservice on TomCat Server. I created following route to access the webservice using apache camel. from("direct:ProducerUri") .to("http://localhost:8095/WebServiceTutorial/services/Hello?username=admin&password=admin";); I created the exchange in the following way String soapMessage = "http://schemas.xmlsoap.org/soap/envelope/\"; xmlns:tut=\"http://tutorial.com\";>" + "Harbeer Kadian" + ""; XmlConverter xmlConverter = new XmlConverter(); Document input = xmlConverter.toDOMDocument(soapMessage); exchange.getIn().setBody(input); exchange.setPattern(ExchangePattern.InOut); //added this line after seeing no soapAction found error on Tom Cat Server log exchange.getIn().setHeader("SOAPAction", ""); exchange = producerTemplate.send("direct:ProducerUri", exchange); Document output = (Document)exchange.getOut().getBody(); System.out.println(output); I am getting null as output. Also on the tom cat server log, no exception is coming. I have no idea how to invoke webservice using http component. Please help me. With Regards Harbeer Kadian -- View this message in context: http://old.nabble.com/Not-able-to-invoke-webservice-using-http-component-tp28001459p28001459.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Not able to invoke webservice using http component
Hi, thanks for the reply. I did not changed the input soap message into Document and directly sent it. I got the soap message reply in the form of String. The reply is as follows http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>http://tutorial.com";>Hello Harbeer Kadian Now i want to read this output and change it into java objects, just like what a webservice client do. Do there are any standard api to do this. Or I have to use some sort of XQuery or XSLT Transformer to get the soap body. With Regards Harbeer Kadian willem.jiang wrote: > > Yes, if you want to send a request from camel-http endpoint, you just > need put the a Sting, InputStream or HttpEntity into to the message > body, otherwise camel-http endponit may not send right request to the > service. > > Willem > > ychawla wrote: >> Hi Habeer, >> Do you need to do the DOM conversions that you are doing: >> >> Document input = xmlConverter.toDOMDocument(soapMessage); >> exchange.getIn().setBody(input); >> >> Can't you just set the body to be a string? >> >> Same with the return message. That might be tripping something up. >> Also, >> are you able to get to your webservice using a browser/basic auth: >> >> http://localhost:8095/WebServiceTutorial/services/Hello?username=admin&password=admin >> >> When I was first setting up a web service connection through HTTP, I set >> up >> a polling folder and result folder and got that working first. I just >> made >> the entire soap message in a text editor which it looks like you already >> have. Then you can set up a simple route to test for web service >> connectivity: >> >> >> > uri="http://localhost:8095/WebServiceTutorial/services/Hello?username=admin&password=admin"; >> /> >> >> >> Cheers, >> Yogesh >> >> >> Harbeer Kadian wrote: >>> Hi, >>> >>> I deployed a simple webservice on TomCat Server. >>> I created following route to access the webservice using apache camel. >>> >>> from("direct:ProducerUri") >>> .to("http://localhost:8095/WebServiceTutorial/services/Hello?username=admin&password=admin";); >>> >>> I created the exchange in the following way >>> String soapMessage = ">> xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"; >>> xmlns:tut=\"http://tutorial.com\";>" >>> + "Harbeer Kadian" + >>> ""; >>> XmlConverter xmlConverter = new XmlConverter(); >>> >>> Document input = xmlConverter.toDOMDocument(soapMessage); >>> exchange.getIn().setBody(input); >>> exchange.setPattern(ExchangePattern.InOut); >>> //added this line after seeing no soapAction found error on Tom Cat >>> Server >>> log >>> exchange.getIn().setHeader("SOAPAction", ""); >>> exchange = producerTemplate.send("direct:ProducerUri", exchange); >>> Document output = (Document)exchange.getOut().getBody(); >>> System.out.println(output); >>> >>> I am getting null as output. >>> Also on the tom cat server log, no exception is coming. >>> >>> I have no idea how to invoke webservice using http component. >>> Please help me. >>> >>> With Regards >>> Harbeer Kadian >>> >>> >> > > > -- View this message in context: http://old.nabble.com/Not-able-to-invoke-webservice-using-http-component-tp28001459p28013965.html Sent from the Camel - Users mailing list archive at Nabble.com.
How to change java application into Enterprise Integration Pattern
Hi, I have a class, which contains a java object(say message which I need to transmit). This class is present in an OSGI Bundle named connector. This OSGI Bundle also contains classes need to validate this message. There is another OSGI Bundle which contains a transformer class which can convert this java object message into XML Message using Apache velocity. The XML Message need to be converted into a Soap message, but the information required to convert it into soap message is present in the bundle named connector. Now the control is inside connector bundle, and I have that java object message ready. If i have to do the operations mentioned above in a java application, i may have done it as follows Pseudo code: 1) call a validation method and send the java object as a parameter. 2) If the validation passes, call the transform method of the Transformer class, and get the xml as reply. 3) Get the required information to build soapmessage and convert it into soap message. sendJavaObject(Object message) { validate(message); String xmlMessage = Transformer.transform(message); String soapMessage = appendSoapInfo(xmlMessage); } But the thing here is that all the controlling of method calling is happening from the Connector bundle. If I see an Camel Integration pattern they will tell some thing like this Object Message ->>>>> Validator >>>>> Transformer >>>> soapAppender --->>>> callWebservice. and then the response will be sent using the out property present in the MessageExchange. But my implementation looks like this Object Message ->>>>>> Validator Object Message -->>>>>> Transformer String Message --->>>>> SoapAppender String soapMessage >>>>> Call Web Service using camel Http Component ->>>> String soapResponse I am also adding a diagram giving pictorial representation of our application. http://old.nabble.com/file/p28179266/ExecuteOperation.png ExecuteOperation.png Please give me some guidelines regarding how to change a java application into Enterprise Integration Patterns. With Regards Harbeer Kadian -- View this message in context: http://old.nabble.com/How-to-change-java-application-into-Enterprise-Integration-Pattern-tp28179266p28179266.html Sent from the Camel - Users mailing list archive at Nabble.com.