Foros de discusión

How to add the external jar files globally in lifreray 7 ?

lokesh gorrela, modificado hace 7 años.

How to add the external jar files globally in lifreray 7 ?

Regular Member Mensajes: 173 Fecha de incorporación: 9/03/16 Mensajes recientes
Hi guys
I added below jar files in my workspace location D:\liferay7dbupgradation\bundles\tomcat-8.0.32\lib\ext
asm-5.0.3.jar
axis-1.4.jar
commons-codec-1.6.jar
commons-discovery-0.4.jar
commons-io-2.4.jar
commons-logging-1.1.3.jar
httpclient-4.3.6.jar
httpcore-4.3.3.jar
jaxrpc-api-1.1.jar

I want access these jar files in my newly created module. Any one knows about this please tell the process. It is great help to me.
Thanks
With Regard's
Lokesh
thumbnail
Olaf Kock, modificado hace 7 años.

RE: How to add the external jar files globally in lifreray 7 ?

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
lokesh gorrela:
I added below jar files in my workspace location D:\liferay7dbupgradation\bundles\tomcat-8.0.32\lib\ext
...
I want access these jar files in my newly created module. Any one knows about this please tell the process.


Please declare them as dependencies for your module as OSGI uses a different classloading mechanism than plain tomcat/webapps. Just as is already being discussed here
thumbnail
David H Nebinger, modificado hace 7 años.

RE: How to add the external jar files globally in lifreray 7 ?

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Actually I wouldn't do this for these jars.

These are libraries that Liferay also has in ROOT/WEB-INF/lib. Whenever you promote jars to the global class loader you have to remember that all of the dependencies for these jars also need to be global (lest you run into weird class loader issues). You also run into introducing problems for Liferay if you are using a different version in global jars than what Liferay is using.

As olaf pointed to the other thread where the correct way of doing this, I don't have to reference it again.






Come meet me at the LSNA!