Foren

Liferay 6.0.6: util-java.jar not loaded at runtime.

Darshan Maharana, geändert vor 12 Jahren.

Liferay 6.0.6: util-java.jar not loaded at runtime.

Junior Member Beiträge: 65 Beitrittsdatum: 29.05.07 Neueste Beiträge
Hi All,

This issue is related to ext environment in Liferay 6.0.6

Using ServletResponseUtil class (which is in util-java.jar) in struts portlet in ext causes
following runtime exception.

java.lang.NoClassDefFoundError: com/liferay/util/servlet/ServletResponseUtil


Adding portal-dependency-jars=util-java.jar in liferay-plugin-package.properties has no effect.

There are quite a few posts pointing to util-java.jar loading issue but haven't found a
solution so far.

Any pointers ?

thanks,

-darshan
thumbnail
Thiago Leão Moreira, geändert vor 12 Jahren.

RE: Liferay 6.0.6: util-java.jar not loaded at runtime.

Liferay Legend Beiträge: 1449 Beitrittsdatum: 10.10.07 Neueste Beiträge
Do you mean "EXT plugin" instead of "EXT environment" right? EXT environment does not exist for 6.0.X series.

Since you are developing an EXT plugin you don't need to make reference to a class/lib that already exist in Liferay core. Can you post the whole stacktrace?
Darshan Maharana, geändert vor 12 Jahren.

RE: Liferay 6.0.6: util-java.jar not loaded at runtime.

Junior Member Beiträge: 65 Beitrittsdatum: 29.05.07 Neueste Beiträge
Thanks for the response Thiago.

> Do you mean "EXT plugin" instead of "EXT environment" right?
You are right. I mean EXT plugin.

Although util-java.jar exists in ROOT/WEB-INF/lib, portlets in ext plugin
using classes from util-java.jar get NoClassDefFoundError exception.

As a workaround, I added util-java.jar to ext-lib/global in the ext plugin
and this seems to work as util-java.jar gets copied to <tomcat>/lib/ext
upon ext deployment. But is this the right way ? I hope this workaround
doesn't cause issues elsewhere as there are two now copies of util-java.jar.

Same issue arises for commons-io.jar & commons-lang.jar (apache utility
classes). I have added even these jars to ext-lib/global which causes them
to get copied to <tomcat>/lib/ext upon ext deployment.

-darshan
thumbnail
Nagendra Kumar Busam, geändert vor 12 Jahren.

RE: Liferay 6.0.6: util-java.jar not loaded at runtime.

Liferay Master Beiträge: 678 Beitrittsdatum: 07.07.09 Neueste Beiträge
You should be able to access util-*.jars of Liferay from ext plugin directly - becuase these jars at portal level (Liferay core).

Can you post your Java code to check how you are actually invoking the mentioned class