top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Tomcat: mySQL connector error

+2 votes
383 views

I try to run www.icescrum.org on my Tomcat 7 on Ubuntu 12.04 with OpenJDK.

I have installed Tomcat with apt-get and also I have installed the libmysql-java package. On starting Tomcat it reports on a stacktrace log, that the mySQL connector is not found (java.lang.ClassNotFoundException: "com.mysql.jdbc.Driver").

So I have try to create a symlink in Tomcats lib dir to the jar file and try to modify the properties of the search paths:

common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,
${catalina.home}/lib/*.jar,/var/lib/tomcat7/common/classes,/var/lib/tomcat7/common/*.jar
server.loader=/var/lib/tomcat7/server/classes,/var/lib/tomcat7/server/*.jar
shared.loader=/var/lib/tomcat7/shared/classes,/var/lib/tomcat7/shared/*.jar

The JDBC mySQL Jar is stored under /usr/share/java with two symlinks, I have tried to create a symlink from Tomcats lib dir (/usr/share/tomcat7/lib) to ../../java/mysql.jar but the mySQL is also not loaded. The CATALINA_HOME is set to /usr/share/tomcat7 and the CATALINA_BASE is /var/lib/tomcat7, so imho it should be worked.

How can I create a working IceScrum with mySQL and a shared mySQL connector?

posted Nov 17, 2013 by Sheetal Chauhan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

try to add Class.forName("com.mysql.jdbc.Driver"); to your code

answer Nov 18, 2013 by Deepankar Dubey
Similar Questions
+2 votes

With Tomcat 7.0.40 version, we are using Tomcat DBCP for pooling connections.

We are able to pool connections for different aliases. But for one alias, connections are not pooling. The user and password is good because the same alias in apache dbcp works fine.

Why are we not able to pool any connections here?

+3 votes

I'm developing a permission system in Tomcat and I would like to restrict incoming connections per application. I mean, I want to restrict incoming connections in some applications and permit them in others.

I have tried to do it with the Security Manager (SocketPermission), but it doesn't restrict all incoming connections. And also I have tried with RemoteAddrValve and RemoteHostValve () but it restricts all connections, not only the incoming ones. I have been searching other way to do that but I couldn't find anything.

Is it possible? Could anybody help me?

+1 vote

I have 2 mysql 5.0.45 installations on one RHEL server. One live mysqld is setup in what appears to be a relatively standard installation, port 3306, user 'mysql', etc. I've set up the other mysqld to run tests on a non-standard port 5045, user 'testsql', different data root, config, logs, etc.

When I attempt to connect to the mysqld running on port 5045 from the command-line mysql client on the same host as follows ...

# mysql -P 5045

... it seems I'm actually connecting to the live server on 3306 because 'show databases' shows the live databases. How can I troubleshoot this best?

+2 votes

I desire for using tomcat as the websocket server. But I'm now wondering about the tomcat performance. Does anyone know the max connections that tomcat could held? the concurrent number requests?

And I don't quite understand the configurations - acceptCount & maxConnections & maxThreads

There must be some relationship between the three params.

If I set [ accpetCount=200, maxConnections=10000, maxThreads=100] dose it means:
1. the max connections that tomcat maintain with the client is 10000. and if the 10001 client's connect request is coming, the client will timeout.
2. the max request is 200, and the 201 request will be refused.
3. the max concurrent request is 100.

+3 votes

As we start load testing our jsr-356 applications, I'd like to find out if there are any websocket-specific connector settings we should be aware of for tuning the underlying websocket connection processing. Since this is a tcp socket at the end of the day, I'm assuming all the socket.* options still apply if needed.

...