You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Savas Ali Tokmen (JIRA)" <ji...@apache.org> on 2009/09/25 15:21:52 UTC

[jira] Commented: (CAMEL-1862) camel-cxf bundle doesn't specify any Import-Package version

    [ https://issues.apache.org/activemq/browse/CAMEL-1862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54509#action_54509 ] 

Savas Ali Tokmen commented on CAMEL-1862:
-----------------------------------------

This actually solves half of the issue, by guaranteeing that Camel-CXF won't start if CXF 2.0 or 2.1 is here.

The trouble with CXF is that it registers itself to Spring without specifying its version. As a result, in the case some CXF 2.0 applications are started for real (i.e. registered to Spring), Camel-CXF (with CXF 2.2) will not start with an exception that looks like:

{{    WSDLManagerImpl.registerInitialExtensions : Failed to add extension element.}}
{{    java.lang.ClassNotFoundException: org.xmlsoap.schemas.wsdl.http.AddressType}}
{{           at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:627)}}
{{           at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:61)}}
{{           at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1469)}}
{{           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)}}
{{           at org.apache.cxf.common.classloader.ClassLoaderUtils.loadClass2(ClassLoaderUtils.java:236)}}
{{           at org.apache.cxf.common.classloader.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:222)}}
{{           at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:85)}}
{{           at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:239)}}
{{           at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:219)}}
{{           at org.apache.cxf.wsdl11.WSDLManagerImpl.<init>(WSDLManagerImpl.java:109)}}
{{           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)}}
{{           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)}}
{{           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)}}
{{           at java.lang.reflect.Constructor.newInstance(Constructor.java:494)}}
{{           at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)}}
{{           at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)}}
{{           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)}}
{{           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)}}
{{           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)}}
{{           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)}}

{{           at java.security.AccessController.doPrivileged(Native Method)}}
{{           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)}}
{{           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)}}
{{           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)}}
{{           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)}}
{{           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)}}
{{           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)}}
{{           at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)}}
{{           at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)}}
{{           at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)}}
{{           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.ow2.jonas.camel.cxf.servlet.OsgiHttpServiceCXFServlet.loadBus(OsgiHttpServiceCXFServlet.java:75)}}
{{           at org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:79)}}
{{           at org.ow2.jonas.web.httpServiceTomcat6.HttpServiceImpl.registerServlet(HttpServiceImpl.java:231)}}
{{           at org.ow2.jonas.camel.cxf.servlet.OsgiCXFServletDeployer.__start(OsgiCXFServletDeployer.java:74)}}
{{           at org.ow2.jonas.camel.cxf.servlet.OsgiCXFServletDeployer.start(OsgiCXFServletDeployer.java)}}
{{           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:585)}}
{{           at org.apache.felix.ipojo.util.Callback.call(Callback.java:235)}}
{{           at org.apache.felix.ipojo.util.Callback.call(Callback.java:191)}}
{{           at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86)}}
{{           at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:162)}}
{{           at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)}}
{{           at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:428)}}
{{           at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:309)}}
{{           at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:155)}}
{{           at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:283)}}
{{           at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:220)}}
{{           at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:349)}}
{{           at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:84)}}
{{           at org.apache.felix.ipojo.Extender.parse(Extender.java:269)}}
{{           at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)}}
{{           at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)}}
{{           at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:669)}}
{{           at java.lang.Thread.run(Thread.java:595)}}

As a result, my previous comment:

bq. When both CXF 2.0.11 and 2.2.2 are present, the bundle does resolve and when started seems to take the good version

May or may not be valid depending on what has been done with which CXF version and the order in which these actions have been done

Long story short: don't try to have two CXF bundles on the same OSGi platform...

> camel-cxf bundle doesn't specify any Import-Package version
> -----------------------------------------------------------
>
>                 Key: CAMEL-1862
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1862
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.0-M3
>         Environment: CAMEL, CXF, OSGi Felix
>            Reporter: Savas Ali Tokmen
>            Assignee: Willem Jiang
>             Fix For: 1.6.2, 2.0.0
>
>
> The camel-cxf component is currently generated against CXF version 2.2.2.
> As a result, the camel-cxf module as well as the camel-cxf bundle require CXF 2.2. More importantly, that bundle does not work correctly with CXF 2.0 (note that this is an expected behavior, CXF has had API changes with its 2.2 version).
> Now, the trouble is that the camel-cxf JAR's MANIFEST has an Import-Package on org.apache.cxf.* components without specifying any version! As a result, when it looks for CXF and both CXF 2.0 and 2.2 are present on the platform, it sometimes chooses the wrong one.
> To solve this issue, version specifiers should be added to the Import-Package declarations of the camel-cxf bundle. I guess an import on version 2.2 would be enough (we don't need to specify 2.2.2 explicitely).
> Cheers
> S. Ali Tokmen
> http://ali.tokmen.com/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.