users@glassfish.java.net

Re: JNDI resource lookup error in custom realm

From: <glassfish_at_javadesktop.org>
Date: Fri, 26 Jun 2009 06:55:55 PDT

Did you already try the following code:

DataSource ds = (DataSource) ConnectorRuntime.getRuntime().lookupNonTxResource("jdbc/jooss_dev", false);

This code worked pretty fine for me and this is the same way used in JDBCRealm to get a DataSource. But remember that you can't call lookupNonTxResource() during realm initialization or you will get the same error. Just call this method when you'r going to use the DataSource.
[Message sent by forum member 'yellowbike' (yellowbike)]

http://forums.java.net/jive/thread.jspa?messageID=353151