Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 899401 (JBEWS-171)

Summary: 1.0.2.CR2 - Tomcat5 - NoClassDefFoundError for webapps consuming Tomcat's data source
Product: [JBoss] JBoss Enterprise Web Server 1 Reporter: Juraci Paixão Kröhling <jcosta>
Component: unspecifiedAssignee: Permaine Cheung <pcheung>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: EWS 1.0.2CC: akostadinov, dknox, jcosta, jlanik, msadhukh, pcheung
Target Milestone: ---   
Target Release: EWS 1.0.2   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBEWS-171
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-22 21:22:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
DBTest.war none

Description Juraci Paixão Kröhling 2011-05-02 14:45:49 UTC
project_key: JBEWS

The following exception is thrown while deploying an application intending to consume Tomcat's connection pooling. Note that this is not the same exception that occured in CR1.

java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
	at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:152)
	at org.apache.commons.dbcp.BasicDataSourceFactory.getObjectInstance(BasicDataSourceFactory.java:144)
	at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
	at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
	at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:836)
	at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:583)
	at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:220)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4184)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:884)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:737)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

Comment 1 Aleksandar Kostadinov 2011-05-03 18:18:10 UTC
Juca, is this related to JBPAPP-6036? Can we close one of these and leave the other to track DBCP resolution?

Comment 2 Juraci Paixão Kröhling 2011-05-04 08:00:08 UTC
Probably related, but they are not the same problem. I think this class is part of another jar, which is present in Tomcat6 lib directory but not in Tomcat 5. The other issue is, at least for my tests, affecting only Tomcat 6. 

Comment 3 David Knox 2011-05-06 18:38:53 UTC
I have this working in rhel-5-ep-5 (dist-5E-ep-5) for both rpm distro and zip by commenting  +JAVA_OPTS="${JAVA_OPTS} -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory"

from /usr/bin/dtomcat5 (rpm distro) and catalina.sh (zip distro)

The zip distro packages tomcat-dbcp.jar where the rpm distro depends on commons-{pool,dbcp,collections}-tomcat5.jar. tomcat-dbcp.jar is a compilation of the latter three.


Comment 4 David Knox 2011-05-06 18:40:47 UTC
The webapp used for testing. metadata is for mysql

Comment 5 David Knox 2011-05-06 18:40:47 UTC
Attachment: Added: DBTest.war


Comment 6 Madhumita Sadhukhan 2011-05-06 21:39:26 UTC
Tested this with the jboss-ews-1.0.2 packages available at /JBEWS-1.0.2-CR2.I believe this is more of a packaging problem and not a real issue with tomcat 5 as I could not replicate the exception for jboss-ews-1.0.2-rhel4 and jboss-ews-1.0.2-rhel6 packages and it only turned up for jboss-ews-1.0.2-rhel5 for tomcat5.Also verified the presence of GenericObjectPool class within commons-pool.jar located in /jboss-ews-1.0/tomcat5/common/lib for rhel4 and rhel5 packages though it was missing in case of rhel5 package which correctly justifies the scenario.
We rather need to check here why the rhel5 package for ews1.0.2 is different from the others.

Comment 7 David Knox 2011-05-06 23:17:41 UTC
fixed and verified in tomcat5-5.5.33-14_patch_04.ep5.el6 and tomcat5-5.5.33-14_patch_04.ep5.el5.

el4 will be fixed next

Comment 8 David Knox 2011-05-10 17:45:37 UTC
fixed and verified in tomcat5-5.5.33-12_patch_04.ep5.el4

Comment 9 David Knox 2011-05-10 17:47:54 UTC
verified fixed in rhel-4, rhel-5, and jb-eap-5-rhel-6

Comment 10 Madhumita Sadhukhan 2011-05-17 12:26:59 UTC
Verified in EWS 1.0.2 CR3

Comment 11 Jiri Skrabal 2012-11-13 16:26:21 UTC
Docs QE Status: Removed: NEW