apache tomcat 7.0.30 datasourcerealm javax.naming.NameNotFoundException: Name [jdbc/proto] is not bound in this Context. Unable to find [jdbc]

瘦欲@ 提交于 2019-12-01 04:37:10

To avoid declaring the ressource in GlobalNamingResources, put localDataSource="true" in the Realm

In this case I believe it's because your realm (In this case it is declared at the server level) is trying to use a naming resource, jdbc/proto (Which in this case is declared at the web application level)

Here is what I understand is the java server context hierarchy

  1. Server
  2. Host
  3. WebApplication Context (can be in server.xml, or in META-INF Context.xml)

Actually this [jdbc/proto] is mentioned in ProjectName.xml as a property like

<ResourceLink global="jdbc/proto" name="jdbc/proto"/>

So make sure that ProjectName.xml file exist at tomcatInstances/ServerName/conf/Catalina/localhost/ProjectName.xml and having this resource link and your exception is gone.

I also faced the same issue and got that local context file of application was got deleted for some reason from location

tomcatInstances/ServerName/conf/Catalina/localhost/ProjectName.xml 

Restored the files from back and done... its working fine now, Hope this will help someone.

In my case the problem was that I had a conflicting dependency in my pom.xml. In my case it was the java-naming dependency. Make sure you don't have any naming dependencies / jars that conflict with Tomcat's naming libs.

After I removed it, the issue is gone (same environment as you btw).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!