Foren

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

lokesh gorrela, geändert vor 7 Jahren.

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

Regular Member Beiträge: 173 Beitrittsdatum: 09.03.16 Neueste Beiträge
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, geändert vor 7 Jahren.

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

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
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, geändert vor 7 Jahren.

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

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
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!