What is changed in the Weblogic 12.1.2 JNDI handling?
My EJB 2.1 application has been working fine with Weblogic versions up to 12.1.1, but with version 12.1.2 it is giving the following error at startup:
weblogic.application.ModuleException: javax.naming.NameNotFoundException: remaining name: comp/env/jdbc/DataSourceAlias
where jdbc/DatasourceAlias is the res-ref-name of the actual datasource named jdbc/APP_DATASOURCE which is set through the admin console.
The discovery of the datasource is performed by this piece of code :
ds = initialContext.lookup ("java:comp/env/" + refName)
This is what is failing with Weblogic 12. After some research I found out that in order for the datasource lookup to succeed, I have to :
1) ignore the subcontext "comp/env" and
2) use the actual JNDI name "jdbc/APP_DATASOURCE" instead of the reference "jdbc/DataSourceAlias"
However for the EJBs, nothing is changed, they are found in the comp/env subcontext.
Hope this helps someone, or let someone tell me how the migration to Weblogic 12.1.2 is supposed to be done.