And if you lookup java:global/jdbc/**MyDataSource it works?

basically tomee is done of multiple context apparently merged (for lookup).
Your datasource is in the globale context whenre the simple context us the
internal one (may depend on your envrt) and the java: is the bean java: one

*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/5/31 Fawzib Rojas <[email protected]>

> I have a datasource resource added in tomee.xml (java:global/jdbc/**
> MyDataSource)
>
> AFAIK, a Context is like a directory for objects, you enter the path you
> find the object, so I made a function to walk through the context tree.
>
> When I try to walk the InitialContext, is always empty (why, shouldnt the
> "java:" context be there?)
>
> When I try context.lookup("java:") I get:
>    1) module (Context)
>         a) global (Context)
>     2) global (Context)
>     3) comp (Context)
>         a) env (Context)
>         b) other objects (ORB/TimerService, etc)
>     4) app (Context)
>
> But my datasource is not inside java:global, I imagine there should be a
> jdbc context inside java:global (#2) with my datasource inside but there
> isnt. Yet if I lookup("java:global/jdbc"), my datasource is listed.
>
>

Reply via email to