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/04/01 15:41:56 UTC

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


RE: Big problem with tomcat's security manager and dataSource in the struts_config.xml file

Posted by Tim Sawyer <ts...@nildram.co.uk>.
This might be completely unrelated, but I'll mention it anyway.

This weekend I had a quick play with accessing MySQL through JDBC (I've
never done anything with JDBC before).  Latest stable version of MySQL on
Win2k, latest stable JDBC driver.  I was running on Orion 1.5.2.   I found
that if I did this:

	DriverManager.getConnection("jdbc:mysql://localhost/mydatabase", "webuser",
"password");

it didn't work, but this:


DriverManager.getConnection("jdbc:mysql://localhost/mydatabase?user=webuser&
password=password");

did.  Just wonder if your problem is related?

Tim.

> -----Original Message-----
> From: stephen.chambers [mailto:stephen.chambers@verizon.net]
> Sent: Monday, April 01, 2002 2:42 PM
> To: struts-user@jakarta.apache.org
> Subject: Big 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-b
in.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>




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