[Bug 217607] Re: tomcat cannot connect to mysql

2009-02-08 Thread Olray
Hi Thierry, in the last 2 days I have learned more about Tomcat than ever 
before. Thanks for your final hint:JDBC4 support was dropped. So I looked for 
JDBC4 related lines in the config and finally found a suspicious 
mysql-connector-3.1.10-bin.jar in their lib file. Looks like they have 
hard-coded that version into their software. I have created a symbolic link to 
/usr/share/java/mysql-connector-bin.jar with that name and now it works 
although I haven't tested it enough to call this a solution.
I'm sure this were 7 hours of my lifetime well spent :-)
Thank you!

-- 
tomcat cannot connect to mysql
https://bugs.launchpad.net/bugs/217607
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to mysql-dfsg-5.0 in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 217607] Re: tomcat cannot connect to mysql

2009-02-06 Thread Olray
Ok I'm giving you all information I have. The application currently
throwing this exception at me is ActiTime, a freeware (but not free)
web-based time management application.

The full error message is:
Unable to instantiate logger class 'com.mysql.jdbc.log.Jdk14Logger', exception 
in constructor?

Running Ubuntu 8.04 LTS server edition on AMD 64 using the certified
versions of tomcat5.5 and mysql. Versions are:

Kernel 2.6.24-21-server 
Tomcat 5.5.25-5
Mysql 5.0.51a-3
Libmysql-Java 5.1.5
liblog4j1.2-java 1.2.15-2 (in /usr/share/java/)
Sun Java (java-6-sun-1.6.0.07)

The application requests to use Sun Java instead of the free gjc environment. 
So: the whole gjc environment is uninstalled (hopefully) and 
update-alternatives --config java only returns Sun Java 1.5 and 1.6.
I have followed the vendors instructions and edited server.xml and the policy 
file accordingly.

What other information do you need?

** Attachment added: Error message formatted by 3rd party vendor
   http://launchpadlibrarian.net/22036059/Clipboard01.gif

** Changed in: mysql-dfsg-5.0 (Ubuntu)
   Status: Invalid = New

-- 
tomcat cannot connect to mysql
https://bugs.launchpad.net/bugs/217607
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to mysql-dfsg-5.0 in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 217607] Re: tomcat cannot connect to mysql

2009-02-06 Thread Olray
Thank you *very* much for that fast answer.

I contacted the ActiTime developers. They're very helpful and would like me to 
turn off security completely and tell me what's happening. For two reasons I 
wouldn't like to do that:
1) I don't know how to do that
2) I don't want to do that because the docs (yeah I read the docs!!) explicitly 
warned doing this unless you know what you're doing. So I don't. See 1).

So, they said it's very likely a permission problem. I grepped the
logfile with grep -i permiss catalina* and it really gave some read
permission denied. And it was related to logging. A config file
/var/lib/tomcat5.5/webapps/actitime/WEB-INF/classes/logging.properties
was denied read access to, unfortunately there is no such file with that
name.

The full line was:
Caused by: java.security.AccessControlException: access denied 
(java.io.FilePermission 
/var/lib/tomcat5.5/webapps/actitime/WEB-INF/classes/logging.properties read)

Here's the policy:

grant codeBase file:/var/lib/tomcat5.5/webapps/actitime/- {
  permission java.lang.RuntimePermission getClassLoader;
  permission java.util.PropertyPermission *, read,write;
  permission java.io.FilePermission ALL FILES, read;
  // Database access
  permission java.lang.RuntimePermission 
accessClassInPackage.org.apache.jasper.compiler;
  permission java.lang.RuntimePermission 
accessClassInPackage.org.apache.jasper.compiler.*;
  // Net access to Mysql
  permission java.net.SocketPermission 127.0.0.1:3306, connect,resolve;
};

grant codeBase file:/var/lib/tomcat5.5/webapps/actitime/WEB-INF/lib/* {
  permission java.lang.RuntimePermission accessDeclaredMembers;
  permission java.lang.RuntimePermission getClassLoader;
  permission java.util.PropertyPermission *, read;
};

For some reason I  hoped that the line with ALL FILES and read
would include permission to read files there. Even changing to
read,write didn't help (in case the app wanted to actually create it's
'logging.properties' file).

Oh and by the way, it works out of the box on my OpenSuSE test install
at home :-(

But you wanted a stack trace. Here's a stack trace attached. I have
started the server, accessed the page with the error message once and
shut down the server immediately so it should contain everything.


** Attachment added: Stack trace with permission error
   http://launchpadlibrarian.net/22047740/catalina.2009-02-06.log

-- 
tomcat cannot connect to mysql
https://bugs.launchpad.net/bugs/217607
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to mysql-dfsg-5.0 in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs