简体   繁体   English

Tomcat 8升级后的JNDI NameNotFoundException

[英]JNDI NameNotFoundException after Tomcat 8 upgrade

I upgraded from Tomcat 8.0.18 to 8.0.23 and all of the sudden I have a JNDI issue. 我从Tomcat 8.0.18升级到8.0.23,突然之间我遇到了JNDI问题。 I looked at the changelogs, Tomcat 8 Changelogs , and I see three JNDI changes, though none strike me as something that would break a previously working configuration. 我查看了更改日志Tomcat 8 Changelogs ,并且看到了三个JNDI更改,尽管没有一个更改令我震惊 ,因为这会破坏以前的工作配置。

JNDI related changes were made for bugs 49785, 57587, and an entry under 8.0.19 under "Other". 针对错误49785、57587和8.0.19下“其他”下的一个条目进行了与JNDI相关的更改。

I am receiving this exception when I start up Tomcat with 8.0.23: 当我使用8.0.23启动Tomcat时,我收到此异常:

javax.naming.NameNotFoundException: Name [jdbc/MyCluster] is not bound in this Context. Unable to find [jdbc].

In my web application I have a resource link defined: 在我的Web应用程序中,我定义了一个资源链接:

<Context>
   <ResourceLink name="jdbc/MyCluster" global="jdbc/MyCluster" auth="Container" type="javax.sql.DataSource" />
</Context>

I have Tomcat configured with: 我为Tomcat配置了:

<Resource name="jdbc/MyCluster" global="jdbc/MyCluster" ......./>

I am stumped... I cannot figure out what makes my code break after my upgrade from 18 to 23 :( 我很沮丧...从18升级到23后,我无法弄清楚是什么导致代码中断:(

Just in case anyone was curious about how upgrading from Tomcat 8.0.18 to 8.0.24 could really cause JNDI to screw up, the answer lies in ANT. 万一有人好奇从Tomcat 8.0.18升级到8.0.24可能真的导致JNDI搞砸了,答案就在于ANT。

ANT Copy documentation ANT复制文档

Myself and some other engineers had no idea that ANT Copy does nothing if the file you are trying to overwrite has a newer timestamp... who knew copy had such a complicated condition!?! 我自己和其他工程师都不知道,如果要覆盖的文件具有新的时间戳,则ANT Copy不会执行任何操作……谁知道该副本的情况如此复杂!!! I believe this is why me and multiple people never looked at the documentation, it is such an unexpected behavior. 我相信这就是为什么我和很多人从未看过文档的原因,这是一种意外的行为。

Anyways, by upgrading to the newer version of Tomcat my context.xml that contained the resourcelink jdbc/MyCluster was failing to overwrite the newer and more recent timestamp of Tomcat's default context.xml! 无论如何,通过升级到较新版本的Tomcat,包含资源链接jdbc / MyCluster的context.xml无法覆盖Tomcat默认context.xml的较新的时间戳! Once the overwrite flag is set to true, JNDI works again :) 一旦覆盖标志设置为true,JNDI将再次起作用:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JNDI查找失败(NameNotFoundException) - JNDI lookup failed (NameNotFoundException) JNDI失败,出现NameNotFoundException - JNDI failing with NameNotFoundException 使用IntelliJ部署到远程Tomcat实例的Web应用程序找不到JNDI资源(javax.naming.NameNotFoundException) - Web application deployed to remote Tomcat instance using IntelliJ cannot find JNDI resource (javax.naming.NameNotFoundException) 使用JNDI配置EJB:NameNotFoundException - Using JNDI to configure EJBs: NameNotFoundException Glassfish NameNotFoundException用于远程JNDI查找 - Glassfish NameNotFoundException for remote JNDI lookup JNDI失败,并出现javax.naming.NameNotFoundException:在部署Spring Boot2 Tomcat 9时,此上下文未绑定名称[jdbc / Database] - JNDI fails with javax.naming.NameNotFoundException:Name [jdbc/Database] is not bound in this Context when deploying Spring Boot2 Tomcat 9 NO EMBEDDED JNDI LOOKUP错误Tomee OpenEJB NameNotFoundException - JNDI LOOKUP Error Tomee OpenEJB NameNotFoundException 邮件会话资源JNDI查找中Jetty 9中的NameNotfoundException - NameNotfoundException in Jetty 9 at mail session resource JNDI lookup 从数据源,JNDI打开连接时出现NameNotFoundException - NameNotFoundException while opening connection from Datasource, JNDI WebLogic中的本地会话Bean JNDI查找-NameNotFoundException - Local session bean JNDI lookup in WebLogic - NameNotFoundException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM