You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Samruben <ra...@gmail.com> on 2012/02/11 11:47:17 UTC

ERROR while running camel routing as war file

Hi 
I am new user to camel.

I have tried to route the message from one queue to other queue. while
running as java application, it works fine.
I have created war file using the same java file but am getting this error.

 ERROR - {1356bff3-d686-53fe-2640-165bffffffff} java.lang.NoSuchMethodError:
com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.ascendingMap()Ljava/util/Map;
java.lang.NoSuchMethodError:
com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.ascendingMap()Ljava/util/Map;
	at org.apache.camel.util.LRUCache.entrySet(LRUCache.java:123)

I dont have any idea about this error.  

java file:

public class JmsToFileRoute extends RouteBuilder {
	CamelContext context = new DefaultCamelContext();
    ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://localhost:61616");
  context.addComponent("test-jms",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
     context.addComponent("routing-jms",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
     context.addRoutes(new RouteBuilder() {
         public void configure() {
           
from("test-jms:queue:test.queue").to("routing-jms:queue:routing.queue");
             // set up a listener on the file component
            
             from("routing-jms:queue:routing.queue").process(new Processor()
{

                 public void process(Exchange e) {
                 	System.out.println("Received exchange: " + e.getIn());
                 }
             });
         }
     });
  
     context.start();
     Thread.sleep(1000);
     context.stop();
        
    }


--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5474775.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR while running camel routing as war file

Posted by Vincent Nonnenmacher <vi...@gmail.com>.
yes just saw that while updating my pom,
so confused (too recent play with guava I admit).

thanks for pointing that.

By the way, it seems that the m2eclipse plug-in can't grab anymore the
source/javadoc of the 2.10-SNAPSHOT
while I remembered it find the 2.9.0-SNAPSHOT fine.


On Sat, Feb 11, 2012 at 10:07 PM, Babak Vahdat
<ba...@swissonline.ch>wrote:

> Hi
>
> that dependency to the Google concurrentlinkedhashmap API is as expected
> which was introduced through [1] and gets shaded into the camel-core jar.
>
> [1] https://issues.apache.org/jira/browse/CAMEL-4345
>
> Babak
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5475666.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: ERROR while running camel routing as war file

Posted by Samruben <ra...@gmail.com>.
Thank you.........
I have got the problem resolved with your guidance.......
The problem is with jdk only.
Thank you so much :-)

--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5477461.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR while running camel routing as war file

Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi,

You misunderstood what I said about concurrentlinkedhashmap! It gets already
SHADED into the camel-core jar itself, check the content of [1] for this
purpose! So you do NOT have to include it by yourself.

As you get a java.lang.NoSuchMethodError I've got a strong suspection that
somewhere along your app you've got another version of that library which
gets loaded beforehand. So maybe check if you've got any other version of
that library somewhere.

[1]
http://repo1.maven.org/maven2/org/apache/camel/camel-core/2.9.0/camel-core-2.9.0.jar

Babak

--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5477374.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR while running camel routing as war file

Posted by Samruben <ra...@gmail.com>.
I have used jdk 1.6
but still I got the same error. As per your guidance, I have added
concurrentlinkedhashmap-lru-1.2 jar and tested, but still getting the same
error.

Which jar i need to implement in my war file?

jdk version jdk1.6.0_18.






--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5477220.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR while running camel routing as war file

Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi

that dependency to the Google concurrentlinkedhashmap API is as expected
which was introduced through [1] and gets shaded into the camel-core jar.

[1] https://issues.apache.org/jira/browse/CAMEL-4345

Babak

--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5475666.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR while running camel routing as war file

Posted by Vincent Nonnenmacher <vi...@gmail.com>.
On Sat, Feb 11, 2012 at 11:47 AM, Samruben <ra...@gmail.com> wrote:

> Hi
> I am new user to camel.
>
> I have tried to route the message from one queue to other queue. while
> running as java application, it works fine.
> I have created war file using the same java file but am getting this error.
>
>  ERROR - {1356bff3-d686-53fe-2640-165bffffffff}
> java.lang.NoSuchMethodError:
>
> com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.ascendingMap()Ljava/util/Map;
> java.lang.NoSuchMethodError:
>
> com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.ascendingMap()Ljava/util/Map;
>        at org.apache.camel.util.LRUCache.entrySet(LRUCache.java:123)
>
> I dont have any idea about this error.
>
>
sound like you have a missing librairie in your class path
strange reference to  com.googlecode.concurrentlinkedhashmap  for what
looks like an LRU cache building
from org.apache.camel.util.LRUCache.entrySet

perhaps there is a link to guava or old google collection somewhere in your
code ?

Re: ERROR while running camel routing as war file

Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi

JDK 1.7 is not supported yet, so try to make use of 1.6 to see if this was
the cause of the problem.

Babak

--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5475273.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR while running camel routing as war file

Posted by Samruben <ra...@gmail.com>.
camel version 2.9.0
jetty server
jdk1.7.0_02

 whether it might be any dependency issue? 


--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5475248.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR while running camel routing as war file

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

What version of Camel are you using?
And what JDK version?
And which web server are you using?




On Sat, Feb 11, 2012 at 11:47 AM, Samruben <ra...@gmail.com> wrote:
> Hi
> I am new user to camel.
>
> I have tried to route the message from one queue to other queue. while
> running as java application, it works fine.
> I have created war file using the same java file but am getting this error.
>
>  ERROR - {1356bff3-d686-53fe-2640-165bffffffff} java.lang.NoSuchMethodError:
> com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.ascendingMap()Ljava/util/Map;
> java.lang.NoSuchMethodError:
> com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.ascendingMap()Ljava/util/Map;
>        at org.apache.camel.util.LRUCache.entrySet(LRUCache.java:123)
>
> I dont have any idea about this error.
>
> java file:
>
> public class JmsToFileRoute extends RouteBuilder {
>        CamelContext context = new DefaultCamelContext();
>    ConnectionFactory connectionFactory = new
> ActiveMQConnectionFactory("tcp://localhost:61616");
>  context.addComponent("test-jms",
> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
>     context.addComponent("routing-jms",
> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
>     context.addRoutes(new RouteBuilder() {
>         public void configure() {
>
> from("test-jms:queue:test.queue").to("routing-jms:queue:routing.queue");
>             // set up a listener on the file component
>
>             from("routing-jms:queue:routing.queue").process(new Processor()
> {
>
>                 public void process(Exchange e) {
>                        System.out.println("Received exchange: " + e.getIn());
>                 }
>             });
>         }
>     });
>
>     context.start();
>     Thread.sleep(1000);
>     context.stop();
>
>    }
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/ERROR-while-running-camel-routing-as-war-file-tp5474775p5474775.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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