Hi,
I added the plugin you suggested to my pom file, but still same error when I try to start the bundle.
i installed the
camel-cxf
camel-http
camel-spring
as you can see by the lines below
200 Active [ ] [ ]
60 camel-cxf (2.6.0.fuse-03-01)
201 Active [ ] [ ]
60 camel-http (2.6.0.fuse-03-01)
204 Active [ ] [ ]
60 camel-spring (2.6.0.fuse-03-01)
205 Installed [ ] [ ]
60 camel-example-cxf-proxy (2.7.1.fuse-00-27)
when i run
karaf@root> osgi:start 205
this error occurs, and I cannot figure out what I am missing or doing wrong.
Please help! Thanks a lot in advance!!
Error executing command: The bundle "org.apache.camel.camel-example-cxf-proxy_2.7.1.fuse-00-27
205" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.camel.spring; version="[2.7.0,2.8.0)"
I also copied the error from the servicemix.log
org.osgi.framework.BundleException: The bundle "org.apache.camel.camel-example-cxf-proxy_2.7.1.fuse-00-27
205" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.camel.spring; version="[2.7.0,2.8.0)"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
osgi-3.6.0.v20100517.jar:
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)
osgi-3.6.0.v20100517.jar:
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)
osgi-3.6.0.v20100517.jar:
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
osgi-3.6.0.v20100517.jar:
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)
osgi-3.6.0.v20100517.jar:
at org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:29)
27:org.apache.karaf.shell.osgi:2.1.6.fuse-01-01
at org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:49)
27:org.apache.karaf.shell.osgi:2.1.6.fuse-01-01
at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:50)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:229)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:162)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:101)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:79)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at org.apache.karaf.shell.console.jline.Console.run(Console.java:170)
14:org.apache.karaf.shell.console:2.1.6.fuse-01-01
at java.lang.Thread.run(Thread.java:662)
:1.6.0_27
here is the camel-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: e1 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd">
<!-- needed cxf imports -->
<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-jetty.xml"/>
<!-- use a bean to start and stop the real web service (is not Camel specific) -->
<!-- in a real use-case the real web service would be located on another server
but we simulate this in the same JVM -->
<bean id="realWebService" class="org.apache.camel.example.cxf.proxy.RealWebServiceBean"
init-method="start" destroy-method="stop">
<!-- this is the url of the real web service we have proxied -->
<property name="url" value="http://localhost:9081/real-webservice"/>
</bean>
<!-- a bean to enrich the input -->
<bean id="enrichBean" class="org.apache.camel.example.cxf.proxy.EnrichBean"/>
<!-- this is the CXF webservice we use as front end -->
<cxf:cxfEndpoint id="reportIncident"
address="http://localhost:9080/camel-example-cxf-proxy/webservices/incident"
endpointName="s:ReportIncidentEndpoint"
serviceName="s:ReportIncidentEndpointService"
wsdlURL="etc/report_incident.wsdl"
xmlns:s="http://reportincident.example.camel.apache.org"/>
<!-- this is the camel route which proxy the web service and forward it to the real web service -->
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<!-- cxf consumer using MESSAGE format -->
<from uri="cxf:bean:reportIncident?dataFormat=MESSAGE"/>
<!-- log input received -->
<to uri="log:input"/>
<!-- enrich the input by ensure the incidentId parameter is set -->
<to uri="bean:enrichBean"/>
<!-- send proxied request to real web service -->
<to uri="http://localhost:9081/real-webservice?throwExceptionOnFailure=false"/>
<!-- log answer from real web service -->
<to uri="log:output"/>
</route>
</camelContext>
</beans>
and here is the pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel</groupId>
<artifactId>examples</artifactId>
<version>2.7.1-fuse-00-27</version>
</parent>
<artifactId>camel-example-cxf-proxy</artifactId>
<name>Camel :: Example :: CXF Proxy</name>
<description>An example which uses Camel to proxy a web service</description>
<packaging>bundle</packaging>
<properties>
<camel.osgi.export.pkg>
org.apache.camel.example.*
</camel.osgi.export.pkg>
<camel.osgi.import.additional>
META-INF.cxf
</camel.osgi.import.additional>
<camel.osgi.private.pkg>
org.apache.camel.example.reportincident
</camel.osgi.private.pkg>
<!-- to avoid us import bunch of cxf package -->
<camel.osgi.dynamic>*</camel.osgi.dynamic>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
</dependency>
<!-- cxf -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-core</artifactId>
<version>${cxf-version}</version>
</dependency>
<!-- used by the real web service -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf-version}</version>
</dependency>
<!-- regular http transport -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf-version}</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<!-- cxf web container for unit testing -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf-version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- CXF wsdl2java generator, will plugin to the compile goal -->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf-version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/etc/report_incident.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${project.version}</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
The pom and camel-config are straight from the camel-example-cxf-proxy with the one plugin you had me put in.
To deploy the bundle, i did a "mvn install" and then copied the jar into the "deploy" folder of servicemix.
It installs, but is unable to start with that error message.