Bug 969023 - Tomcat7: ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourceFactory
Tomcat7: ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourceFactory
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Web Server 2
Classification: JBoss
Component: tomcat7 (Show other bugs)
2.0.1
Unspecified Unspecified
unspecified Severity urgent
: ---
: 2.0.1
Assigned To: David Knox
Libor Fuka
http://jira.jboss.org/jira/browse/JBE...
:
Depends On: JBEWS-178
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-30 09:50 EDT by Michal Haško
Modified: 2015-11-01 19:18 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Due to incorrect naming for packages (<literal>o.a.tomcatdbcp</literal> instead of <literal>o.a.commons.dbcp</literal>) in the Red Hat Enterprise Linux distribution of the JBoss Enterprise Web Server files, an exception displayed when a lookup is attempted for a Tomcat JNDI datasource: <screen>ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourceFactory</screen> The naming is now corrected and the correct class is located as expected in JBoss Enterprise Web Server 2.0.1.
Story Points: ---
Clone Of: JBEWS-178
Environment:
Last Closed: 2014-01-03 07:58:54 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBEWS-178 Critical Closed Tomcat7: ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory 2018-06-14 16:55 EDT

  None (edit)
Description Michal Haško 2013-05-30 09:50:49 EDT
Reopened, similar to bz#900806, but has the other class name:

900806: ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
this:   ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourceFactory

Found in tomcat7 from RHEL6 2.0.1-ER2 zip distribution:
jboss-ews-application-servers-2.0.1-ER2-RHEL6-i386.zip
jboss-ews-application-servers-2.0.1-ER2-RHEL6-x86_64.zip

tomcat7/lib/commons-dbcp-eap6.jar contains:
org/apache/tomcat/dbcp/dbcp/BasicDataSourceFactory.class

+++ This bug was initially created as a clone of Bug #900806 +++

project_key: JBEWS

I got java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory, when I was trying to lookup name for Tomcat JNDI datasource. 

Same operation is working well on Apache Tomcat 7.0.29 Upstream Project distribution downloaded from Tomcat's site.

ER4: When I replaced tomcat-dbcp.jar in Tomcat/EWS distribution with the same file from Tomcat/Upstream Project distribution, everything was OK. 

ER7: in this build the file tomcat-dbcp.jar is missing, when I put there file from Tomcat/Upstream, everything was OK.

Log: [http://pastebin.test.redhat.com/102966]

--- Additional comment from Zbyněk Roubalík on 2012-08-21 14:10:44 EDT ---

Link: Added: This issue relates to JBPAPP-9551


--- Additional comment from Permaine Cheung on 2012-08-21 14:17:44 EDT ---

David, can you please take a look? Thanks

--- Additional comment from David Knox on 2012-08-21 15:48:21 EDT ---

This is a repeat of jbpapp-6306 and jbpapp-3749.

The EWS/tomcat builds do not include tomcat-dbcp. Instead, commons-dbcp, commons-collections, and commons-pool. There is little difference between the two since tomcat-dbcp is a conglomerate of the three changing the package name to o.a.tomcat.dbcp versus o.a.commons.dbcp

If using the RPM distro - edit /etc/tomcatX/tomcatx.conf. Search for 3749 and delete the comment from the JAVA_OPTS line. 

If using the Zip distro - edit catalina.sh. Search for JAVA_OPTS. Beneath the commented SecurityListener add one line:
JAVA_OPTS="$JAVA_OPTS -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory"

The above was done previously viz 6306 and 3749. I will go through all of the ews1,2 builds and remove the comment from tomcatx.conf for the rpms, and fix catalina.sh in the zip. When that's done I'll resolve and reassign to Permaine.

--david


--- Additional comment from Zbyněk Roubalík on 2012-08-22 05:14:56 EDT ---

I'm using ZIP distro, I put the line in catalina.sh, but it isn't working. 

I got an exception: [http://pastebin.test.redhat.com/103044]

--- Additional comment from David Knox on 2012-08-22 11:13:40 EDT ---

Yep. I ran into that last night. It seems there is a packaging problem, i.e., the wrong package name (o.a.tomcat. versus o.a.commons). Wei Nan and I are working on it.

--- Additional comment from David Knox on 2012-08-22 12:51:19 EDT ---

The second problem above is because the java package 
names between commons-[collections,pool,dbcp]-tomcat-eap6 do not agree. 

The java package name in collections,pool-tomcat-eap6 jars is 
org.apache.tomcat, while the java package name in both dbcp jars 
is org.apache.commons 

The java package names among the three jars must be 
org.apache.commons or org.apache.tomcat.dbcp.

--- Additional comment from David Knox on 2012-08-22 12:52:29 EDT ---

To fix the commons-dbcp package

--- Additional comment from Permaine Cheung on 2012-08-23 08:32:28 EDT ---

Weinan, please work with David on this one to see what is needed by Tomcat.

--- Additional comment from Weinan Li on 2012-09-13 00:19:24 EDT ---

We have uniformed name of all these -eap6 packages. Currently the package name:

[./org/apache/tomcat/dbcp/dbcp/BasicDataSourceFactory.class]

I'll verify the tomcat7 in ER9.

--- Additional comment from Weinan Li on 2012-09-13 08:30:11 EDT ---

Verified the bug has been fixed in our tomcat7. Here is the detail information: [https://gist.github.com/3713978]

--- Additional comment from Zbyněk Roubalík on 2012-09-20 04:20:38 EDT ---

Verified on EWS 2.0.0.ER10

--- Additional comment from Jiri Skrabal on 2012-11-13 11:26:24 EST ---

Docs QE Status: Removed: NEW
Comment 1 Michal Haško 2013-06-03 04:28:39 EDT
tomcat7/catalina.sh from jboss-ews-application-servers-2.0.1-ER2-RHEL6-x86_64.zip contains:

catalina.sh:JAVA_OPTS="${JAVA_OPTS} -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory"

but tomcat7/lib/commons-dbcp-eap6.jar contains class:
org/apache/tomcat/dbcp/dbcp/BasicDataSourceFactory.class
Comment 2 Weinan Li 2013-06-03 04:30:35 EDT
Dave, could you please check this? Thanks!
Comment 3 David Knox 2013-06-03 11:46:08 EDT
yes - i'll look into it again....
Comment 4 Michal Haško 2013-06-07 06:34:28 EDT
The same issue appeared on RHEL5 on 2.0.1-CR1.
The issue is now present on all RHEL {5,6} and {i386,x86_64} combinations.
Comment 5 Jean-frederic Clere 2013-06-14 05:00:07 EDT
the text looks ok.
Comment 6 Michal Haško 2013-06-25 08:47:42 EDT
VERIFIED on EWS-2.0.1-CR3 RHEL5/6 i386/x86_64 Sun/Open/IBM JDK

Note You need to log in before you can comment on or make changes to this bug.