Hi a) works but need to lookup in java:openejb/Resource. C should work on the snapshot.
Finally using 1) + @Resource(name="id") is the more portable solution IMO (using java:global can be another option too) Le 13 avr. 2013 14:00, "Bob_13042013" <[email protected]> a écrit : > Hi, > > I recently moved from Oracle Weblogic to TomEE. It was all great until I > ran > into the datasource configuration problem. I tried the following: > > First the postgres jdbc driver was dropped in the TomEE/lib directory. Then > the following combinations were tried: > > a.) resource configuration in tomee.xml. > <Resource id="myDatasource" type="DataSource"> > JdbcDriver org.postgresql.Driver > JdbcUrl jdbc:postgresql://localhost:5432/test > UserName user > Password pass > </Resource> > > b.) resource configuration in server.xml. The Resource element was put > under > GlobalNamingResources. > > c.) creating resource configuration in the META-INF/context.xml of the web > app. Adding to web.xml the following code: > <resource-ref> > <res-ref-name>myDatasource</res-ref-name> > <res-type>javax.sql.DataSource</res-type> > </resource-ref> > > Whichever configuration aforementioned was used the web app could not > locate > the datasource with the JNDI. I used in the initial context lookup also the > recommended prefix "java:comp/env/" not much help. > > In Weblogic it is very simple. You create the datasource in the weblogic > Admin. Inside the web app you call the JNDI and no issues at all. No prefix > needs to be put to find the datasource, only the datasource name configured > inside Weblogic. > > Do you know what could be the issue ? > > Thanks. > > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/cannot-JNDI-datasource-with-initialcontext-lookup-tp4662211.html > Sent from the OpenEJB Dev mailing list archive at Nabble.com. >
