Re: tomcat can't find suitable driver for mysql

2020-07-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 7/13/20 19:27, jonmcalexan...@wellsfargo.com.INVALID wrote:
> Yes, that also works, however it's just as easy to do that in a
> setenv.sh file in the bin folder.

Its actually much better to do it in setenv.sh for a few reasons:

1. /etc/environment is not exactly a standard; it appears that it's
   a PAM feature and not part of any stock *NIX system

2. /etc/environment sets that variable for all users, for all processes
   (if it even does that)

3. /etc/environment would likely not affect any system-launched services
   (e.g. from /etc/init.d / systemd / whatever)

4. Tomcat clears any CLASSPATH environment variable under normal
   circumstances; anyone else looking at your environment may be
   surprised by what you have done

setenv.sh aside, there is always this:

5. Dropping your JDBC driver into Tomcat's lib/ directory is pretty
simple and doesn't require any other specific configuration at all.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8N83YACgkQHPApP6U8
pFhbyQ//VLHoBzkKj5FT5c/FA5/S9TDJasoj3+nBFsQmePi5Js8p4+APxklG8XPT
5Izhy6Vm4RUu088v3WKc5+zgwSuIsW9P+9xs6n9NIqhqoyRqsQGFDoxjb0FqjH6P
wBjkYq1idYaVqY+DbReYRmRFIi26Is5viTVLtkDw+yTjZhgJ/GjmX2acNu05/btn
2UddYioTIsUwxhzU8mra+sMxX5LEPgpfAhAXSS21uh90xBqT5+GQQO0pfsgOHUd+
ADlQxTeYilqoOgmGQjFfAH1EqAVzc77MMAVFWvfAPp1sUv5xE5SmDdCIuESm0a8S
+GITRzDcxUtFdVpo0ThEzPZVbbCoWIwhuQt9DZgsYNLgxpJMbNPknNYWo+7DkB4t
rl4i3l58gpdYsRl0QBjgyIxeRK/itktLBf51L65eWHtZb1N5YQuKuRzEuzfVxEsW
QonmRGi4O0FWHnQr1Zu0TKdy3bTWBqUpXua5Fg3w0D0tv5hToJ/WeGTOa/2J9Brz
GwuZJW/3hpr34COedQM5bvtfEfov86EKvJotDi9O/veVrx2IgTLPasCllr3cOO2T
Tmx/5IzgzAfjdDyJN4d5bDasqst4mp6fNszKVMuWuiiislSbMRpceoFR3U1zFYmC
C2lez9wGwfd+H2njcDd4xJxbWjawvRzRWPGAzEmsZYB2kQIFuv0=
=GdOs
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: tomcat can't find suitable driver for mysql

2020-07-13 Thread jonmcalexander
Yes, that also works, however it's just as easy to do that in a setenv.sh file 
in the bin folder.


Dream * Excel * Explore * Inspire
Jon McAlexander
Asst Vice President

Middleware Product Engineering
Enterprise CIO | Platform Services | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexan...@wellsfargo.com


This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.


-Original Message-
From: Barry Kimelman  
Sent: Monday, July 13, 2020 5:32 PM
To: Tomcat Users List 
Subject: Re: tomcat can't find suitable driver for mysql

I have found a solution. I modified /etc/environment to include  a definition 
of CLASSPATH, rebooted, and now it seems to be working just fine.


On Mon, Jul 13, 2020 at 4:24 PM calder  wrote:

> On Mon, Jul 13, 2020, 15:22 Barry Kimelman 
> 
> wrote:
>
> > my system is ubuntu 20.04
> > I am running tomcat 9.0.37
> >
>
>
> I can run java based mysql programs from the terminal command line 
> with no
> > problems
> >
>
>
> In my build.xml I have the following lines
> >
>
> So, you're attempting run in Eclipse?  Or using Maven?
>
>
> It's also important to note that "things" run differently on Linux vs 
> Windows.
>


-- 

==

Barry Kimelman
Winnipeg, Manitoba, Canada


Re: tomcat can't find suitable driver for mysql

2020-07-13 Thread Barry Kimelman
I have found a solution. I modified /etc/environment to include  a
definition of CLASSPATH, rebooted, and now it seems to be working just fine.


On Mon, Jul 13, 2020 at 4:24 PM calder  wrote:

> On Mon, Jul 13, 2020, 15:22 Barry Kimelman 
> wrote:
>
> > my system is ubuntu 20.04
> > I am running tomcat 9.0.37
> >
>
>
> I can run java based mysql programs from the terminal command line with no
> > problems
> >
>
>
> In my build.xml I have the following lines
> >
>
> So, you're attempting run in Eclipse?  Or using Maven?
>
>
> It's also important to note that "things" run differently on Linux vs
> Windows.
>


-- 

==

Barry Kimelman
Winnipeg, Manitoba, Canada


Re: tomcat can't find suitable driver for mysql

2020-07-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Barry,

On 7/13/20 16:21, Barry Kimelman wrote:
> my system is ubuntu 20.04 I am running tomcat 9.0.37 I can run java
> based mysql programs from the terminal command line with no
> problems

Tomcat establishes its own CLASSPATH and applications hosted on Tomcat
behave according to the servlet spec with respect to where libraries
must be located.

> I have installed tomcat under /opt/tomcat/latest under
> /opt/tomcat/latest/lib I have installed the jar file for mysql
>
> -rw-r--r-- 1 root root 1007505 Jul 13 10:54
> /opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar

That should be sufficient. How are you launching Tomcat?

> In my build.xml I have the following lines

Your build.xml is not relevant, unless it is physically copying files
somewhere, or bundling them into your WAR file.

> 131   
> However after I compile and install the application, when I try to
> run it my application traps the following error

How do you launch Tomcat and/or your application?

> java.sql.SQLException: No suitable driver found for
> jdbc:mysql://localhost/qwlc?autoReconnect=true=false
>
> What am I missing ? Why can't my tomcat app find the mysql class ?

How are you configuring your application for JDBC access? Using a
 in META-INF/context.xml foor your application?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8M2mgACgkQHPApP6U8
pFjKiA/+Kkxc2zdlIFj7hXi/wZIRcQM7jmQfs1WA6xujWXxPEnfCK24AuknMwt/w
KOKDjK65Q+WTlPIxe2Kh6+oMpMbCAnIWfqLs0oM7r/aUAvMvuw3qaEbeuPgGwcJx
7Kh746Hfx4qnmsaFYx6bD8GA2K+343mTH6QlWnV/F7EeILiNA6gPhMms/FAl7R1G
pVjYaXsPQU4+vwEsakGLmJpqF5I9BqejwaVDYVyALa+u1C4dyqk2N6MxVv/KsifB
p/I1TY281mjzGRXRS9WE9TksRAJ3S5PtAs1GIlXZVGbfNLc+Zlt6uIYwia+5Oi0G
vZtJzE8pIpq/Q+/DswwtumtwocfiHlsYhIezdmVNYnJnwXTRoBxz3JEOb4cYN07D
duii9T+AtACHGaTLXYFWX71XAqwrNw67MbEhi4ex9Ajrk0Qx8s6le9EyKQNI9Wpz
TrjyjbsvQzXcTANsPTF4o23IQIhc+VuAKJsTlyucvKVCUUx4AS1lTKmBH7zgVr3S
/CDmwF/PYrBWCEv2D+iQqhAQ7uc/cK7Fp3mwIpc+oWzIA+ART93ktuEP5lKYiNHE
JFDxO5wpK2HFv/dMpf2HFqEDprP9dMS2M8kZRFGKSoDDVTS25YyH7WM//ID1RU9J
4LFcSR7qek/1My7HYpPZFctey+eI/OAbwB3JlyV2QMNRs8CwH8E=
=Wcma
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat can't find suitable driver for mysql

2020-07-13 Thread calder
On Mon, Jul 13, 2020, 15:22 Barry Kimelman 
wrote:

> my system is ubuntu 20.04
> I am running tomcat 9.0.37
>


I can run java based mysql programs from the terminal command line with no
> problems
>


In my build.xml I have the following lines
>

So, you're attempting run in Eclipse?  Or using Maven?


It's also important to note that "things" run differently on Linux vs
Windows.


RE: tomcat can't find suitable driver for mysql

2020-07-13 Thread jonmcalexander
That is in the build, but not in the operational files.


Dream * Excel * Explore * Inspire
Jon McAlexander
Asst Vice President

Middleware Product Engineering
Enterprise CIO | Platform Services | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexan...@wellsfargo.com


This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.


-Original Message-
From: Barry Kimelman  
Sent: Monday, July 13, 2020 4:08 PM
To: Tomcat Users List 
Subject: Re: tomcat can't find suitable driver for mysql

But what about the lines

191 
192   
193 

in the build.xml file ? Aren't those supposed to expose all the JAR files under 
the tomcat lib directory to all apps ?


On Mon, Jul 13, 2020 at 3:49 PM 
wrote:

> Is this path included in your classpath or in one of the .loaders in 
> the catalina.properties file?
> /opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar
>
>
> Dream * Excel * Explore * Inspire
> Jon McAlexander
> Asst Vice President
>
> Middleware Product Engineering
> Enterprise CIO | Platform Services | Middleware | Infrastructure 
> Solutions
>
> 8080 Cobblestone Rd | Urbandale, IA 50322
> MAC: F4469-010
> Tel 515-988-2508 | Cell 515-988-2508
>
> jonmcalexan...@wellsfargo.com
>
>
> This message may contain confidential and/or privileged information. 
> If you are not the addressee or authorized to receive this for the 
> addressee, you must not use, copy, disclose, or take any action based 
> on this message or any information herein. If you have received this 
> message in error, please advise the sender immediately by reply e-mail 
> and delete this message. Thank you for your cooperation.
>
>
> -Original Message-
> From: Barry Kimelman 
> Sent: Monday, July 13, 2020 3:22 PM
> To: Tomcat Users List 
> Subject: tomcat can't find suitable driver for mysql
>
> my system is ubuntu 20.04
> I am running tomcat 9.0.37
> I can run java based mysql programs from the terminal command line 
> with no problems
>
> I have installed tomcat under /opt/tomcat/latest under 
> /opt/tomcat/latest/lib I have installed the jar file for mysql
>
> -rw-r--r-- 1 root root 1007505 Jul 13 10:54 
> /opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar
>
> In my build.xml I have the following lines
>
> 131   
>
> 186 
> 187 
> 188   
> 189 
> 190 
> 191 
> 192   
> 193 
>
> However after I compile and install the application, when I try to run 
> it my application traps the following error
>
> java.sql.SQLException: No suitable driver found for 
> jdbc:mysql://localhost/qwlc?autoReconnect=true=false
>
> What am I missing ? Why can't my tomcat app find the mysql class ?
>
>
>
> ==
>
> Barry Kimelman
> Winnipeg, Manitoba, Canada
>


-- 

==

Barry Kimelman
Winnipeg, Manitoba, Canada

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat can't find suitable driver for mysql

2020-07-13 Thread Barry Kimelman
But what about the lines

191 
192   
193 

in the build.xml file ? Aren't those supposed to expose all the JAR files
under the tomcat lib directory to all apps ?


On Mon, Jul 13, 2020 at 3:49 PM 
wrote:

> Is this path included in your classpath or in one of the .loaders in the
> catalina.properties file?
> /opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar
>
>
> Dream * Excel * Explore * Inspire
> Jon McAlexander
> Asst Vice President
>
> Middleware Product Engineering
> Enterprise CIO | Platform Services | Middleware | Infrastructure Solutions
>
> 8080 Cobblestone Rd | Urbandale, IA 50322
> MAC: F4469-010
> Tel 515-988-2508 | Cell 515-988-2508
>
> jonmcalexan...@wellsfargo.com
>
>
> This message may contain confidential and/or privileged information. If
> you are not the addressee or authorized to receive this for the addressee,
> you must not use, copy, disclose, or take any action based on this message
> or any information herein. If you have received this message in error,
> please advise the sender immediately by reply e-mail and delete this
> message. Thank you for your cooperation.
>
>
> -Original Message-
> From: Barry Kimelman 
> Sent: Monday, July 13, 2020 3:22 PM
> To: Tomcat Users List 
> Subject: tomcat can't find suitable driver for mysql
>
> my system is ubuntu 20.04
> I am running tomcat 9.0.37
> I can run java based mysql programs from the terminal command line with no
> problems
>
> I have installed tomcat under /opt/tomcat/latest under
> /opt/tomcat/latest/lib I have installed the jar file for mysql
>
> -rw-r--r-- 1 root root 1007505 Jul 13 10:54
> /opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar
>
> In my build.xml I have the following lines
>
> 131   
>
> 186 
> 187 
> 188   
> 189 
> 190 
> 191 
> 192   
> 193 
>
> However after I compile and install the application, when I try to run it
> my application traps the following error
>
> java.sql.SQLException: No suitable driver found for
> jdbc:mysql://localhost/qwlc?autoReconnect=true=false
>
> What am I missing ? Why can't my tomcat app find the mysql class ?
>
>
>
> ==
>
> Barry Kimelman
> Winnipeg, Manitoba, Canada
>


-- 

==

Barry Kimelman
Winnipeg, Manitoba, Canada


RE: tomcat can't find suitable driver for mysql

2020-07-13 Thread jonmcalexander
Is this path included in your classpath or in one of the .loaders in the 
catalina.properties file?
/opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar


Dream * Excel * Explore * Inspire
Jon McAlexander
Asst Vice President

Middleware Product Engineering
Enterprise CIO | Platform Services | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexan...@wellsfargo.com


This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.


-Original Message-
From: Barry Kimelman  
Sent: Monday, July 13, 2020 3:22 PM
To: Tomcat Users List 
Subject: tomcat can't find suitable driver for mysql

my system is ubuntu 20.04
I am running tomcat 9.0.37
I can run java based mysql programs from the terminal command line with no 
problems

I have installed tomcat under /opt/tomcat/latest under /opt/tomcat/latest/lib I 
have installed the jar file for mysql

-rw-r--r-- 1 root root 1007505 Jul 13 10:54 
/opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar

In my build.xml I have the following lines

131   

186 
187 
188   
189 
190 
191 
192   
193 

However after I compile and install the application, when I try to run it my 
application traps the following error

java.sql.SQLException: No suitable driver found for 
jdbc:mysql://localhost/qwlc?autoReconnect=true=false

What am I missing ? Why can't my tomcat app find the mysql class ?



==

Barry Kimelman
Winnipeg, Manitoba, Canada


Re: tomcat can't find suitable driver for mysql

2020-07-13 Thread Barry Kimelman
I should also mention this is the same JAVA code I had running under Tomcat
9.0.14 running under Windows 10 where it ran with no problems.

On Mon, Jul 13, 2020 at 3:30 PM Barry Kimelman 
wrote:

> An update :
>
> I have now installed the same JAR file under tomcat that I used from the
> command line
> -rwxr-xr-x 1 root root 1007502 Jul 13 15:25
> /opt/tomcat/latest/lib/mysql-connector-java-5.1.47.jar
>
> However the same error still occurs.
>
> On Mon, Jul 13, 2020 at 3:21 PM Barry Kimelman 
> wrote:
>
>> my system is ubuntu 20.04
>> I am running tomcat 9.0.37
>> I can run java based mysql programs from the terminal command line with
>> no problems
>>
>> I have installed tomcat under /opt/tomcat/latest
>> under /opt/tomcat/latest/lib I have installed the jar file for mysql
>>
>> -rw-r--r-- 1 root root 1007505 Jul 13 10:54
>> /opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar
>>
>> In my build.xml I have the following lines
>>
>> 131   
>>
>> 186 
>> 187 
>> 188   
>> 189 
>> 190 
>> 191 
>> 192   
>> 193 
>>
>> However after I compile and install the application, when I try to run it
>> my application traps the following error
>>
>> java.sql.SQLException: No suitable driver found for
>> jdbc:mysql://localhost/qwlc?autoReconnect=true=false
>>
>> What am I missing ? Why can't my tomcat app find the mysql class ?
>>
>>
>>
>> ==
>>
>> Barry Kimelman
>> Winnipeg, Manitoba, Canada
>>
>
>
> --
>
> ==
>
> Barry Kimelman
> Winnipeg, Manitoba, Canada
>


-- 

==

Barry Kimelman
Winnipeg, Manitoba, Canada


Re: tomcat can't find suitable driver for mysql

2020-07-13 Thread Barry Kimelman
An update :

I have now installed the same JAR file under tomcat that I used from the
command line
-rwxr-xr-x 1 root root 1007502 Jul 13 15:25
/opt/tomcat/latest/lib/mysql-connector-java-5.1.47.jar

However the same error still occurs.

On Mon, Jul 13, 2020 at 3:21 PM Barry Kimelman 
wrote:

> my system is ubuntu 20.04
> I am running tomcat 9.0.37
> I can run java based mysql programs from the terminal command line with no
> problems
>
> I have installed tomcat under /opt/tomcat/latest
> under /opt/tomcat/latest/lib I have installed the jar file for mysql
>
> -rw-r--r-- 1 root root 1007505 Jul 13 10:54
> /opt/tomcat/latest/lib/mysql-connector-java-5.1.47-bin.jar
>
> In my build.xml I have the following lines
>
> 131   
>
> 186 
> 187 
> 188   
> 189 
> 190 
> 191 
> 192   
> 193 
>
> However after I compile and install the application, when I try to run it
> my application traps the following error
>
> java.sql.SQLException: No suitable driver found for
> jdbc:mysql://localhost/qwlc?autoReconnect=true=false
>
> What am I missing ? Why can't my tomcat app find the mysql class ?
>
>
>
> ==
>
> Barry Kimelman
> Winnipeg, Manitoba, Canada
>


-- 

==

Barry Kimelman
Winnipeg, Manitoba, Canada