Hi Luis,

When using method [1] does the jar have to be manually dropped into a common folder defined in the config?  That would be a pain.

What would be great if i could add some meta in the jar which means it gets picked up by the common loader when scanned by future wars

i have lookeds into EARs but I need some time to get my head around it. At the moment I use Tomcat virtual hosts in production although I want to change it so that httpd is doing the proxying

On 31/10/2018 14:06, Luis Rodríguez Fernández wrote:
Hello Matthew,

Probably the common classloader is the place for your jar, see [1]

Otherwise you could also packed all your apps in an .ear file and add your
.jar there. In tomee you can deploy .ear files as well [2]. For this
approach you have to declare the apps folder in conf/tomee.xml

<tomee>
   <!-- see http://tomee.apache.org/containers-and-resources.html -->

   <!-- activate next line to be able to deploy applications in apps -->
   <Deployments dir="apps" autoDeploy="true"/>
</tomee>


Hope it helps,

Luis

[1] https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html
[2] http://tomee.apache.org/deploying-in-tomee.html

El mié., 31 oct. 2018 a las 13:54, Matthew Broadhead
(<[email protected]>) escribió:

seems like this must have been asked before...i have been moving some
common database code into a jar file and it works great.  but it is
included in several wars and those projects load the jar individually
each time.  i wondered if there is a way to load a jar only once into
TomEE and have it commonly accessed across all webapps?



Reply via email to