You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Shauna Harris <sh...@kusala.net> on 2013/05/09 15:05:24 UTC

Issue with Camel-aws (SQS) and aws-java-sdk-1.4.3

Hi there,

I'm getting an odd error trying to use Amazon SQS with Camel:

java.lang.NoSuchFieldError: timeOffset
	at
com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:857)
	at
com.amazonaws.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:617)
	at
com.amazonaws.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:785)
	at
org.apache.camel.component.aws.sqs.SqsEndpoint.doStart(SqsEndpoint.java:82)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
	at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1763)
	at
org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:931)
	at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:892)
	at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:475)

I'm using the latest aws-java-sdk-1.4.3 and have tried both camel-aws-2.10.4
and camel-aws-2.11.1-SNAPSHOT

Any help appreciated! Here is my test code:

public class SQSIntegrationTest extends CamelTestSupport {

    protected MockEndpoint resultEndpoint;
    private CamelContext camelContext;

    @Before
    public void setUp() throws Exception {
        super.setUp();
        resultEndpoint = (MockEndpoint) context.getEndpoint("mock:result");
    }

    @After
    public void tearDown() throws Exception {
        if (camelContext != null)
            camelContext.stop();
        super.tearDown();
    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        super.createCamelContext();
        camelContext = super.createCamelContext();
        return camelContext;
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        final String sqsUri =
String.format("aws-sqs://integ-test-1?amazonSQSEndpoint=%s&accessKey=%s&secretKey=%s",
                "http://sqs.eu-west-1.amazonaws.com/",
                "somethingValid", "somethingValid");

        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                        .to(sqsUri);
                from(sqsUri).to("mock:result");
            }
        };
    }

    @Test
    public void sendAndReceiveMessageFromQueue() throws Exception {
        String expectedBody = "Message";
        resultEndpoint.expectedBodiesReceived(expectedBody);

        template.sendBody("direct:start", expectedBody);
        Thread.sleep(1000);

        resultEndpoint.assertIsSatisfied();
    }
}





--
View this message in context: http://camel.465427.n5.nabble.com/Issue-with-Camel-aws-SQS-and-aws-java-sdk-1-4-3-tp5732228.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Issue with Camel-aws (SQS) and aws-java-sdk-1.4.3

Posted by Shauna Harris <sh...@kusala.net>.
Thanks, that helped me. I reverted to that version and fixed the original
problem I had there.



--
View this message in context: http://camel.465427.n5.nabble.com/Issue-with-Camel-aws-SQS-and-aws-java-sdk-1-4-3-tp5732228p5732504.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Issue with Camel-aws (SQS) and aws-java-sdk-1.4.3

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I suggest to use the AWS version that Camel 2.10.4 uses.

On Thu, May 9, 2013 at 3:05 PM, Shauna Harris <sh...@kusala.net> wrote:
> Hi there,
>
> I'm getting an odd error trying to use Amazon SQS with Camel:
>
> java.lang.NoSuchFieldError: timeOffset
>         at
> com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:857)
>         at
> com.amazonaws.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:617)
>         at
> com.amazonaws.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:785)
>         at
> org.apache.camel.component.aws.sqs.SqsEndpoint.doStart(SqsEndpoint.java:82)
>         at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>         at
> org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1763)
>         at
> org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:931)
>         at
> org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:892)
>         at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:475)
>
> I'm using the latest aws-java-sdk-1.4.3 and have tried both camel-aws-2.10.4
> and camel-aws-2.11.1-SNAPSHOT
>
> Any help appreciated! Here is my test code:
>
> public class SQSIntegrationTest extends CamelTestSupport {
>
>     protected MockEndpoint resultEndpoint;
>     private CamelContext camelContext;
>
>     @Before
>     public void setUp() throws Exception {
>         super.setUp();
>         resultEndpoint = (MockEndpoint) context.getEndpoint("mock:result");
>     }
>
>     @After
>     public void tearDown() throws Exception {
>         if (camelContext != null)
>             camelContext.stop();
>         super.tearDown();
>     }
>
>     @Override
>     protected CamelContext createCamelContext() throws Exception {
>         super.createCamelContext();
>         camelContext = super.createCamelContext();
>         return camelContext;
>     }
>
>     @Override
>     protected RouteBuilder createRouteBuilder() throws Exception {
>         final String sqsUri =
> String.format("aws-sqs://integ-test-1?amazonSQSEndpoint=%s&accessKey=%s&secretKey=%s",
>                 "http://sqs.eu-west-1.amazonaws.com/",
>                 "somethingValid", "somethingValid");
>
>         return new RouteBuilder() {
>             @Override
>             public void configure() throws Exception {
>                 from("direct:start")
>                         .to(sqsUri);
>                 from(sqsUri).to("mock:result");
>             }
>         };
>     }
>
>     @Test
>     public void sendAndReceiveMessageFromQueue() throws Exception {
>         String expectedBody = "Message";
>         resultEndpoint.expectedBodiesReceived(expectedBody);
>
>         template.sendBody("direct:start", expectedBody);
>         Thread.sleep(1000);
>
>         resultEndpoint.assertIsSatisfied();
>     }
> }
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Issue-with-Camel-aws-SQS-and-aws-java-sdk-1-4-3-tp5732228.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen