Hi

did you try looking the ds directly without looking up openejb:Resource first?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-01-31 Poindexter, Miles <[email protected]>:
> Hi,
> I am working on upgrading my apps from TomEE 1.5.2 to 1.6.0.
> The only thing that doesn't work is the JDBC connection.
>
> In 1.5.2, I have the connections set up as Resources in 
> [TOMEE_HOME]/conf/tomee.xml.
>
> example:
> <Resource id="mdWareDS" type="javax.sql.DataSource">
>       JdbcDriver oracle.jdbc.OracleDriver
>       JdbcUrl jdbc:oracle:thin:@xxxxxx.com<http://xxxxxx.com>:1528:DEV14
>       UserName xxxx
>       Password xxxx
>       JtaManaged true
>     </Resource>
>
>
> In my code, I access the resource like this:
>
> @Resource
> private DataSource mdWareDS;
>
>
>         Context ctx = new InitialContext();
>
>         Context envContext = (Context) ctx.lookup("openejb:Resource");
>
>         // Look up a data source
>         DataSource ds = (DataSource) envContext.lookup ("mdWareDS");
>
>
>         Connection conn = getConnection( ds );
>
>         Statement stmt = conn.createStatement();
>
>    ...  etc.
>
> This works fine in 1.5.2, but with 1.6.0, I just get the error that it cannot 
> find the resource:
>
> javax.naming.NameNotFoundException: Name "Resource" not found.
>
>
> I've checked the new examples, but they seem to be using web.xml and other 
> files.  Is there a way to do it like this with 1.6.0?
>
> miles
>
> Miles Poindexter
> Service Oriented Architecture
> [email protected]<mailto:[email protected]>
> 347-967-8944 / 212-790-6692
>
>
>
>
>

Reply via email to