Affects Version/s: None
Fix Version/s: None
Environment:Window XP and WebLogic 10.3 using sun jdk
The first deploy of Liferay on Web logic 10.3 is successful. A second deploy fails with the following stack trace.
Sun JDK 1.6 stack trace
weblogic.application.ModuleException: [HTTP:101216]Servlet: "Main Servlet" failed to preload on startup in Web application: "liferay-portal-5.2.2".
Jrocket creates stack trace similar to this.
I tried to stop the liferay war before the deploy and it still fails with the same error. The only way to get a successful re deploy is to stop and start the server. ( I can't remember if an undeploy is required before the stop start of the server)
Note: The hibernate3.jar is available in the Web-inf/lib directory and contains org/hibernate/cache/CacheException.
After some investigation, the root cause of this seems to be related to mixing classes from different classloaders. The portal-kernal.jar, which is loaded by WebLogic server, contains the class com.liferay.portal.kernel.cache.CacheRegistry. The CacheRegistery allows Cache objects to be registered with it. The portal-impl.jar which is loaded by a lower level class loader registers Cache Objects in the CacheRegistery.
The glitch is that the CacheRegistry Object classloader does not have all of the dependencies required for the Cache Objects that are stored within it. So when the EHCache class tries to create a instance of the org.hibernate.cache.CacheException it is not available to the CacheRegistery classloader. Even though the org.hibernate.cache.CacheException is available to the portal-impl.jar
I moved the portal-kernal.jar and portal-service.jar to web-inf/lib and initial deployed liferay which was successful. I am now able to perform successful re-deploys with the above noted failure.
To actually fix, I would recommend moving the CacheRegistry out of the portal-kernal.jar and into the portal-impl.jar
Note: in 5.2.2 it looks like the CacheRegistry is only every referenced by by classes in portal-impl.jar