I created a small OSGi Maven project using Eclipse Juno with an archetype camel-achetype-blueprint.
I get the following error when I (right-click) Project -> Run As -> Maven Builds and in the goal camel:run -e -X.
I know my camel route in my blueprint.xml is correct as I have tested it with a JUnit test and it runs.
I don't understand whey camel:run would not work. From the Apache Camel documentation, it should work perfectly under Eclipse run as Maven.
My pom.xml file has the following
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>2.11.0</version>
<configurtion>
<useBlueprint>true</useBlueprint>
<logClasspath>true</logClasspath>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
</plugin>
There error I get is the following:
[ERROR] Failed to execute goal org.apache.camel:camel-maven-plugin:2.11.0:run (default-cli) on project transport: null: MojoExecutionException: InvocationTargetException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext) -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.camel:camel-maven-plugin:2.11.0:run (default-cli) on project transport: null
Any ideas?
Run the mvn install command before execute camel:run. If you prefer execute both together: mvn install camel:run.
What is happening is that the plugin is trying to find the blueprint.xml file in the target folder. If this file was not found, you got an error getting the CamelContext (OsgiDefaultCamelContext). The mvn install comand resolve this populating the target folder.
I test this here and got the same error. The only difference is that I was using maven in shell (not in Eclipse like you).
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With