Ahhhh.... an applet. That certainly changes the question a LOT. Applet execution being on the client system won't be influenced by the server's security manager.

My advice stands when attempting to run a security manager on the server and making connections from the servlet code to the db. I'm no expert on applets and security managers so I'm not sure how to configure the security manager on the client or even if there is a way.

--David

Alexander Osherenko wrote:

Hello Martin and David,

thank you for your suggestions.

My problem is more complicated. I've implemented a java applet that is stored 
in the ROOT directory. The html-file to show the applet is

<applet archive="applet.jar,mysql-connector-java-3.1.14.jar" code="Applet" ...>
</applet>


This applet looks and works almost perfect except that it calls the MySQL 
bridge (mysql-connector...) that is also stored in the ROOT directory. Hence, I 
have two different jar files one in the ROOT directory and one in WEB-INF/lib/. 
How can I facilitate correct loading if I can't bind the jar-file in the 
archive tag as WEB-INF/lib/applet.jar?

Cheers
Alexander

-------- Original-Nachricht --------
Datum: Wed, 01 Aug 2007 09:43:24 -0400
Von: "Martin Gainty" <[EMAIL PROTECTED]>
An: users@tomcat.apache.org
Betreff: RE: Permissions

Good Morning Alexander

in $CATALINA_HOME/conf/catalina.policy
your environment is currently pointing to
127.0.0.1:8080

You will need to change this to

137.250.38.190:8080

I would suggest that you implement local (127.0.0.1) first
then re-implement on other servers e.g.
137.250.38.190

HTH/
Martin Gainty

______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.

Hello!

I'm working with tomcat 5.5.9 on Windows XP. I'm experiencing a strange problem with paths and permissions. I start "catalina.bat start
-security"
and assume that the catalina would read permissions from the catalina.policy file in the conf directory.

I grant permissions to the mysql-connector*.jar

grant codeBase "file:${catalina.home}/webapps/ROOT/mysql-connector-java-3.1.14-bin.jar"
{
   permission java.security.AllPermission;
//permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve";
};

but still get the error message:

MESSAGE: java.security.AccessControlException: access denied (java.net.SocketPermission 137.250.38.190:3306 connect,resolve)

STACKTRACE:

java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 137.250.38.190:3306 connect,resolve) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
   at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
   at com.mysql.jdbc.Connection.createNewIO(Connection.java:2569)
   at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at GUI.DBWrapper.<init>(DBWrapper.java:40)
   at GUI.CeisApplet.<init>(CeisApplet.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at sun.applet.AppletPanel.createApplet(Unknown Source)
   at sun.plugin.AppletViewer.createApplet(Unknown Source)
   at sun.applet.AppletPanel.runLoader(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


** END NESTED EXCEPTION **



Last packet sent to the server was 0 ms ago.
   at com.mysql.jdbc.Connection.createNewIO(Connection.java:2643)
   at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at GUI.DBWrapper.<init>(DBWrapper.java:40)
   at GUI.CeisApplet.<init>(CeisApplet.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at sun.applet.AppletPanel.createApplet(Unknown Source)
   at sun.plugin.AppletViewer.createApplet(Unknown Source)
   at sun.applet.AppletPanel.runLoader(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

Although the paths should be correct, the permissions are not granted.
What
do I miss?

Cheers
Alexander
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

_________________________________________________________________
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to