[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-users:37883] Re: webからJDBC接続する方法



おかもとです。

From: hibayashi yoshiki <hibayashi@xxxxxxxxxxxxxxx>
Subject: [debian-users:37876] webからJDBC接続する方法
Date: Wed, 30 Jul 2003 18:15:12 +0900
> Something unusual has occured to cause the driver to fail. Please report this exception: Exception: java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)
> Stack Trace:
> 
> java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)
> 	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
> 	at java.security.AccessController.checkPermission(AccessController.java:399)
.. snip..
> 	at java.net.InetAddress.getByName(InetAddress.java:449)
> 	at java.net.Socket.<init>(Socket.java:100)
> 	at org.postgresql.PG_Stream.<init>(Unknown Source)

PostgreSQLのJDBCがlocalhostのソケットを使おうとしていますが、JVMのセキュ
リティマネージャのパーミッションが許されていないのでエラーになっていま
す。

/usr/share/doc/tomcat/README.Debianを読むと、次の様に書いています。

- Tomcat is started using a security manager, you can define the permissions
  for your servlets and JSPs in /etc/tomcat4/policy.d/*. All files in this
  directory are joined to /etc/tomcat4/catalina.policy. Other Debian packages
  that contain web applications might provide their own security rules in a
  file in this directory, e.g. for JDBC access. You can also completely
  disable the security manager in /etc/default/tomcat4 but this is not
  recommended since a call to System.exit() in a servlet of JSP page
  would then stop the whole virtual machine that is running Tomcat.

ということで、/etc/tomcat4/policy.d/99examples.policy 辺りを読むと、

// The permission granted to your JDBC driver
// grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
//      permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
// };

この部分を書き換えてコメントアウトすれば動きませんか?
----
おかもとたかし