While migrating from Tomcat to Weblogic 12.1.3 I got this exception javax.naming.namenotfoundexception while trying to look up
then I have tried the following
Unlike Tomcat, weblogic creates multiple servers (Usually an Admin Server, plus at least one other). Each server has to be allocated the data source. In a clustered environment, you need to apply the datasource to the cluster servers.
You should be to connect to the datasource as normal. I always use a Spring JNDI bean, so I can't help with the exact syntax. The suggestions by @Maas look good.
Restarting the server after deployment helps.
For me, starting the managed server from Windows command line instead of starting it using the WebLogic Admin console solved the javax.naming.NameNotFoundException
problem. Not sure why this was the case though.
Check the JNDI case (MyDB != MyDb). It sounds trivial, but it happened to me and had a hard time spotting it. Since this is the first thread google returns when searching for this issue, I post it here in case it helps.
Besides that, @kiwiron 's answer covers everything else.