JNDI后的NameNotFoundException Tomcat的8升级 [英] JNDI NameNotFoundException after Tomcat 8 upgrade

查看:279
本文介绍了JNDI后的NameNotFoundException Tomcat的8升级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Tomcat 8.0.18升级到8.0.23和所有的突然我有一个JNDI的问题。我看着更改日志, Tomcat的8更新日志,我看到三个JNDI变化,虽然没有打我的东西会打破了previously工作配置。

I upgraded from Tomcat 8.0.18 to 8.0.23 and all of the sudden I have a JNDI issue. 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.

有关错误49785,57587作了JNDI相关的变化,并根据8.0.19下一个条目其他。

JNDI related changes were made for bugs 49785, 57587, and an entry under 8.0.19 under "Other".

当我启动Tomcat的用8.0.23我收到此异常:

I am receiving this exception when I start up Tomcat with 8.0.23:

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

在我的web应用程序我有定义的资源链接:

In my web application I have a resource link defined:

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

我已经配置在Tomcat中:

I have Tomcat configured with:

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

我难倒...我想不出从18我升级到23后,是什么让我的code突破:(

I am stumped... I cannot figure out what makes my code break after my upgrade from 18 to 23 :(

推荐答案

万一有人很好奇如何升级从Tomcat 8.0.18到8.0.24可能真的会造成JNDI搞砸了,答案就在ANT。

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.

ANT复制文档

我和其他一些工程师,没想到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!?! I believe this is why me and multiple people never looked at the documentation, it is such an unexpected behavior.

不管怎么说,通过升级到Tomcat的较新版本的context.xml我所包含的resourcelink JDBC / MYCLUSTER是失败覆盖Tomcat的默认的context.xml的更新,更近的时间戳!一旦复写标志设置为true,JNDI再次工作:)

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! Once the overwrite flag is set to true, JNDI works again :)

这篇关于JNDI后的NameNotFoundException Tomcat的8升级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆