You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by unmarshall <un...@gmail.com> on 2010/10/29 14:35:13 UTC

CXF Startup issue with Camel in OSGI runtime

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.jira@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



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

RE: CXF Startup issue with Camel in OSGI runtime

Posted by unmarshall <un...@gmail.com>.
Hi Lukasz,

Thanks for your response.
I have already tried that option, however the result is the same. 

Regards,
Madhav


Łukasz Dywicki wrote:
> 
> Hi,
> Try to add import package META-INF.cxf,
> 
> Best regards,
> Lukasz
> 
> -----Original Message-----
> From: unmarshall [mailto:unmarshall@gmail.com] 
> Sent: Friday, October 29, 2010 2:35 PM
> To: users@camel.apache.org
> Subject: CXF Startup issue with Camel in OSGI runtime
> 
> 

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

RE: CXF Startup issue with Camel in OSGI runtime

Posted by Łukasz Dywicki <lu...@code-house.org>.
Hi,
Try to add import package META-INF.cxf,

Best regards,
Lukasz

-----Original Message-----
From: unmarshall [mailto:unmarshall@gmail.com] 
Sent: Friday, October 29, 2010 2:35 PM
To: users@camel.apache.org
Subject: CXF Startup issue with Camel in OSGI runtime


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.loadBeanDefini
tions(XmlBeanDefinitionReader.java:341)
	at
org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinitionReader.loadBe
anDefinitions(ControlledValidationXmlBeanDefinitionReader.java:131)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefini
tions(XmlBeanDefinitionReader.java:302)
	at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadB
eanDefinitions(AbstractBeanDefinitionReader.java:143)
	at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDe
finitions(AbstractXmlApplicationContext.java:122)
	at
org.apache.cxf.bus.spring.BusApplicationContext.loadBeanDefinitions(BusAppli
cationContext.java:262)
	at
org.springframework.context.support.AbstractRefreshableApplicationContext.re
freshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBe
anFactory(AbstractApplicationContext.java:467)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
actApplicationContext.java:397)
	at
org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext
.java:91)
	at
org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(SpringBu
sFactory.java:102)
	at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:9
3)
	at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:8
6)
	at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:6
4)
	at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:5
3)
	at
org.apache.cxf.transport.servlet.CXFServlet.updateContext(CXFServlet.java:13
6)
	at
org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:10
4)
	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(ServletRe
gistration.java:49)
	at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.registerServlet(Proxy
Servlet.java:177)
	at
org.eclipse.equinox.http.servlet.internal.HttpServiceImpl.registerServlet(Ht
tpServiceImpl.java:66)
	at
com.sap.pi.composite.syn.internal.activator.TrackingComponent.startup(Tracki
ngComponent.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(ServiceCompo
nent.java:210)
	at
org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceC
omponentProp.java:139)
	at
org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComp
onentProp.java:329)
	at
org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProce
ss.java:580)
	at
org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProc
ess.java:196)
	at
org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:4
31)
	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.jav
a: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(ClassPathResour
ce.java:141)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefini
tions(XmlBeanDefinitionReader.java:328)
	... 37 more

There is already an issue being logged @ 
http://mail-archives.apache.org/mod_mbox/camel-dev/201010.mbox/%3C6300966.62
871287668440374.JavaMail.jira@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



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


Re: CXF Startup issue with Camel in OSGI runtime

Posted by unmarshall <un...@gmail.com>.
Hi Willem,

Thanks a lot. I did not see an update on the JIRA so thought that the patch
was not there.

Best Regards,
Madhav


Willem.Jiang wrote:
> 
> Hi Madhav,
> 
> I already committed a patch[1] for it hours ago :)
> 
> [1]http://svn.apache.org/viewvc?rev=1030322&view=rev
> 
> 
> 

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

Re: CXF Startup issue with Camel in OSGI runtime

Posted by Willem Jiang <wi...@gmail.com>.
Hi Madhav,

I already committed a patch[1] for it hours ago :)

[1]http://svn.apache.org/viewvc?rev=1030322&view=rev

On 11/3/10 1:40 PM, unmarshall wrote:
>
> Hi Willem,
>
> Thanks for creating a JIRA. I will work on the patch and submit it.
>
> Best Regards,
> madhav
>
>
> Willem.Jiang wrote:
>>
>> On 11/3/10 4:45 AM, unmarshall wrote:
>>>
>>> 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.
>>
>> Yes, I got it.
>>
>> After having some chats with Freeman of ServiceMix, I realized that
>> camel-cxf should not export the META-INF.cxf which makes the OSGi core
>> confused when you install the cxf-bundle and camel-cxf bundle at the
>> same time. If the camel-cxf bundle is installed before the cxf-bundle,
>> you application may resolved a wrong META-INF.cxf package.
>>
>> I just create a JIRA[1] for it. You can apply the patch yourself to
>> camel 2.5.0 or wait for the release of Fuse MR 2.5.0.
>>
>> [1]https://issues.apache.org/activemq/browse/CAMEL-3303
>>
>>>
>>> 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.jira@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
>>>>
>>>>
>>>
>>
>>
>> --
>> Willem
>> ----------------------------------
>> FuseSource
>> Web: http://www.fusesource.com
>> Blog:    http://willemjiang.blogspot.com (English)
>>            http://jnn.javaeye.com (Chinese)
>> Twitter: willemjiang
>>
>>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Re: CXF Startup issue with Camel in OSGI runtime

Posted by unmarshall <un...@gmail.com>.
Hi Willem,

Thanks for creating a JIRA. I will work on the patch and submit it.

Best Regards,
madhav


Willem.Jiang wrote:
> 
> On 11/3/10 4:45 AM, unmarshall wrote:
>>
>> 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.
> 
> Yes, I got it.
> 
> After having some chats with Freeman of ServiceMix, I realized that 
> camel-cxf should not export the META-INF.cxf which makes the OSGi core 
> confused when you install the cxf-bundle and camel-cxf bundle at the 
> same time. If the camel-cxf bundle is installed before the cxf-bundle, 
> you application may resolved a wrong META-INF.cxf package.
> 
> I just create a JIRA[1] for it. You can apply the patch yourself to 
> camel 2.5.0 or wait for the release of Fuse MR 2.5.0.
> 
> [1]https://issues.apache.org/activemq/browse/CAMEL-3303
> 
>>
>> 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.jira@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
>>>
>>>
>>
> 
> 
> -- 
> 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-tp3241913p3247959.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF Startup issue with Camel in OSGI runtime

Posted by Willem Jiang <wi...@gmail.com>.
On 11/3/10 4:45 AM, unmarshall wrote:
>
> 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.

Yes, I got it.

After having some chats with Freeman of ServiceMix, I realized that 
camel-cxf should not export the META-INF.cxf which makes the OSGi core 
confused when you install the cxf-bundle and camel-cxf bundle at the 
same time. If the camel-cxf bundle is installed before the cxf-bundle, 
you application may resolved a wrong META-INF.cxf package.

I just create a JIRA[1] for it. You can apply the patch yourself to 
camel 2.5.0 or wait for the release of Fuse MR 2.5.0.

[1]https://issues.apache.org/activemq/browse/CAMEL-3303

>
> 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.jira@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
>>
>>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Re: CXF Startup issue with Camel in OSGI runtime

Posted by unmarshall <un...@gmail.com>.
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.jira@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.

Re: CXF Startup issue with Camel in OSGI runtime

Posted by Willem Jiang <wi...@gmail.com>.
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.jira@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