Jetty webapps external jar files

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

Jetty webapps external jar files

johnrg
Hi,

I am new to jetty and I am using jetty version 9. I have an war file deployed to my app server. the web-inf/lib file has a few jar files  but I need to deploy some other jar files that are not included in the web-inf/lib

I tried to copy the jar file  into jetty.home/lib/ext    but this is not working.

please let me know how to do this so that the application can load the class files.

thanks
John
Reply | Threaded
Open this post in threaded view
|

Re: Jetty webapps external jar files

Jan Bartel-3
John,

If you want the external jars to behave as if they were in WEB-INF/lib, then you can specify them as extraClassPath using a context xml file. See this doco here: http://www.eclipse.org/jetty/documentation/current/jetty-classloading.html#adding-extra-classpaths

If you want them to act as being on the container's classpath, then you were on the right track in putting them in lib/ext. If you say it "didn't work", please describe what you mean by that. Perhaps you meant that they contain annotations and they weren't scanned? In that case, read the following doc which describes how to ensure that jars that are on the containers classpath are scanned: http://www.eclipse.org/jetty/documentation/current/configuring-webapps.html#webapp-context-attributes

Jan


On 24 April 2013 07:24, johnrg <[hidden email]> wrote:
Hi,

I am new to jetty and I am using jetty version 9. I have an war file
deployed to my app server. the web-inf/lib file has a few jar files  but I
need to deploy some other jar files that are not included in the web-inf/lib

I tried to copy the jar file  into jetty.home/lib/ext    but this is not
working.

please let me know how to do this so that the application can load the class
files.

thanks
John



--
View this message in context: http://jetty.4.x6.nabble.com/Jetty-webapps-external-jar-files-tp4960434.html
Sent from the Jetty Support mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Jan Bartel <[hidden email]>
www.webtide.com – Developer advice, services and support
from the Jetty & CometD experts.
Reply | Threaded
Open this post in threaded view
|

Re: Jetty webapps external jar files

johnrg
Hi,

When I copied the jar file in /lib/ext  I could not get the class loaded, I am using activiti worflow engine and the engine could not instantiate the class.. I do not have this problem if I deploy the jar in the web-inf/lib of the activiti war file. I had tried this is as a test  but this is not a solution.

I have tried another thing  , adding a jetty-web.xml file in the  jetty.home/etc folder  but I'm not able to make it work. I'm wondering where to copy the jar file.. i have my jar file copied in jetty.home/lib/my/jar     folder
how do I specify that  in the  fragment below, can you help

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
..
<Set name="extraClasspath>  ????????          >
Reply | Threaded
Open this post in threaded view
|

Re: Jetty webapps external jar files

vmreddy
This post has NOT been accepted by the mailing list yet.
Hi,

I Have certain configuration files that needs to be changed every time. So they are located in c:/app/conf folder. I want to make this folder as classpath in embedded jetty can u please suggest me ow to do this.

Thanks in advance....


johnrg wrote
Hi,

When I copied the jar file in /lib/ext  I could not get the class loaded, I am using activiti worflow engine and the engine could not instantiate the class.. I do not have this problem if I deploy the jar in the web-inf/lib of the activiti war file. I had tried this is as a test  but this is not a solution.

I have tried another thing  , adding a jetty-web.xml file in the  jetty.home/etc folder  but I'm not able to make it work. I'm wondering where to copy the jar file.. i have my jar file copied in jetty.home/lib/my/jar     folder
how do I specify that  in the  fragment below, can you help

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
..
<Set name="extraClasspath>  ????????          >