Is there anyway to get activeMQ to pick up a jar at runtime other than adding it to the activemqinstalldir/lib folder?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there anyway to get activeMQ to pick up a jar at runtime other than adding it to the activemqinstalldir/lib folder?

marcus.mathioudakis
Is there anyway to get activeMQ to pick up a jar at runtime other than adding it to the activemqinstalldir/lib folder? I have tried the --extidr option but can't get it to work....
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to get activeMQ to pick up a jar at runtime other than adding it to the activemqinstalldir/lib folder?

gtully
I did a quick sanity:

mv lib/kahadb-5.6.0.jar /tmp/ext
sh -x ./bin/activemq console --extdir /tmp/ext

and it worked.

sh -x ./bin/activemq console --extdir /tmpeee
gave me:
Extension directory specified is not valid directory: /tmpeee
Ignoring extension directory option.
and java.lang.NoClassDefFoundError:
org/apache/kahadb/util/DataByteArrayInputStream
as expected.

On 18 July 2012 13:43, marcus.mathioudakis
<[hidden email]> wrote:
> Is there anyway to get activeMQ to pick up a jar at runtime other than adding
> it to the activemqinstalldir/lib folder? I have tried the --extidr option
> but can't get it to work....
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Is-there-anyway-to-get-activeMQ-to-pick-up-a-jar-at-runtime-other-than-adding-it-to-the-activemqinst-tp4654121.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



--
http://fusesource.com
http://blog.garytully.com
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to get activeMQ to pick up a jar at runtime other than adding it to the activemqinstalldir/lib folder?

marcus.mathioudakis
Gary thanks for your prompt reply, I did a fresh install and it now seems to be working as mentioned above. My problem is however that I have jars in different levels of a lib folder hierarchy, which I would like to all be picked up. So for example OSBA.jar is in somefolder and hrules.jar is in somefolder/lib, and I would like for activemq to find both of them on startup. However extdirs doesn't seem to accept multiple directories as arguments, and only searches the given folder for jars (without looking into nested folders). Is there any way of doing this, or do I have to place every single jar I want picked up into one folder?
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to get activeMQ to pick up a jar at runtime other than adding it to the activemqinstalldir/lib folder?

gtully
It looks like you can repeat --extdir to provide multiple values

there is also the activemq.classpath system property that is a list,
it can be specified in the start script via env ACTIVEMQ_CLASSPATH

have a peek at http://svn.apache.org/viewvc/activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/Main.java?view=markup

to see how the classloader is configured and --extdir is parsed.


On 19 July 2012 16:00, marcus.mathioudakis
<[hidden email]> wrote:

> Gary thanks for your prompt reply, I did a fresh install and it now seems to
> be working as mentioned above. My problem is however that I have jars in
> different levels of a lib folder hierarchy, which I would like to all be
> picked up. So for example OSBA.jar is in somefolder and hrules.jar is in
> somefolder/lib, and I would like for activemq to find both of them on
> startup. However extdirs doesn't seem to accept multiple directories as
> arguments, and only searches the given folder for jars (without looking into
> nested folders). Is there any way of doing this, or do I have to place every
> single jar I want picked up into one folder?
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Is-there-anyway-to-get-activeMQ-to-pick-up-a-jar-at-runtime-other-than-adding-it-to-the-activemqinst-tp4654121p4654177.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



--
http://fusesource.com
http://blog.garytully.com
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to get activeMQ to pick up a jar at runtime other than adding it to the activemqinstalldir/lib folder?

marcus.mathioudakis
Many thanks for your detailed response, when using --extdir multiple times it works as hoped :).
I don't mean to nitpick, but this usage of --extdir seems somewhat counter intuitive, and  doesn't seem to be documented anywhere. I think it would make it easier if you just added a note that makes this usage clear to the task option line
" --extdir <dir>  - Add the jar files in the directory to the classpath."
displayed when typing "activemq -?".

Thanks again!