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