Hi Willem,

We are using 2 bundles  -

1. cxf-bundle
2. camel-cxf

The problem is that both of these bundles export the same package
META-INF.cxf which they should not as it results in a split package
scenario. Internally i believe Camel is using CXF bus to load the camel
specific beans for CXF from META-INF.cxf and so creates the same folder so
that i becomes easier to re-use. The problem it creates is that now you have
to export the same package from camel-cxf as well.

I hope i have answered your question.

Best regards,
Madhav



Willem.Jiang wrote:
> 
> Hi,
> 
> What kind of CXF bundle are you using?
> Did you installed the cxf-bundle bundle?
> 
> Here is a FAQ entry[1] may help you too.
> 
> [1]https://cwiki.apache.org/CAMEL/how-to-avoid-importing-bunch-of-cxf-packages-when-start-up-the-camel-cxf-endpoint-from-osgi-platform-.html
> 
> On 10/29/10 8:35 PM, unmarshall wrote:
>>
>> Hi All,
>>
>> I have an equinox based OSGI runtime. In that i am using Apache Camel
>> 2.4.0
>> and CXF - 2.2.11
>>
>> In the spring XML configuration file i have the following include
>> statements:
>>
>> <import resource="classpath*:META-INF/cxf/cxf.xml" />
>> <import resource="classpath*:META-INF/cxf/cxf-extension-soap.xml" />
>> <import resource="classpath*:META-INF/cxf/cxf-extension-http.xml"/>
>> <import resource="classpath*:META-INF/cxf/osgi/cxf-extension-osgi.xml"/>
>>
>> When the osgi runtime starts then it throws the following exception:
>>
>> Oct 29, 2010 5:20:10 PM org.apache.cxf.bus.spring.SpringBusFactory
>> createApplicationContext
>> WARNING: Initial attempt to create application context was unsuccessful.
>> org.springframework.beans.factory.BeanDefinitionStoreException:
>> IOException
>> parsing XML document from class path resource [META-INF/cxf/cxf.xml];
>> nested
>> exception is java.io.FileNotFoundException: class path resource
>> [META-INF/cxf/cxf.xml] cannot be opened because it does not exist
>>      at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
>>      at
>> org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinitionReader.loadBeanDefinitions(ControlledValidationXmlBeanDefinitionReader.java:131)
>>      at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
>>      at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
>>      at
>> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:122)
>>      at
>> org.apache.cxf.bus.spring.BusApplicationContext.loadBeanDefinitions(BusApplicationContext.java:262)
>>      at
>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
>>      at
>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
>>      at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
>>      at
>> org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext.java:91)
>>      at
>> org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(SpringBusFactory.java:102)
>>      at
>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:93)
>>      at
>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:86)
>>      at
>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:64)
>>      at
>> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:53)
>>      at
>> org.apache.cxf.transport.servlet.CXFServlet.updateContext(CXFServlet.java:136)
>>      at
>> org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:104)
>>      at
>> org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:73)
>>      at
>> org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:84)
>>      at
>> org.eclipse.equinox.http.servlet.internal.ServletRegistration.init(ServletRegistration.java:49)
>>      at
>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.registerServlet(ProxyServlet.java:177)
>>      at
>> org.eclipse.equinox.http.servlet.internal.HttpServiceImpl.registerServlet(HttpServiceImpl.java:66)
>>      at
>> com.sap.pi.composite.syn.internal.activator.TrackingComponent.startup(TrackingComponent.java:34)
>>      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.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:210)
>>      at
>> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:139)
>>      at
>> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:329)
>>      at
>> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:580)
>>      at
>> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:196)
>>      at
>> org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:431)
>>      at
>> org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
>>      at
>> org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
>>      at
>> org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
>>      at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
>>      at
>> org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
>> Caused by: java.io.FileNotFoundException: class path resource
>> [META-INF/cxf/cxf.xml] cannot be opened because it does not exist
>>      at
>> org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:141)
>>      at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
>>      ... 37 more
>>
>> There is already an issue being logged @
>> http://mail-archives.apache.org/mod_mbox/camel-dev/201010.mbox/%3c6300966.62871287668440374.javamail.j...@thor%3e
>> CAMEL-2457 Issue
>>
>> The workaround due to the split-package issue (which is a no-no in OSGI)
>> does not work for me. This is stopping me to use CXF and is a major
>> problem.
>>
>> Has anyone worked on this issue yet?
>>
>> Best Regards,
>> Madhav
>>
>>
>>
> 
> 
> -- 
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>           http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> 
> 

-- 
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-Startup-issue-with-Camel-in-OSGI-runtime-tp3241913p3247484.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to