You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "stephen.chambers" <st...@verizon.net> on 2002/03/29 18:07:02 UTC

Problem with tomcat's security manager and dataSource in the struts_config.xml file

All,

I have been migrating a smaller Tomcat/MySQL application to Struts and have
run into a problem.

I have completely converted the app to Struts and hit a snag when I inserted
the DataSource tag into the struts-config.xml. It began to generate "Cannot
find ActionMappings" errors in the html and in the logs it could not find
the database, asking "Is there a MySQL database running on this server?"

My Tomcat 4.0 (on RH 7.1) is running with security and I added these lines
to the conf/catalina.policy file, each on as nothing else seemed to work:

grant CodeBase "file:${catalina.home}/webapps/myapp/-" {
        permission java.security.AllPermission;
        };
grant CodeBase "file:${catalina.home}/webapps/myapp/WEB-INF/classes/-" {
        permission java.security.AllPermission;
        };
grant CodeBase "file:${catalina.home}/webapps/myapp/WEB-INF/lib-" {
        permission java.security.AllPermission;
        };
grant CodeBase
"file:${catalina.home}/webapps/myapp/WEb-INF/lib/mm.mysql-2.0.11-bin.jar!/-"
{
        permission java.security.AllPermission;
        };

None of these worked either. When I commented out the datasource tag
everything except the database started working and then when I commented it
back in, nothing. I finally turned off the security manager and everything
including the database works now, with the datasource tag in the
struts-config.xml in there as it should be. Has anyone else had this
problem? In the local user's group, someone else had the same problem on a
WIN2K box with MySQL (and a different version of the mm.mysql.driver as
well) and they still haven't solved it either.

The appropriate section of the struts-config.xml looks like the following:
<data-sources>
    <data-source
            autoCommit="false"
            autoReconnect="true"
            description="Data Source"
            driverClass="org.gjt.mm.mysql.Driver"
            maxCount="4"
            minCount="2"
            password="whatever"
            url="jdbc:mysql://myserver:3306/4po"
            user="servlet"
    />
</data-sources>

What is the conflict with the security manager or am I messing something up
myself?

Steve


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>