Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
Summary: tomcat-dbcp.jar is missing
https://bugzilla.redhat.com/show_bug.cgi?id=819087
Summary: tomcat-dbcp.jar is missing Product: Fedora Version: 17 Platform: Unspecified OS/Version: Linux Status: NEW Severity: unspecified Priority: unspecified Component: tomcat AssignedTo: ivan.afonichev@gmail.com ReportedBy: samuel-rhbugs@sieb.net QAContact: extras-qa@fedoraproject.org CC: akurtako@redhat.com, java-sig-commits@lists.fedoraproject.org, ivan.afonichev@gmail.com, kdaniel@redhat.com Classification: Fedora Story Points: --- Type: Bug Regression: --- Mount Type: --- Documentation: ---
The tomcat-dbcp.jar file is missing from the tomcat package. This means that jdbc resources don't work. You get the following error when tomcat tries to start the app:
WARNING: Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]
I copied the jar file from the upstream zip file and now it works.
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=819087
--- Comment #1 from Ivan Afonichev ivan.afonichev@gmail.com 2012-05-04 16:25:52 EDT --- Fedora tomcat and tomcat6 are using apache-commons-dbcp instead of tomcat-dbcp In fact it seems that there is no tomcat code for tomcat-dbcp Tomcat use commons-dbcp sources to build it's tomcat-dbcp As far as I understand it's not so good behavior for fedora package.
<replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons" encoding="ISO-8859-1"> <replacefilter token="org.apache.commons" value="org.apache.tomcat.dbcp" /> </replace> <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl" encoding="ISO-8859-1"> <replacefilter token="enum" value="enumeration" /> </replace>
<mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" /> <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp"> <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" /> </move>
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=819087
--- Comment #2 from Samuel Sieb samuel-rhbugs@sieb.net 2012-05-04 17:29:18 EDT --- It turns out that that jar may be unnecessary. It appears that the class tomcat was looking for (org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory) is some sort of default. After discovering what I found in bug 819087, I removed tomcat-dbcp.jar and the error didn't come back.
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=819087
--- Comment #3 from Samuel Sieb samuel-rhbugs@sieb.net 2012-05-04 17:46:57 EDT --- The bug number was supposed to be bug 819112, not self-referential. Anyways, it's still strange that an upstream file is not included, but if it's not necessary, then I guess it doesn't matter.
https://bugzilla.redhat.com/show_bug.cgi?id=819087
--- Comment #4 from Eric Hopper eric-bugs2@omnifarious.org --- This is a big problem for me. It's preventing me from being able to deploy Gerrit as this config totally fails to publish the appropriate JNDC resource:
<Resource name="jdbc/ReviewDb" auth="Container" type="javax.sql.DataSource" driverClassName="org.h2.Driver" url="jdbc:h2:/var/opt/gerrit/db/ReviewDB"/>
And the errors point to org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory being missing. The people on #tomcat think this is a problem too.
https://bugzilla.redhat.com/show_bug.cgi?id=819087
--- Comment #5 from Ivan Afonichev ivan.afonichev@gmail.com --- [van@oec-src ~]$ cat /etc/tomcat/Catalina/localhost/gerrit.xml <?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="true" allowCasualMultipartParsing="true" path="/gerrit">
<Resource name="jdbc/ReviewDb" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://dbhost:5432/reviewdb" username="gerrit2" password="******" maxActive="20" maxIdle="10" maxWait="-1"/> </Context>
Gerrit is working fine for me on tomcat-7.0.27-2.fc17.noarch with this context. As far as I know including libs that are just renamed java packages of other official libs that are available as fedora packages does not meet Fedora requirements. As workaround we can add this Resource "factory" recommendations into some readme file in package...
https://bugzilla.redhat.com/show_bug.cgi?id=819087
--- Comment #6 from Eric Hopper eric-bugs2@omnifarious.org --- It still doesn't work for me... in /etc/tomcat/Catalina/localhost/gerrit.xml
<?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="true" allowCasualMultipartParsing="true" path="/gerrit"> <Resource name="jdbc/ReviewDb" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" driverClassName="org.h2.Driver" url="jdbc:h2:/var/opt/gerrit/db/ReviewDB" username="" password="" maxActive="20" maxIdle="10" maxWait="-1"/> </Context>
And here is what I see in /var/log/tomcat/catalina.out:
Jun 01, 2012 6:01:03 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib Jun 01, 2012 6:01:03 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"] Jun 01, 2012 6:01:03 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Jun 01, 2012 6:01:03 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 323 ms Jun 01, 2012 6:01:03 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Jun 01, 2012 6:01:03 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.27 Jun 01, 2012 6:01:03 PM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor /etc/tomcat/Catalina/localhost/gerrit.xml Jun 01, 2012 6:01:05 PM org.apache.catalina.core.NamingContextListener addResource WARNING: Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]
https://bugzilla.redhat.com/show_bug.cgi?id=819087
Philippe Banwarth philippe@banwarth.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |philippe@banwarth.net
--- Comment #7 from Philippe Banwarth philippe@banwarth.net ---
As of tomcat 7.0.29-1fc17 it seems that declaring the factory (in the context or via JAVA_OPTS) is not sufficient.
I had to add the commons pool library
ln -s /usr/share/java/apache-commons-pool.jar /usr/share/tomcat/lib/
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
Ivan Afonichev ivan.afonichev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution|--- |NOTABUG Last Closed| |2013-02-03 16:44:14
--- Comment #8 from Ivan Afonichev ivan.afonichev@gmail.com --- Link to /usr/share/java/apache-commons-pool.jar already exists in tomcat-lib rpm
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
Ivan Afonichev ivan.afonichev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gsgjzozo@gmail.com
--- Comment #9 from Ivan Afonichev ivan.afonichev@gmail.com --- *** Bug 916417 has been marked as a duplicate of this bug. ***
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
Sebastien Pasche braoru@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|unspecified |high CC| |braoru@gmail.com Version|17 |18 Severity|unspecified |urgent
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
--- Comment #10 from Sebastien Pasche braoru@gmail.com --- The bug is present again in fedora 18 :-(
There is information about my install :
[root@mgbwimi10 lib]# rpm -q tomcat-lib tomcat-lib-7.0.37-1.fc18.noarch [root@mgbwimi10 lib]# pwd /usr/share/tomcat/lib [root@mgbwimi10 lib]# ll total 3784 -rw-r--r--. 1 root root 15275 Feb 19 22:40 annotations-api.jar -rw-r--r--. 1 root root 54800 Feb 19 22:40 catalina-ant.jar -rw-r--r--. 1 root root 132510 Feb 19 22:40 catalina-ha.jar -rw-r--r--. 1 root root 1561168 Feb 19 22:40 catalina.jar -rw-r--r--. 1 root root 254822 Feb 19 22:40 catalina-tribes.jar lrwxrwxrwx. 1 root root 46 Apr 24 16:46 commons-collections.jar -> /usr/share/java/apache-commons-collections.jar lrwxrwxrwx. 1 root root 39 Apr 24 16:46 commons-dbcp.jar -> /usr/share/java/apache-commons-dbcp.jar -rw-r--r--. 1 root root 123093 Feb 19 22:40 jasper-el.jar -rw-r--r--. 1 root root 597932 Feb 19 22:40 jasper.jar lrwxrwxrwx. 1 root root 23 Apr 24 16:46 jasper-jdt.jar -> /usr/share/java/ecj.jar lrwxrwxrwx. 1 root root 25 Apr 24 16:46 log4j.jar -> /usr/share/java/log4j.jar -rw-r--r--. 1 root root 6873 Feb 19 22:40 tomcat-api.jar -rw-r--r--. 1 root root 774765 Feb 19 22:40 tomcat-coyote.jar lrwxrwxrwx. 1 root root 24 Apr 24 16:46 tomcat-el-2.2-api.jar -> ../tomcat-el-2.2-api.jar -rw-r--r--. 1 root root 77030 Feb 19 22:40 tomcat-i18n-es.jar -rw-r--r--. 1 root root 48499 Feb 19 22:40 tomcat-i18n-fr.jar -rw-r--r--. 1 root root 51161 Feb 19 22:40 tomcat-i18n-ja.jar -rw-r--r--. 1 root root 123623 Feb 19 22:40 tomcat-jdbc.jar lrwxrwxrwx. 1 root root 25 Apr 24 16:46 tomcat-jsp-2.2-api.jar -> ../tomcat-jsp-2.2-api.jar lrwxrwxrwx. 1 root root 37 Apr 24 16:46 tomcat-juli.jar -> /usr/share/tomcat/bin/tomcat-juli.jar lrwxrwxrwx. 1 root root 29 Apr 24 16:46 tomcat-servlet-3.0-api.jar -> ../tomcat-servlet-3.0-api.jar -rw-r--r--. 1 root root 23086 Feb 19 22:40 tomcat-util.jar [root@mgbwimi10 lib]#
And if I look into the src.rpm from : http://koji.fedoraproject.org/koji/buildinfo?buildID=407381
We can see the missing link creation here :
pushd ${RPM_BUILD_ROOT}%{libdir} # symlink JSP and servlet API jars %{__ln_s} ../%{name}-jsp-%{jspspec}-api.jar . %{__ln_s} ../%{name}-servlet-%{servletspec}-api.jar . %{__ln_s} ../%{name}-el-%{elspec}-api.jar . %{__ln_s} $(build-classpath apache-commons-collections) commons-collections.jar %{__ln_s} $(build-classpath apache-commons-dbcp) commons-dbcp.jar %{__ln_s} $(build-classpath log4j) log4j.jar %{__ln_s} $(build-classpath ecj) jasper-jdt.jar
# Temporary copy the juli jar here from /usr/share/java/tomcat (for maven depmap) %{__cp} -a ${RPM_BUILD_ROOT}%{bindir}/tomcat-juli.jar ./ popd
There is no link creation for apache-commons-pool
Should look like :
%{__ln_s} $(build-classpath apache-commons-pool) commons-pool.jar
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
Sebastien Pasche braoru@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |ASSIGNED Resolution|NOTABUG |--- Keywords| |Reopened
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
Sebastien Pasche braoru@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |CLOSED Resolution|--- |NOTABUG Last Closed|2013-02-03 16:44:14 |2013-04-25 04:19:08
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
Sebastien Pasche braoru@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |ASSIGNED Resolution|NOTABUG |---
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
Sebastien Pasche braoru@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |CLOSED Resolution|--- |NOTABUG Last Closed|2013-04-25 04:19:08 |2013-04-25 04:42:32
--- Comment #11 from Sebastien Pasche braoru@gmail.com --- creating a new bug with this issue
Product: Fedora https://bugzilla.redhat.com/show_bug.cgi?id=819087
--- Comment #12 from Sebastien Pasche braoru@gmail.com --- https://bugzilla.redhat.com/show_bug.cgi?id=956569
java-sig-commits@lists.fedoraproject.org