On Tue, Nov 24, 2009 at 10:56 AM, lekkie <lekkie.ay...@gmail.com> wrote:
>
> Thnx.
>
> I tried that and it seems it cant find the transport nmr resource path. See
> exception below:
>
> XML bean definitions from OSGi
> resource[classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml|bnd.id=176|bnd.sym=nau-college-se]
> 16:52:31,731 | ERROR | xtenderThread-79 | OsgiBundleXmlApplicationContext  |
> gatedExecutionApplicationContext  293 | Pre refresh error
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Failed to import bean definitions from URL location
> [classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml]
> Offending resource: URL [bundle://176.0:0/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/nmr/cxf-transport-nmr.xml|bnd.id=176|bnd.sym=nau-college-se];
> nested exception is java.io.FileNotFoundException: OSGi
> resource[classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml|bnd.id=176|bnd.sym=nau-college-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)

Are you using JBI packaging or OSGi packaging for your project?  I
think you may have to switch over to using OSGi packaging to get
access to the resource you need here, the cxf-camel-nmr example shows
that the example bundle needs to import META-INF.cxf:

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>

<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                        <Import-Package>

javax.jws,javax.wsdl,META-INF.cxf,META-INF.cxf.transport.nmr,
                          org.apache.cxf.bus,org.apache.servicemix.camel.nmr,
                          org.apache.servicemix.cxf.transport.nmr,

org.apache.servicemix.nmr.api,org.apache.servicemix.nmr.api.event,org.apache.servicemix.nmr.api.internal,
                          org.springframework.beans.factory.config, *
                        </Import-Package>

<Private-Package>org.apache.servicemix.examples.cxfcamel</Private-Package>
                        <Require-Bundle>org.apache.cxf.bundle</Require-Bundle>
                    </instructions>
                </configuration>
            </plugin>

Hope that helps!

>
>
>
>
>
> Stan Lewis-3 wrote:
>>
>> On Tue, Nov 24, 2009 at 10:15 AM, lekkie <lekkie.ay...@gmail.com> wrote:
>>>
>>> While trying to configure a route using the camel 2.0, I had the ffg in
>>> my
>>> bean.xml file:
>>>
>>> <cxfse:endpoint id="Services" useJBIWrapper="false"
>>> useSOAPEnvelope="false">
>>>                <cxfse:pojo>
>>>                        <bean class="com.services.CollegeServicesImpl"/>
>>>                </cxfse:pojo>
>>>        </cxfse:endpoint>
>>>
>>> and I have this in my bean class as the annotation
>>> @WebService(targetNamespace = "http://services.com";, serviceName =
>>> "Services", portName = "endpoint")
>>>
>>> I thot I'd be able to access this service using the jbi naming convention
>>> from my camelcontext shown below:
>>>
>>> <osgi:camelContext xmlns="http://camel.apache.org/schema/spring";>
>>>                <route>
>>>                        <from uri="jms:queue:RequestQueue" />
>>>                        <to
>>> uri="jbi:endpoint:http://services.com/Services/endpoint?mep=in-out"; />
>>>                </route>
>>>        </osgi:camelContext>
>>>
>>>
>>> I couldn't as it says:
>>>
>>> Camel 2.x-fuse-SNAPSHOT (CamelContext:camelContext) stopped
>>> 15:12:49,403 | ERROR | xtenderThread-72 | OsgiBundleXmlApplicationContext
>>>  |
>>> gatedExecutionApplicationContext  366 | Post refresh error
>>> org.apache.camel.RuntimeCamelException:
>>> org.apache.camel.FailedToCreateRouteException: Failed to create route
>>> route1
>>> at: >>> To[jbi:endpoint:http://services.com/Services/endpoint?mep=in-out]
>>> <<< in route: Route[[From[jms://queue:RequestQueue]] -> [T... because of
>>> Failed to resolve endpoint:
>>> jbi://endpoint:http://services.com/Services/endpoint?mep=in-out due to:
>>> No
>>> component found with scheme: jbi
>>>        at
>>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>>>        at
>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>>>        at
>>> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>>>
>>> I googled and I found out that there is a way to register ur service from
>>> the NMR.
>>>
>>> <jaxws:endpoint id="CollegeServices"
>>>                       implementor="com.services.CollegeServicesImpl"
>>>                        address="nmr:CollegeService" />
>>>
>>> However, my service never got registered as it kept ServiceMix kept
>>> saying:
>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>> bean
>>> with name 'CollegeServices': Invocation of init method failed; nested
>>> exception is javax.xml.ws.WebServiceException:
>>> java.lang.IllegalStateException: Endpoint address should be a relative
>>> URI
>>> wrt to the servlet address (use '/xxx' for example)
>>>        at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
>>
>> Yeah, I think you need to add the following import to your spring config:
>>
>> <import
>> resource="classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml" />
>>
>> There's a whole cxf-camel-nmr demo that ships with servicemix 4 that
>> you should take a look at.
>>
>>
>>>
>>>
>>> kr.
>>> --
>>> View this message in context:
>>> http://old.nabble.com/FailedToCreateRouteException%3A-Failed-to-create-route-route1-tp26497670p26497670.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/FailedToCreateRouteException%3A-Failed-to-create-route-route1-tp26497670p26498456.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Reply via email to