You have to use: "openejb:Resource/" + dataSourceName 2012/10/25 Romain Manni-Bucau <rmannibu...@gmail.com>
> Use java:openejb/Resource prefix i think > Le 25 oct. 2012 14:50, "Berner Martin" <martin.ber...@qualitasag.ch> a > écrit : > > > Hi, > > We use org.apache.catalina.realm.DataSourceRealm to authenticate and so > on. > > > > The Realm is configured in META-INF/context.xml referencing a Datasource > > by name: > > <Realm className="org.apache.catalina.realm.DataSourceRealm" > > dataSourceName="jdbc/sheeprealm" digest="MD5" roleNameCol="ROLE_NAME" > > userCredCol="USER_PASS" userNameCol="USER_NAME" > > userRoleTable="GESTHO.VR_AUTH_USER_ROLES" > > userTable="GESTHO.VR_AUTH_USER_PASSWORD"/> > > > > The Datasource is configured in server.xml in GlobalNamingResources: > > <Resource auth="Container" > > connectionProperties="v$session.program=08_SchafeRealm;" > > driverClassName="oracle.jdbc.OracleDriver" maxActive="20" maxIdle="10" > > maxWait="-1" name="jdbc/sheeprealm" password="XXX" > > type="javax.sql.DataSource" url="XXX" username="XXX"/> > > > > I'd like to do the resource definition in resources.xml to be able to use > > Placeholders for DatabaseUrl. But if I move the declaration to > resource.xml > > the Realm dosen't find the Datasource. > > > > Okt 25, 2012 2:48:36 PM org.apache.catalina.realm.DataSourceRealm open > > Schwerwiegend: Exception performing authentication > > javax.naming.NameNotFoundException: Name [sheeprealm] is not bound in > this > > Context. Unable to find [sheeprealm]. > > at org.apache.naming.NamingContext.lookup(NamingContext.java:820) > > at org.apache.naming.NamingContext.lookup(NamingContext.java:154) > > at org.apache.naming.NamingContext.lookup(NamingContext.java:831) > > at org.apache.naming.NamingContext.lookup(NamingContext.java:168) > > at > > org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:394) > > at > > > org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:285) > > at > > > org.apache.catalina.realm.CombinedRealm.authenticate(CombinedRealm.java:146) > > at > > org.apache.tomee.catalina.TomEERealm.authenticate(TomEERealm.java:43) > > at > > > org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:295) > > at > > > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:450) > > at > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) > > at > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) > > at > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) > > at > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) > > at > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) > > at > > > org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) > > at > > > org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) > > at > > > org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) > > at > > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) > > at > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > > at java.lang.Thread.run(Thread.java:722) > > > > > > Is it possible, and how do I do that? > > > > Martin Berner > > > -- ------------------------------------------------------------------- *SCJA. José Luis Cetina* -------------------------------------------------------------------