eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
381 stars 143 forks source link

java.lang.ClassCastException with "jk-enabled" attribute and a webapp which use common-logging is deployed #9206

Closed glassfishrobot closed 15 years ago

glassfishrobot commented 15 years ago

I'm trying to deploy liferay webapps against the latest V3 build (B60) on linux platform.

If I follow all steps well described here (http://weblogs.java.net/blog/amyroh/archive/2009/06/running_glassfi.html) in order to enable the communication between apache and glassfish, with all liferay webapps deployed I receive the following error during the startup:

INFO: ERROR: Error starting reference:file:/opt/Glassfish/glassfish/modules/osgi-main.jar (org.osgi.framework.BundleException: Activator start error in bundle com.sun.enterprise.osgi-adapter [47].) java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.apache.catalina.connector.Connector.initialize(Connector.java:1609) at com.sun.enterprise.web.connector.coyote.PECoyoteConnector.initialize(PECoyoteConnector.java:756) at com.sun.enterprise.web.WebConnector.initialize(WebConnector.java:58) at org.apache.catalina.startup.Embedded.start(Embedded.java:938) at com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:547) at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:174) at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:89) at java.security.AccessController.doPrivileged(Native Method) at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:86) at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77) at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58) at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107) at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60) at org.glassfish.internal.data.EngineInfo.getContainer(EngineInfo.java:78) at com.sun.enterprise.v3.server.ApplicationLifecycle.startContainers(ApplicationLifecycle.java:657) at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:418) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:235) at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:306) at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:147) at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:174) at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:89) at java.security.AccessController.doPrivileged(Native Method) at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:86) at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77) at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58) at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107) at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60) at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:236) at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:129) at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:460) at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:404) at org.jvnet.hk2.osgiadapter.HK2Main.start(HK2Main.java:121) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589) at org.apache.felix.framework.Felix.startBundle(Felix.java:1461) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:779) at org.jvnet.hk2.osgimain.Main.start(Main.java:117) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589) at org.apache.felix.framework.Felix.startBundle(Felix.java:1461) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:984) at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:263) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.ClassCastException: org.apache.commons.logging.impl.LogFactoryImpl cannot be cast to org.apache.commons.logging.LogFactory at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:506) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381) at org.apache.jk.server.JkCoyoteHandler.(JkCoyoteHandler.java:81) ... 43 more Caused by: java.lang.ClassCastException: org.apache.commons.logging.impl.LogFactoryImpl cannot be cast to org.apache.commons.logging.LogFactory at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:504)

(pls, note that all starts from org.apache.jk.server.JkCoyoteHandler).

Now. I cannot give you the single webapp, but surely I can tell you how to reproduce:

1) create a new blank domain (let's call it liferay) on your glassfish box

2) download liferay package from here: http://sourceforge.net/projects/lportal/files/Liferay%20Portal/liferay-portal-glassfish-5.2.3.zip (yes, it already comes with a V3 glassfish, but with a too old build)

3) unzip it and copy all files from [...]domains/domain1/autodeploy to your [...]domains/liferay/autodeploy folder

4) remove your [...]liferay/lib and put it the lib folder from [...]domains/domain1/lib

5) Done. Startup your glassfish box with "jk-enabled" attribute and you should see the above stacktrace. Then, try to remove the jk-enabled attribute, and all will work properly.

Let me know, if I can help you in anyway.

Environment

Operating System: All Platform: Linux

Affected Versions

[V3]

glassfishrobot commented 6 years ago
glassfishrobot commented 15 years ago

@glassfishrobot Commented @amyroh said: Duplicate of 8866 which is fixed. Thanks Jan!

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-9206

glassfishrobot commented 15 years ago

@glassfishrobot Commented Reported by freebits

glassfishrobot commented 15 years ago

@glassfishrobot Commented Marked as duplicate on Wednesday, September 16th 2009, 6:47:32 am