Hi I'm trying to deploy camel-example-cxf-osgi/2.10.4 on Karaf 2.3.1 or SMX 4.5.1 using following commands (as described in http://camel.apache.org/cxf-example- osgi.html)
in Karaf i have to add Camel features first features:chooseurl camel 2.10.4 and next (Karaf or SMX) features:install war features:install cxf features:install camel-spring features:install camel-jaxb features:install camel-cxf osgi:install -s mvn:org.apache.camel/camel-example-cxf-osgi/2.10.4 After installing the sample bundle the spring context fails to start [ 176] [Active ] [ ] [Failed ] [ 80] camel-example-cxf-osgi (2.10.4) In the log file I can see following error (full stacktrace attached) Caused by: java.io.FileNotFoundException: OSGi resource[classpath:META- INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist I could successfully install the camel-example-cxf-osgi/2.9.0 I thing my problem is caused by https://issues.apache.org/jira/browse/CAMEL-5441 which removes the META-INF.cxf from the imports of the example bundle (https://github.com/apache/camel/commit/73c3d4fd2a306557be8f79b502697fe3cd475695#examples/camel-example-cxf-osgi/pom.xml) Was this removal correct? I don't understand why this files should by loaded by Spring DM and why it is not necessary to import them. Could you write me the correct steps for successful installation of the sample? Best regards Krzysztof
2013-04-09 00:39:54,408 | ERROR | ExtenderThread-2 | ContextLoaderListener | BundleApplicationContextListener 50 | 95 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=org.apache.camel.camel-example-cxf-osgi, config=osgibundle:/META-INF/spring/*.xml)) org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/cxf/cxf.xml] Offending resource: URL [bundle://176.0:0/META-INF/spring/camel-context.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist Caused by: java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist 2013-04-09 00:39:54,417 | ERROR | ExtenderThread-2 | WaiterApplicationContextExecutor | WaiterApplicationContextExecutor 424 | 95 - org.springframework.osgi.extender - 1.2.1 | Unable to create application context for [org.apache.camel.camel-example-cxf-osgi], unsatisfied dependencies: none org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/cxf/cxf.xml] Offending resource: URL [bundle://176.0:0/META-INF/spring/camel-context.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:239)[88:org.springframework.beans:3.1.4.RELEASE] ... 24 more Caused by: java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist at org.springframework.osgi.io.OsgiBundleResource.getURL(OsgiBundleResource.java:228)[93:org.springframework.osgi.io:1.2.1] at org.springframework.osgi.io.OsgiBundleResource.getInputStream(OsgiBundleResource.java:180)[93:org.springframework.osgi.io:1.2.1] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)[88:org.springframework.beans:3.1.4.RELEASE] ... 28 more 2013-04-09 00:39:54,420 | ERROR | ExtenderThread-2 | ContextLoaderListener | BundleApplicationContextListener 50 | 95 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=org.apache.camel.camel-example-cxf-osgi, config=osgibundle:/META-INF/spring/*.xml)) org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/cxf/cxf.xml] Offending resource: URL [bundle://176.0:0/META-INF/spring/camel-context.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:245)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:196)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:181)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)[94:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)[94:org.springframework.osgi.core:1.2.1] at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)[90:org.springframework.context:3.1.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530)[90:org.springframework.context:3.1.4.RELEASE] at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)[94:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)[94:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[94:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)[94:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)[95:org.springframework.osgi.extender:1.2.1] at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)[95:org.springframework.osgi.extender:1.2.1] at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)[94:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)[95:org.springframework.osgi.extender:1.2.1] at java.lang.Thread.run(Thread.java:722)[:1.7.0_17] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[88:org.springframework.beans:3.1.4.RELEASE] at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:239)[88:org.springframework.beans:3.1.4.RELEASE] ... 24 more Caused by: java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=176|bnd.sym=org.apache.camel.camel-example-cxf-osgi] cannot be resolved to URL because it does not exist at org.springframework.osgi.io.OsgiBundleResource.getURL(OsgiBundleResource.java:228)[93:org.springframework.osgi.io:1.2.1] at org.springframework.osgi.io.OsgiBundleResource.getInputStream(OsgiBundleResource.java:180)[93:org.springframework.osgi.io:1.2.1] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)[88:org.springframework.beans:3.1.4.RELEASE] ... 28 more