You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Grant Edwards <tn...@hotmail.com> on 2002/05/09 23:09:56 UTC

Postgres JDBCRealms : Tomcat-4.0.1

Hi,

I am having a bit of trouble getting my Postgres JDBCRealm correctly 
configured.
If I start up my combined JBoss-2.4.4_Tomcat-4.0.1 stack, I am able to get a 
connection to the DB and all is ok. Running the following command also works 
fine : /usr/local/pgsql/bin/psql -h localhost -U userName -W testDB.


The exception (see below) occurs when I try and run Tomcat by itself.

Does the config for the JDBCRealm look correct ?

<Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
                driverName="org.postgresql.Driver"
                
connectionURL="jdbc:postgresql://localhost.localdomain:5432/testDB"
                connectionName="userName"
                connectionPassword="password"
                userTable="users"
                userNameCol="user_name"
                userCredCol="user_pass"
                userRoleTable="user_roles"
                roleNameCol="role_name" />


[gedwards@localhost bin]$ ./catalina.sh run -security
Guessing CATALINA_HOME from catalina.sh to ./..
Setting CATALINA_HOME to ./..
./../bin/bootstrap.jar
Using CLASSPATH:     
./../bin/bootstrap.jar:/home/gedwards/usr/local/postgresql-7.2/src/interfaces/jdbc/jars/postgresql.jar:/home/gedwards/usr/local/jdk1.3.1_01/lib/tools.jar
Using CATALINA_BASE: ./..
Using CATALINA_HOME: ./..
Using JAVA_HOME:     /home/gedwards/usr/local/jdk1.3.1_01
Using Security Manager
Starting service Tomcat-Standalone
Apache Tomcat/4.0.1
Catalina.start: LifecycleException:  Exception opening database connection:  
Something unusual has occured to cause the driver to fail. Please report 
this exception: Exception: java.security.AccessControlException: access 
denied (java.net.SocketPermission localhost.localdomain resolve)
Stack Trace:

java.security.AccessControlException: access denied 
(java.net.SocketPermission localhost.localdomain resolve)
        at 
java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
        at 
java.security.AccessController.checkPermission(AccessController.java:399)
        at 
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
        at java.lang.SecurityManager.checkConnect(SecurityManager.java:1042)
        at java.net.InetAddress.getAllByName0(InetAddress.java:559)
        at java.net.InetAddress.getAllByName0(InetAddress.java:540)
        at java.net.InetAddress.getByName(InetAddress.java:449)
        at java.net.Socket.<init>(Socket.java:100)
        at org.postgresql.PG_Stream.<init>(Unknown Source)
        at org.postgresql.Connection.openConnection(Unknown Source)
        at org.postgresql.Driver.connect(Unknown Source)
        at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:548)
        at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:613)
        at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
        at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
        at 
org.apache.catalina.core.StandardService.start(StandardService.java:388)
        at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
End of Stack Trace



Many thanks

Regards

Grant E

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Postgres JDBCRealms : Tomcat-4.0.1

Posted by James Williamson <ja...@nameonthe.net>.
Grant,

The stack trace tells you exactly what's going wrong,
you need to relax the security regarding opening sockets.
Modify the catalina.policy file in your conf directory.

Regards,

James Williamson
www.nameonthe.net
UK Tomcat Hosting

----- Original Message -----
From: Grant Edwards <tn...@hotmail.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, May 09, 2002 10:09 PM
Subject: Postgres JDBCRealms : Tomcat-4.0.1


> Hi,
>
> I am having a bit of trouble getting my Postgres JDBCRealm correctly
> configured.
> If I start up my combined JBoss-2.4.4_Tomcat-4.0.1 stack, I am able to get
a
> connection to the DB and all is ok. Running the following command also
works
> fine : /usr/local/pgsql/bin/psql -h localhost -U userName -W testDB.
>
>
> The exception (see below) occurs when I try and run Tomcat by itself.
>
> Does the config for the JDBCRealm look correct ?
>
> <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
>                 driverName="org.postgresql.Driver"
>
> connectionURL="jdbc:postgresql://localhost.localdomain:5432/testDB"
>                 connectionName="userName"
>                 connectionPassword="password"
>                 userTable="users"
>                 userNameCol="user_name"
>                 userCredCol="user_pass"
>                 userRoleTable="user_roles"
>                 roleNameCol="role_name" />
>
>
> [gedwards@localhost bin]$ ./catalina.sh run -security
> Guessing CATALINA_HOME from catalina.sh to ./..
> Setting CATALINA_HOME to ./..
> ./../bin/bootstrap.jar
> Using CLASSPATH:
>
./../bin/bootstrap.jar:/home/gedwards/usr/local/postgresql-7.2/src/interface
s/jdbc/jars/postgresql.jar:/home/gedwards/usr/local/jdk1.3.1_01/lib/tools.ja
r
> Using CATALINA_BASE: ./..
> Using CATALINA_HOME: ./..
> Using JAVA_HOME:     /home/gedwards/usr/local/jdk1.3.1_01
> Using Security Manager
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0.1
> Catalina.start: LifecycleException:  Exception opening database
connection:
> Something unusual has occured to cause the driver to fail. Please report
> this exception: Exception: java.security.AccessControlException: access
> denied (java.net.SocketPermission localhost.localdomain resolve)
> Stack Trace:
>
> java.security.AccessControlException: access denied
> (java.net.SocketPermission localhost.localdomain resolve)
>         at
>
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:272)
>         at
> java.security.AccessController.checkPermission(AccessController.java:399)
>         at
> java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
>         at
java.lang.SecurityManager.checkConnect(SecurityManager.java:1042)
>         at java.net.InetAddress.getAllByName0(InetAddress.java:559)
>         at java.net.InetAddress.getAllByName0(InetAddress.java:540)
>         at java.net.InetAddress.getByName(InetAddress.java:449)
>         at java.net.Socket.<init>(Socket.java:100)
>         at org.postgresql.PG_Stream.<init>(Unknown Source)
>         at org.postgresql.Connection.openConnection(Unknown Source)
>         at org.postgresql.Driver.connect(Unknown Source)
>         at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:548)
>         at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:613)
>         at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
>         at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
>         at
> org.apache.catalina.core.StandardService.start(StandardService.java:388)
>         at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
>         at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
>         at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
> End of Stack Trace
>
>
>
> Many thanks
>
> Regards
>
> Grant E
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>