Hello
Trying now to use policy with tomcat (win 2k).
MySql works fine now with the "authority" database.
but when I uncomment the following line in server.xml
<ContextInterceptor className="org.apache.tomcat.context.PolicyInterceptor"
/>
,I get in the console:
----------------------------------------------------------------------------
----
2001-01-28 12:58:58 - ContextManager: Adding context Ctx( /examples )
Starting tomcat. Check logs/tomcat.log for error messages 2001-01-28
12:58:58 -
ContextManager: Adding context Ctx( /admin )
2001-01-28 12:59:00 - ContextManager: Adding context Ctx( )
2001-01-28 12:59:00 - ContextManager: Adding context Ctx( /test )
java.security.AccessControlException: access denied
(java.net.SocketPermission l
ocalhost resolve)
at java.security.AccessControlContext.checkPermission(Unknown
Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.gjt.mm.mysql.MysqlIO.<init>(MysqlIO.java)
at org.gjt.mm.mysql.jdbc2.IO.<init>(IO.java:56)
at
org.gjt.mm.mysql.jdbc2.Connection.createNewIO(Connection.java:159)
at org.gjt.mm.mysql.Connection.connectionInit(Connection.java)
at
org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89)
at org.gjt.mm.mysql.Driver.connect(Driver.java)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
org.apache.tomcat.request.JDBCRealm.contextInit(JDBCRealm.java:430)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
:491)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
FATAL:java.lang.RuntimeException: JDBCRealm.start.readXml:
java.sql.SQLException
: Cannot connect to MySQL server on localhost:3306. Is there a MySQL server
runn
ing on the machine/port you are trying to connect to?
(java.security.AccessContr
olException)
java.lang.RuntimeException: JDBCRealm.start.readXml: java.sql.SQLException:
Cann
ot connect to MySQL server on localhost:3306. Is there a MySQL server
running on
the machine/port you are trying to connect to?
(java.security.AccessControlExce
ption)
at
org.apache.tomcat.request.JDBCRealm.contextInit(JDBCRealm.java:439)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
:491)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
----------------------------------------------------------------------------
----
This is my policy file (default):
----------------------------------------------------------------------------
----
// Permissions for tomcat.
// javac needs this
grant codeBase "file:${java.home}/lib/-" {
permission java.security.AllPermission;
};
// Tomcat gets all permissions
grant codeBase "file:${tomcat.home}/lib/-" {
permission java.security.AllPermission;
};
grant codeBase "file:${tomcat.home}/classes/-" {
permission java.security.AllPermission;
};
// Example webapp policy
// By default we grant read access on webapp dir
// and read of the line.separator PropertyPermission
grant codeBase "file:${tomcat.home}/webapps/examples" {
permission java.net.SocketPermission "localhost:1024-","listen";
permission java.util.PropertyPermission "*","read";
};
----------------------------------------------------------------------------
----
Any tips on what is wrong?
Also, when I access the example pages without policy I always have this on
the console:
----------------------------------------------------------------------------
-----
2001-01-29 02:09:20 - ContextManager: Adding context Ctx( /examples )
2001-01-29 02:09:20 - ContextManager: Adding context Ctx( /admin )
Starting tomcat. Check logs/tomcat.log for error messages
2001-01-29 02:09:20 - ContextManager: Adding context Ctx( )
2001-01-29 02:09:20 - ContextManager: Adding context Ctx( /test )
2001-01-29 02:09:21 - PoolTcpConnector: Starting HttpConnectionHandler on
8080
2001-01-29 02:09:21 - PoolTcpConnector: Starting Ajp12ConnectionHandler on
8007
2001-01-29 02:11:03 - Ctx( ): IOException in: R( + /index.html + null)
Connect
ion aborted by peer: socket write error
2001-01-29 02:11:03 - Ctx( ): IOException in: R( + /tomcat-power.gif +
null) C
onnection aborted by peer: socket write error
----------------------------------------------------------------------------
------
Thanks again
Marcantonio
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]