camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: aws-sqs queue running into exception
Date Thu, 19 May 2011 15:53:49 GMT
Hi

You have mixed versions of Camel on your classpath.

The log say Camel 2.5.0
rg.apache.camel.impl.DefaultCamelContext  - Apache Camel 2.5.0
(CamelContext: camel-1) is starting


On Thu, May 19, 2011 at 5:48 PM, Sri <sri.tech97@googlemail.com> wrote:
> Hello all,
>
> I am trying to create a queue from aws-sqs with valid credentials.But it is
> running into exception when I start it .
>
> Following is the sample code that I used.
>
> JDK 1.6
> Camel :2.8-SNAPSHOT
>
>
>
>                JndiRegistry jndi = new JndiRegistry(new JndiContext());
>                AWSCredentials awsCredentials = new BasicAWSCredentials(
>                                "validaccesskey",
>                                "validSecretKey");
>                AmazonSQSClient sqsClient = new AmazonSQSClient(awsCredentials);
>                //sqsClient.setEndpoint("someendpoint");
>                jndi.bind("amazonSQSClient", sqsClient);
>
>                final CamelContext context = new DefaultCamelContext(jndi);
>
>                context.addRoutes(new RouteBuilder() {
>                        public void configure() {
>                                //
>
> from("aws-sqs://sample-notification-sqs?amazonSQSClient=#amazonSQSClient&delay=5000&maxMessagesPerPoll=10")
>                                                .process(new Processor()
{
>                                                        public
void process(Exchange exchange)
>                                                          
             throws Exception {
>                                                          
     Logger logger = LoggerFactory
>                                                          
                     .getLogger("SQSConsumer");
>                                                          
     String jsonstring = "{"
>                                                          
                     + exchange.getIn().toString() + "}";
>                                                          
     JSONObject myjson = new JSONObject(jsonstring);
>
>                                                          
     JSONObject mymessage = myjson
>                                                          
                     .getJSONObject("Message");
>                                                          
     logger.debug("Message: {}", mymessage.get(
>                                                          
                     "Message").toString());
>                                                        }
>                                                });
>                        }
>                });
>
>                context.start();
>
> and the exception is
>
>
>
> 2011-05-19 16:33:25,971 [main] INFO
> org.apache.camel.impl.DefaultCamelContext  - Apache Camel 2.5.0
> (CamelContext: camel-1) is starting
> 2011-05-19 16:33:25,972 [main] INFO
> org.apache.camel.impl.DefaultCamelContext  - HandleFault is enabled on
> CamelContext: camel-1
> 2011-05-19 16:33:25,974 [main] INFO
> org.apache.camel.impl.DefaultCamelContext  - JMX enabled. Using
> ManagedManagementStrategy.
> 2011-05-19 16:33:26,466 [main] INFO
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader  - Found 6
> packages with 17 @Converter classes to load
> 2011-05-19 16:33:26,506 [main] INFO
> org.apache.camel.impl.converter.DefaultTypeConverter  - Loaded 157 type
> converters in 0.354 seconds
> Exception in thread "main" java.lang.NoSuchMethodError:
> org.apache.camel.impl.ScheduledPollConsumer: method
> <init>(Lorg/apache/camel/Endpoint;Lorg/apache/camel/Processor;)V not found
>        at
> org.apache.camel.component.aws.sqs.SqsConsumer.<init>(SqsConsumer.java:58)
>        at
> org.apache.camel.component.aws.sqs.SqsEndpoint.createConsumer(SqsEndpoint.java:64)
>        at
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:61)
>        at
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
>        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:118)
>        at
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1694)
>        at
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1620)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1419)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1314)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1213)
>        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:65)
>        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
>        at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1191)
>        at com.optasports.hyperion.SQSHandler.main(SQSHandler.java:62)
>
>
>
>
> Regards
> Sri
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/aws-sqs-queue-running-into-exception-tp4410078p4410078.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message