> Date: Fri, 9 Aug 2013 09:07:12 -0700
> From: [email protected]
> To: [email protected]
> Subject: Re: Upgrade to Tomcat 7 Issues
>
> On 8/9/2013 8:46 AM, Christopher Schultz wrote:
> > -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
> >
> > Chuck,
> >
> > On 8/9/13 10:08 AM, Caldarale, Charles R wrote:
> >>> From: Seema Patel [mailto:[email protected]] Subject: RE:
> >>> Upgrade to Tomcat 7 Issues
> >>
> >>> In my WEB-INF/lib I have the following (sorry the list is quite
> >>> long): activation.jar
> >>
> >>> In Tomcat7.0/lib directory I have (I have grouped them
> >>> alphabetically so it doesn't make the list too long downwards,
> >>> like the above list)
> >>
> >>> activation.jar j2ee.jar
> >>
> >> You must never, never, never have the same class files in multiple
> >> locations in the class loader hierarchy (e.g., activation.jar and
> >> several others).
> >
> > I don't think "activation" is something provided by servlet
> > containers. I don't see it in a stock Tomcat, for example.
> >
>
> JavaBeans activation framework (activation.jar) was required for Java
> mail when running on older versions of the JRE. It has been included
> since JRE 6 (can't remember the minor version).
>
> Since the original poster has upgraded to JRE 7, there should be no need
> for this JAR either in $CATALINA_HOME/lib or WEB-INF/lib of the application.
>
> >> Also, j2ee.jar must never be present anywhere in any Tomcat
> >> installation.
> >
> > I'm not sure what's in this particular j2ee.jar, but you're probably
> > right that it does not belong. The container should provide all
> > services to the webapp. If you want a more fully-functional J2EE
> > container, consider Apache TomEE.
> >
> >> You need to start over, not adding anything to Tomcat's lib
> >> directory, and try running your webapp.
> >
> > Absolutely.
> >
> > - -chris
>
> . . . . just my two cents.
> /mde/
>
Right, I've re-installed Tomcat 7.0.42. The only things I've changed are in
the server.xml file, here is what's in the server.xml file (what I have
added/changed are in red, one being the connector port - from 8080 to 8088 and
the other is adding the realm tag/element just before the Host tag/element):
<Server port="8005" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener SSLEngine="on"
className="org.apache.catalina.core.AprLifecycleListener"/>
<!--Initialize Jasper prior to webapps are loaded. Documentation at
/docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener"/>
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource auth="Container" description="User database that can be updated
and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
name="UserDatabase" pathname="conf/tomcat-users.xml"
type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more
named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector connectionTimeout="20000" port="8088" protocol="HTTP/1.1"
redirectPort="8443"/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine defaultHost="localhost" name="Catalina">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Realm className="org.apache.catalina.realm.JNDIRealm"
connectionURL="ldap://xxx:3268"
connectionName="[email protected]" connectionPassword="xxx"
referrals="follow" userBase="dc=xxx,dc=local"
userSearch="(sAMAccountName={0})" userSubtree="true"
roleBase="dc=xxx,dc=local" roleSearch="(member={0})"
roleName="cn" roleSubtree="true" />
<Host appBase="webapps" autoDeploy="true" name="localhost"
unpackWARs="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" pattern="%h %l %u %t "%r" %s %b"
prefix="localhost_access_log." suffix=".txt"/>
</Host>
</Engine>
</Service>
</Server>
I am now getting the following error message in my application's log file:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'jdbc:mysql://xxx.xxx.local/xxx?autoReconnect=true'
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.xxx.xxx.helpers.Database.getSopConnection(Database.java:18)
at com.xxx.xxx.util.UserUtil.getUser(UserUtil.java:36)
at com.xxx.xxx.P1_00Action.portalExecute(P1_00Action.java:60)
at com.xxx.xxx.PortalBaseAction.execute(PortalBaseAction.java:200)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.xxx.xxx.RequestFilter.doFilter(RequestFilter.java:47)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.xxx.xxxXX.ADGroupFilter.doFilter(ADGroupFilter.java:62)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(Unknown Source)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
... 37 more
Can I put the mysql-connector-java-5.0.8-bin jar into the Tomcat/lib directory?
Previous posts said not to add anything to the lib directory. Also I don't
think adding this there will solve the issue anyway. Am I missing something in
my server.xml file? The old server.xml file (for Tomcat 5.5.29) was amended by
previous developers, so I am not sure what I need out of there, hence I've only
added one thing to the new servrer.xml file, which is the realm to authenicate
users (which is what's failing when I run the server).
Any help/feedback is appreciated, as this is all a bit new for me.
Thanks
Seema
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>