On 8/14/07, DominicTulley <[EMAIL PROTECTED]> wrote:
> This is a bit bizarre now...
>
> I duplicated your experiment with the examples jar and sure enough it all
> worked.
>
> So, I looked at my jar and the only significant difference I could see was
> that I didn't have a META-INF/spring/camel-context.xml in it.  So, I put one
> in (copied from the example that worked) and it started working.
>
> So,  do I need to have camel-context.xml in the jar (and if so, does it have
> to be in a spring subdirectory of META-INF)?

Definitely not. Basically all the discover-by-package code does is use
the classloaders to get the Package and iterate through them looking
for RouteBuilder.

The only use of a META-INF/spring/camel-context.xml is if you're using
Spring-OSGi - or you're using the camel:run maven plugin...
http://activemq.apache.org/camel/camel-maven-plugin.html



> Now, the really bizarre bit is that I took the camel-context.xml out again
> (to prove it really was the thing that mattered) and it still worked!
>
> So, I now have a jar which contains a RouteBuilder and the RouteBuilder is
> loaded and configured as it should be.  I just don't understand why.
> Perhaps ActiveMQ is caching something that's letting it work subsequently..
>
> I'd really like to get to the bottom of this - mainly so that this
> discussion thread can contain the solution for anyone else that encounters
> it..

Whoah thats really bizarre!

I'm at a bit of a loss to understand this. Just to double check I
understand whats going on - you're just using a binary ActiveMQ 5.x
distro - and popping your jar in activemq/lib and having this grief
right? And you're running ActiveMQ using bin/activemq? (or java -jar
run.jar).

Both are the same - and run this class...
https://svn.apache.org/repos/asf/activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/Main.java

which doesn't seem to have any kinda wacky code in it that I can see -
it just basically adds the URLs of all the files it finds to the
ClassLoader.

I wonder if rather than using the bin/activemq or run.jar, using some
kinda shell script to set the classpath works?
-- 
James
-------
http://macstrac.blogspot.com/

Reply via email to