Sorry, very stupid question.
When I describe my database as simple word, like:
all works fine as ctx.lookup("java:DataSource");
but in other application servers (for ex. Weblogic) my DataSource resource achieved thru ctx.lookup("java:comp/env/jdbc/DataSource")
so, I want compatibility and if I describe my database like
I see in logs that it mapped to java:comp/env/jdbc/DataSource
but trying to lookup as "java:comp/env/jdbc/DataSource" was failed with exception.
How I can force JBoss AS to lookup java:comp/env/jdbc/DataSource resource?
The java:comp/env namespace belongs to each component (like the war, ejb etc...). Where are you doing the lookup from? If it's a EJB, then in your ejb-jar.xml you have to add the resource-ref entry. See this post for details http://www.jboss.com/index.html?module=bb&op=viewtopic&t=118662#4084585