Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7405

SQS endpoint - HttpRoute class not found at route startup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.13.0
    • 2.13.2, 2.14.0
    • camel-aws, karaf
    • None
    • Unknown

    Description

      I have a bundle using aws-sqs endpoint that works in Karaf 2.3.3 and Camel 2.12.1. We have to upgrade Karaf 2.3.5 and Camel to 2.13.0 for required improvements, and now my bundle fails to load because of missing classes. I would be satisfied to know which packages to include in my imports or which feature I may be missing, I have run the below steps in two versions of Camel. The bundle works in 2.12.1 and fails in 2.13.0. Here are the steps for version 2.13.0:

      $ mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-blueprint -DarchetypeVersion=2.13.0 -DgroupId=com.example.aws -DartifactId=example-aws -Dpackage=com.example.aws -Dversion=2.13.0
      $ mvn package
      $ mvn camel:run
      (verifies archetype runs)

      Add dependency to pom.xml
      <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-aws</artifactId>
      <version>2.13.0</version>
      </dependency>

      Add following to maven-bundle-plugin in pom.xml
      <Import-Package>
      org.apache.http.conn.routing;version="[4.3.3,5)",
      *
      </Import-Package>

      Change endpoint in blueprint.xml
      <to uri="aws-sqs://test-queue?accessKey=yourkey&secretKey=yourkey" />

      (need to change or skip test to package)
      $ mvn -Dmaven.test.skip=true package
      $ mvn camel:run
      (above works, so maven is including all classes)

      Install Karaf 2.3.5
      Set JAVA_HOME to JDK 1.7.0_51
      karaf@root> features:chooseurl camel 2.13.0
      karaf@root> features:install camel-core
      karaf@root> features:install camel-blueprint
      karaf@root> features:install camel-aws

      Drop bundle into deploy folder and observe the following stack trace in the Karaf console:
      karaf@root> ERROR: Bundle example-aws [70] EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: org.apache.http.conn.routing.HttpRoute not found by org.apache.servicemix.bundles.aws-java-sdk [68])
      java.lang.NoClassDefFoundError: org.apache.http.conn.routing.HttpRoute not found by org.apache.servicemix.bundles.aws-java-sdk [68]
      at com.amazonaws.http.conn.$Proxy36.<clinit>(Unknown Source)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at java.lang.reflect.Proxy.newInstance(Proxy.java:748)
      at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
      at com.amazonaws.http.conn.ClientConnectionManagerFactory.wrap(ClientConnectionManagerFactory.java:42)
      at com.amazonaws.http.impl.client.SdkHttpClient.<init>(SdkHttpClient.java:29)
      at com.amazonaws.http.HttpClientFactory.createHttpClient(HttpClientFactory.java:98)
      at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:155)
      at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:118)
      at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:102)
      at com.amazonaws.services.sqs.AmazonSQSClient.<init>(AmazonSQSClient.java:166)
      at com.amazonaws.services.sqs.AmazonSQSClient.<init>(AmazonSQSClient.java:147)
      at org.apache.camel.component.aws.sqs.SqsEndpoint.createClient(SqsEndpoint.java:219)
      at org.apache.camel.component.aws.sqs.SqsEndpoint.getClient(SqsEndpoint.java:204)
      at org.apache.camel.component.aws.sqs.SqsEndpoint.doStart(SqsEndpoint.java:81)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)

      (remaining stack omitted)

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              jeltgroth Jeff Eltgroth
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: