Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2853 > unrolled thread

Tomcat7 on Ubuntu 12.04 does not load mySQL JDBC Connector

Started byPhilipp Kraus <philipp.kraus@flashpixx.de>
First post2013-11-16 08:25 +0100
Last post2013-11-17 14:36 +0000
Articles 4 — 2 participants

Back to article view | Back to comp.lang.java.help


Contents

  Tomcat7 on Ubuntu 12.04 does not load mySQL JDBC Connector Philipp Kraus <philipp.kraus@flashpixx.de> - 2013-11-16 08:25 +0100
    Re: Tomcat7 on Ubuntu 12.04 does not load mySQL JDBC Connector lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-11-17 09:49 +0000
      Re: Tomcat7 on Ubuntu 12.04 does not load mySQL JDBC Connector Philipp Kraus <philipp.kraus@flashpixx.de> - 2013-11-17 11:30 +0100
        Re: Tomcat7 on Ubuntu 12.04 does not load mySQL JDBC Connector lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-11-17 14:36 +0000

#2853 — Tomcat7 on Ubuntu 12.04 does not load mySQL JDBC Connector

FromPhilipp Kraus <philipp.kraus@flashpixx.de>
Date2013-11-16 08:25 +0100
SubjectTomcat7 on Ubuntu 12.04 does not load mySQL JDBC Connector
Message-ID<l676m4$b52$1@online.de>

[Multipart message — attachments visible in raw view] — view raw

Hello,

I try to install in an Ubuntu 12.04 a Tomcat7 with mySQL JDBC. So I 
have run apt-install for tomcat and libmysql-java, but I get always:

java.lang.ClassNotFoundException: "com.mysql.jdbc.Driver"

in my logs. In the catalina.properties the loading pathes are defined with

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 twi 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

I try to run http://www.icescrum.org/ with mySQL support.

Can anybody help me please with a useful idea to create a working mySQL 
JDBC driver in my Tomcat7?

Thanks a lot

Phil

[toc] | [next] | [standalone]


#2854

Fromlipska the kat <"lipskathekat at yahoo dot co dot uk">
Date2013-11-17 09:49 +0000
Message-ID<d7qdneyzpNukDBXPnZ2dnUVZ8oudnZ2d@bt.com>
In reply to#2853
On 16/11/13 07:25, Philipp Kraus wrote:
> Hello,
>
>
> I try to install in an Ubuntu 12.04 a Tomcat7 with mySQL JDBC. So I have
> run apt-install for tomcat and libmysql-java, but I get always:
>
>
> java.lang.ClassNotFoundException: "com.mysql.jdbc.Driver"
>
>
> in my logs. In the catalina.properties the loading pathes are defined with
>
>
> 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 twi 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
>
>
> I try to run http://www.icescrum.org/ with mySQL support.
>
>
> Can anybody help me please with a useful idea to create a working mySQL
> JDBC driver in my Tomcat7?
>
>
> Thanks a lot

Ubuntu 12.04 LTS
apache-tomcat-7.0.42
jdk1.7.0_45

Yea, this can be a bit of a PITA sometimes if you are relying on 
container managed connection pools as the container needs to find the 
jar before a web app that uses it is fully loaded, at least this is what 
I have figured out anyway.

I have the following directory structure
/opt/apache-tomcat-7.0.42/

I copied mysql-connector-java-5.1.22-bin.jar
into /opt/apache-tomcat-7.0.42/lib

I restarted the server and it all just works
no sym links and no fancy obscure directory structure scattered across 
the file system.

Try it, it might be what you are looking for.


-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

[toc] | [prev] | [next] | [standalone]


#2855

FromPhilipp Kraus <philipp.kraus@flashpixx.de>
Date2013-11-17 11:30 +0100
Message-ID<l6a5sf$if4$1@online.de>
In reply to#2854
On 2013-11-17 09:49:39 +0000, lipska the kat said:

> Ubuntu 12.04 LTS
> apache-tomcat-7.0.42
> jdk1.7.0_45

Did you use Oracle JDK ? I use in my installation OpenJDK

> 
> Yea, this can be a bit of a PITA sometimes if you are relying on 
> container managed connection pools as the container needs to find the 
> jar before a web app that uses it is fully loaded, at least this is 
> what I have figured out anyway.
> 
> I have the following directory structure
> /opt/apache-tomcat-7.0.42/
> 
> I copied mysql-connector-java-5.1.22-bin.jar
> into /opt/apache-tomcat-7.0.42/lib
> 
> I restarted the server and it all just works
> no sym links and no fancy obscure directory structure scattered across 
> the file system.

I have copied the Jar to the lib directory (without symlink) but the 
error exists also. Can it be a problem with the OpenJDK / Oracle JDK?
I have installed Tomcat from Ubuntu's package tree also, the OpenJDK 
(dependency) and the mySQL Connector, so imho it should be
okay, because always comes from the package tree

Phil

[toc] | [prev] | [next] | [standalone]


#2856

Fromlipska the kat <"lipskathekat at yahoo dot co dot uk">
Date2013-11-17 14:36 +0000
Message-ID<DZGdndE_tbf3SRXPnZ2dnUVZ7qOdnZ2d@bt.com>
In reply to#2855
On 17/11/13 10:30, Philipp Kraus wrote:
> On 2013-11-17 09:49:39 +0000, lipska the kat said:
>
>> Ubuntu 12.04 LTS
>> apache-tomcat-7.0.42
>> jdk1.7.0_45
>
> Did you use Oracle JDK ? I use in my installation OpenJDK

I have used both
java-7-openjdk-amd64 and Oracle JDK, currently using the Oracle one

>> Yea, this can be a bit of a PITA sometimes if you are relying on
>> container managed connection pools as the container needs to find the
>> jar before a web app that uses it is fully loaded, at least this is
>> what I have figured out anyway.
>>
>> I have the following directory structure
>> /opt/apache-tomcat-7.0.42/
>>
>> I copied mysql-connector-java-5.1.22-bin.jar
>> into /opt/apache-tomcat-7.0.42/lib
>>
>> I restarted the server and it all just works
>> no sym links and no fancy obscure directory structure scattered across
>> the file system.
>
> I have copied the Jar to the lib directory (without symlink) but the
> error exists also. Can it be a problem with the OpenJDK / Oracle JDK?

Well then it sounds like something is amiss with the install. I don't 
think the Java distro is the problem  ...

> I have installed Tomcat from Ubuntu's package tree also, the OpenJDK
> (dependency) and the mySQL Connector, so imho it should be
> okay, because always comes from the package tree

To be honest with you I never bother with Ubuntu packages if I can avoid 
it. I just downloaded the relevant gzipped tarball from
tomcat.apache.org/download-70.cgi
Unzip, untar, configure the startup script
and away you go. You know exactly what you have that way and all the 
important directories are in one place.

You could try that, you can even install it in a temp directory in your 
home directory just to test it out.

There is an excellent mailing list for tomcat which you can join at
http://tomcat.apache.org/lists.html


-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.help


csiph-web