chrisjleu
chrisjleu

Reputation: 4380

Apache Camel maven dependency issue with BundleContextAware and BundleContext

I'm trying to configure Apache Camel in Spring in the Java config way as detailed in this example. However I'm stuck at the dependency step because BundleContextAware and (transitively) BundleContext cannot be resolved. It seems that the necessary transitive dependencies are not downloaded. Here is my pom.xml:

<properties>
    <apache.camel.version>2.9.0</apache.camel.version>
</properties>

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-core</artifactId>
  <version>${apache.camel.version}</version>
</dependency>
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-spring</artifactId>
  <version>${apache.camel.version}</version>
</dependency>
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-spring-javaconfig</artifactId>
  <version>${apache.camel.version}</version>
</dependency>

Here's a code snippet from the example:

/**
 * Router from a file system to an ActiveMQ queue and then to a file system
 *
 * @version 
 */
@Configuration
public class MyRouteConfig extends SingleRouteCamelConfiguration 
    implements InitializingBean, BundleContextAware {

    private BundleContext bundleContext;
    ...
    ...
}

Upvotes: 3

Views: 2179

Answers (2)

justincohler
justincohler

Reputation: 159

The non-OSGI MyRouteConfig example is available here

Upvotes: 0

Claus Ibsen
Claus Ibsen

Reputation: 55555

Ah this example was refactored to also be deployable in OSGi. And therefore there is some OSGi classes in the sample code.

You should just remove that if you do not use OSGi, eg remove the code about BundleContextAware and BundleContext

Upvotes: 4

Related Questions