hi

try openejb:Resource/

or use java:global/foo in the id (writting it i doubt of the need of java:
here)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/6/11 SPB <[email protected]>

> Hi,
>
> Using Tomcat Plus WebApp 1.5.2 running in Tomcat 7.0.27
>
> In tomee.xml I have defined my Data Source:
> <Resource id="PooledDataSource" type="javax.sql.DataSource">
>     .....
> </Resource>
>
>
> JMX shows:
> Catalina -> Resource -> Global ->
> org.apache.openejb.resource.jdbc.DataSourceFactory -> PooledDataSource
>
> Code calls:
>             // Tried lots of different values for this jndiPrefix majic:
>             static final String jndiPrefix = "java:global/";
>
>             Context ctx = new InitialContext();
>             DataSource ds = (DataSource) ctx.lookup(jndiPrefix +
> "PooledDataSource");
>             Connection connection = ds.getConnection();
>
> Always gets naming.NameNotFoundException.
>
> What should the prefix be?
> Note, I have tried without prefix; also fails.
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Struggling-with-JNDI-lookup-tp4663626.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Reply via email to