-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everybody,

Ew.  Don't use a JDBCRealm (it's synchronised etc), use a
DataSourceRealm with an appropriately configured DataSource.

so I changed my META-INF/context.xml to:

- ---
<Context reloadable="true">

        <Resource name="jdbc/pgsql" global="jdbc/game" auth="Container"
                type="javax.sql.DataSource" 
driverClassName="org.postgresql.Driver"
                url="jdbc:postgresql:game" username="username" 
password="password"
                maxActive="20" maxIdle="10" />

        <Realm className="org.apache.catalina.realm.DataSourceRealm"
                dataSourceName="jdbc/pgsql"
                userTable="player" userNameCol="loginname" 
userCredCol="password"
                userRoleTable="player" roleNameCol="role" />
</Context>
- ---

and added some lines to the WEB-INF/web.xml

- ---
...
        <resource-ref>
                <res-ref-name>jdbc/pgsql</res-ref-name>
                <res-type>javax.sql.DataSource</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>
...
- ---

Now, when I try to login via the login form of tomcat I get this:

- ---
13.05.2010 21:59:07 org.apache.catalina.realm.DataSourceRealm open
SCHWERWIEGEND: Exception performing authentication
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
        at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.catalina.realm.DataSourceRealm.open (DataSourceRealm.java:415) at org.apache.catalina.realm.DataSourceRealm.authenticate (DataSourceRealm.java:296) at org.apache.catalina.authenticator.FormAuthenticator.authenticate (FormAuthenticator.java:259) at org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:449) at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run (JIoEndpoint.java:489)
        at java.lang.Thread.run(Unknown Source)
- ---

And this is even before hibernate tries to access the DB.
I asked the tomcat documentation and google, but I think I know too less of this to get the right answer.

Thanks for helping so far.

Regards
MaxX
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkvsXkUACgkQ/6VVXRqA3iefYwCgu8j1MHRDnBO7NYOwTIj8ZZ4J
Pe0Ani+hgm3JWgn61JJeF2hv3Fck75rT
=OA9Z
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to