Thread: jdbc connection refused, please help
Hi all, I'm definitely a postgreSQL newbie. In trying to hook up postgreSQL to a JSP engine (Java Web Server) using the postgreSQL jdbc driver, I get the following error: Message: Something unusual has occured to cause the driver to fail. Please report this exception: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:5432 connect,resolve) Error code: 0 Something unusual has occured to cause the driver to fail. Please report this exception: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:5432 connect,resolve) at java.lang.Throwable.fillInStackTrace(Native Method) at java.lang.Throwable.fillInStackTrace(Compiled Code) at java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) at java.sql.SQLException.(SQLException.java:98) at org.postgresql.util.PSQLException.(Compiled Code) at org.postgresql.Driver.connect(Compiled Code) at java.sql.DriverManager.getConnection(Compiled Code) at java.sql.DriverManager.getConnection(Compiled Code) at sunexamples.beans.JDBCBean.go(Compiled Code) at sunexamples.beans.HttpJDBCBean.processRequest(Compiled Code) at pagecompile.jsp._examples._jdbc._JDBCSample._jspService(Compiled Code) at com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(JspServlet .java:469) at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(JspSer vlet.java:259) at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.sun.server.ServletState.callService(Compiled Code) at com.sun.server.ServletManager.callServletService(Compiled Code) at com.sun.server.ProcessingState.invokeTargetServlet(Compiled Code) at com.sun.server.http.HttpProcessingState.execute(Compiled Code) at com.sun.server.http.stages.Runner.process(Compiled Code) at com.sun.server.ProcessingSupport.process(Compiled Code) at com.sun.server.Service.process(Compiled Code) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.HandlerThread.run(Compiled Code) JDBC/JSP Example Anyone have any ideas how I can work around it? I'm not sure why connect,resolve isn't allowed...but here's the relevant line from my pg_hba.conf: # TYPE DATABASE IP_ADDRESS MASK USERAUTH MAP host all 127.0.0.1 255.255.255.128 trust --
You have fallen fowl of applet security. Here, you can only connect to the same server as the applet was downloaded from, so unless you connected directly to 127.0.0.1 to download the applet it will fail. The rule is: The URL for the applet must be identical to the jdbc url. Pseudonyms, or identical IP addresses won't work. The URL's must match exactly. Peter -- Peter T Mount peter@retep.org.uk, me@petermount.com Homepage: http://www.retep.org.uk Contact details: http://petermount.com PostgreSQL JDBC: http://www.retep.org.uk/postgres/ Java PDF Generator: http://www.retep.org.uk/pdf/ ----- Original Message ----- From: "Robert Morrow" <rhmorrow1@earthlink.net> To: <pgsql-general@postgresql.org> Sent: Monday, August 28, 2000 2:13 AM Subject: [GENERAL] jdbc connection refused, please help > Hi all, > I'm definitely a postgreSQL newbie. In trying to hook up postgreSQL to a > JSP engine (Java Web Server) using the postgreSQL jdbc driver, I get the > following error: > > Message: Something unusual has occured to cause the driver to fail. Please > report this exception: java.security.AccessControlException: access denied > (java.net.SocketPermission 127.0.0.1:5432 connect,resolve) Error code: 0 > Something unusual has occured to cause the driver to fail. Please report > this exception: java.security.AccessControlException: access denied > (java.net.SocketPermission 127.0.0.1:5432 connect,resolve) at > java.lang.Throwable.fillInStackTrace(Native Method) at > java.lang.Throwable.fillInStackTrace(Compiled Code) at > java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) > at java.sql.SQLException.(SQLException.java:98) at > org.postgresql.util.PSQLException.(Compiled Code) at > org.postgresql.Driver.connect(Compiled Code) at > java.sql.DriverManager.getConnection(Compiled Code) at > java.sql.DriverManager.getConnection(Compiled Code) at > sunexamples.beans.JDBCBean.go(Compiled Code) at > sunexamples.beans.HttpJDBCBean.processRequest(Compiled Code) at > pagecompile.jsp._examples._jdbc._JDBCSample._jspService(Compiled Code) at > com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(Compiled > Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at > com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(JspServlet > .java:469) at > com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(JspSer > vlet.java:259) at > com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(Compiled > Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at > com.sun.server.ServletState.callService(Compiled Code) at > com.sun.server.ServletManager.callServletService(Compiled Code) at > com.sun.server.ProcessingState.invokeTargetServlet(Compiled Code) at > com.sun.server.http.HttpProcessingState.execute(Compiled Code) at > com.sun.server.http.stages.Runner.process(Compiled Code) at > com.sun.server.ProcessingSupport.process(Compiled Code) at > com.sun.server.Service.process(Compiled Code) at > com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at > com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at > com.sun.server.HandlerThread.run(Compiled Code) JDBC/JSP Example > > Anyone have any ideas how I can work around it? I'm not sure why > connect,resolve isn't allowed...but here's the relevant line from my > pg_hba.conf: > > # TYPE DATABASE IP_ADDRESS MASK USERAUTH MAP > > host all 127.0.0.1 255.255.255.128 trust > -- > >
Did you start the postmaster with the -i switch? This allows for connections to be accepted. Hope that helps. Gary "Robert Morrow" <rhmorrow1@earthlink.net> wrote in message news:B5CF0489.20D6%rhmorrow1@earthlink.net... > Hi all, > I'm definitely a postgreSQL newbie. In trying to hook up postgreSQL to a > JSP engine (Java Web Server) using the postgreSQL jdbc driver, I get the > following error: > > Message: Something unusual has occured to cause the driver to fail. Please > report this exception: java.security.AccessControlException: access denied > (java.net.SocketPermission 127.0.0.1:5432 connect,resolve) Error code: 0 > Something unusual has occured to cause the driver to fail. Please report > this exception: java.security.AccessControlException: access denied > (java.net.SocketPermission 127.0.0.1:5432 connect,resolve) at > java.lang.Throwable.fillInStackTrace(Native Method) at > java.lang.Throwable.fillInStackTrace(Compiled Code) at > java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) > at java.sql.SQLException.(SQLException.java:98) at > org.postgresql.util.PSQLException.(Compiled Code) at > org.postgresql.Driver.connect(Compiled Code) at > java.sql.DriverManager.getConnection(Compiled Code) at > java.sql.DriverManager.getConnection(Compiled Code) at > sunexamples.beans.JDBCBean.go(Compiled Code) at > sunexamples.beans.HttpJDBCBean.processRequest(Compiled Code) at > pagecompile.jsp._examples._jdbc._JDBCSample._jspService(Compiled Code) at > com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(Compiled > Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at > com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(JspServlet > .java:469) at > com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(JspSer > vlet.java:259) at > com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(Compiled > Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at > com.sun.server.ServletState.callService(Compiled Code) at > com.sun.server.ServletManager.callServletService(Compiled Code) at > com.sun.server.ProcessingState.invokeTargetServlet(Compiled Code) at > com.sun.server.http.HttpProcessingState.execute(Compiled Code) at > com.sun.server.http.stages.Runner.process(Compiled Code) at > com.sun.server.ProcessingSupport.process(Compiled Code) at > com.sun.server.Service.process(Compiled Code) at > com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at > com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at > com.sun.server.HandlerThread.run(Compiled Code) JDBC/JSP Example > > Anyone have any ideas how I can work around it? I'm not sure why > connect,resolve isn't allowed...but here's the relevant line from my > pg_hba.conf: > > # TYPE DATABASE IP_ADDRESS MASK USERAUTH MAP > > host all 127.0.0.1 255.255.255.128 trust > -- > >