Thread: Permission error
Using: Tomcat 4 Jakarta Struts 1.2.4 Sun J2SDK 1.4.2_7 PostgreSQL 7.2.1 PostgreSQL JDBC pg72jdbc2 I can't connect and get this error in catalina.out: [ERROR] ActionServlet - Initializing application data source org.apache.struts.action.DATA_SOURCE <org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (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) java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve) [snip] Caused by: 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) I find it odd that something should deny the driver to resolve localhost? Anyway, the error tells me to report it .. so here goes. Full output&stacktrace at http://awn.dk/catalina.out My configuration in struts: <data-sources> <!-- configuration for commons BasicDataSource --> <data-source type="org.apache.commons.dbcp.BasicDataSource"> <set-property property="driverClassName" value="org.postgresql.Driver" /> <set-property property="url" value="jdbc:postgresql:kumdb" /> <set-property property="username" value="kumdb" /> <set-property property="password" value="xxxxxx" /> <set-property property="maxActive" value="10" /> <set-property property="maxWait" value="5000" /> <set-property property="defaultAutoCommit" value="false" /> <set-property property="defaultReadOnly" value="false" /> </data-source> </data-sources> What can I do to make this work? Thanks alot! -- Venlig hilsen Martin Seebach
Martin Seebach wrote: > Using: > Tomcat 4 > Jakarta Struts 1.2.4 > Sun J2SDK 1.4.2_7 > PostgreSQL 7.2.1 > PostgreSQL JDBC pg72jdbc2 > > I can't connect and get this error in catalina.out: test to see if you can connect with "psql -h localhost -u kumdb kumdb" from a command line. postgres does NOT default to supporting TCP connections, you need to modify $PGDATA/postgresql.conf and $PGDATA/pg_hba.conf to allow this. btw, and not actually an issue here, but, thats a really old pgsql, and you really should upgrade to 7.4.7 or 8.0.1.