tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Baty <batym...@yahoo.com>
Subject Re: Tomcat5.5 postgresql, security oh my
Date Mon, 03 Dec 2007 15:18:31 GMT
Sorry,
If Tomcat5.5 security is off I'm able to get a connection. If Security is on I get catched
out and get:


org.postgresql.util.PSQLException: Something unusual has occured to cause the driver to fail.
Please report this exception.
org.postgresql.util.PSQLException: Something unusual has occured to cause the driver to fail.
Please report this exception.
    at org.postgresql.Driver.connect(Driver.java:263)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at org.apache.jsp.yougarage.newMember_jsp._jspService(newMember_jsp.java:79)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission
localhost resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    at java.security.AccessController.checkPermission(AccessController.java:427)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
    at java.net.InetAddress.getAllByName(InetAddress.java:1061)
    at java.net.InetAddress.getByName(InetAddress.java:958)
    at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
    at java.net.Socket.<init>(Socket.java:179)
    at org.postgresql.core.PGStream.<init>(PGStream.java:60)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:77)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:116)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:369)
    at org.postgresql.Driver.connect(Driver.java:245)
    ... 34 more
Thanks.
Chris

----- Original Message ----
From: Peter Crowther <Peter.Crowther@melandra.com>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Monday, December 3, 2007 8:54:56 AM
Subject: RE: Tomcat5.5 postgresql, security oh my


Exactly which Tomcat version?
What "doesn't work"?  What error do you get, under what circumstances?

                - Peter

> -----Original Message-----
> From: Chris Baty [mailto:batymohn@yahoo.com]
> Sent: 03 December 2007 13:37
> To: users@tomcat.apache.org
> Subject: Tomcat5.5 postgresql, security oh my
>
> Hi all,
>  I'm trying to get Tomcat5.5 working with Poestgresql.  I know I got
>  everything configured right because if I turn Tomcat
> security off, in /
>  etc/default/tomcat, everything works fine.  My site directory
>  is at /usr/share/tomcat5.5-webapps/ROOT/myapp.  I want security on
 so
>  this is my /etc/tomcat5.5/policy.d/02debian.policy file:
>
>  // These permissions apply to all JARs from Debian packages
>  grant codeBase "file:/usr/share/java/-" {
>    permission java.security.AllPermission;
>
> };
>
>
> //Driver location
>  grant codeBase "file:/usr/share/tomcat5.5/common/lib/-" {
>    permission java.security.AllPermission;
>  };
>
>
> grant codeBase "file:/usr/share/tomcat5.5-webapps/ROOT/myapp/-" {
>    permission java.security.AllPermission;
>  };
>
>
> grant codeBase "file:/usr/share/ant/lib/-" {
>    permission java.security.AllPermission;
>  };
>
>
> It doesn't work so could someone tell me where I'm going as stray?
>  Thanks.
>  Chris
>
>
>
>
>
> ______________________________________________________________
> ______________________
> Never miss a thing.  Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>

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







      ____________________________________________________________________________________
Get easy, one-click access to your favorites. 
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message