• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

problems with TOMCAT

D

dwskp

Guest
Have you guys run into a problem with Tomcat when trying to deploy a war that contains other jars. I can't even get the java code to connect to mysql through mysql jars installed through the war. I have also tried placing the jars into common/libs. Still, I am getting a security related problem. For some reason tomcat is not allowing java to connect to mysql through the correcponding drivers. What do I need to do to make sure that java has access to all the jars included in the war?? I need to be able to use hibernate,struts, etc.. otherwise what is the point of having tomcat in plesk??
 
Never mind guys I solved it by editing the catalina.policy file, everything works fine now.
 
What did you actually do/edit to get it working?
Please post it here so we can share the information.

Thanks
 
Ryan,

This is what I did, I added the following to the catalina.policy file in the WEB APPLICATION PERMISSIONS section, please note this definition is on its own, it's not embedded into grant {} that is already defined in the policy file:

initially i have tried this, but it didn't work:

grant codeBase "file:/var/cache/tomcat4/work/PSA/-" {
permission java.net.SocketPermission "localhost:8080", "connect";
permission java.net.SocketPermission "localhost:3306", "listen,connect,accept,resolve";
permission java.net.SocketPermission "localhost.localdomain:3306", "listen,connect,accept,resolve";
permission java.util.PropertyPermission "file.encoding", "read";
};

so I did this instead:

grant codeBase "file:/var/cache/tomcat4/work/PSA/-" {
permission java.security.AllPermission;
};


I know it's not the most secure way, but it works until I figure out what's wrong the the first way of doing it.

Drew.
 
oh you also need to restart tomcat after the edit to have this working.

For those who don't know where catalina.policy is located, it's in /var/tomcat4/conf directory.

Drew
 
Back
Top