gpt4 book ai didi

java - 在 ibm-web-bnd.xml 中找不到名称为 'jdbc/devl' 的资源引用

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:32:36 26 4
gpt4 key购买 nike

RAD 7,WebSphere 7。

ibm-web-bnd.xml:

<resource-ref name="jdbc/devl" binding-name="jdbc/devl" />

web.xml:

<resource-ref>
<res-ref-name>jdbc/devl</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
<mapped-name>jdbc/devl</mapped-name>
</resource-ref>

这符合我在网上看到的例子。这是因为我正在将此应用程序转换为 servlet 2.5。据我了解,web.xml 中的 res-ref-name 应该与 resource-ref 中的 name 属性相匹配。然后绑定(bind)名称与管理控制台中定义的数据源相匹配。为简单起见,我将它们全部匹配。

是否有其他设置?因为这会产生问题标题中描述的错误。

最佳答案

我多次遇到同样的问题。当我关闭 eclipse 时它消失了,当我重新打开它时我做了一个“项目->干净”。我希望它对下一个出现此错误的人有用。 enter image description here

还要确保将 web.xml header 更新为 2.5 或更高版本 (3.0)。这与项目的各个方面有关,确保它们具有相同的版本 enter image description here

如果它不允许你改变它,你应该在这个文件中改变它:“org.eclipse.wst.common.project.facet.core.xml”

如果错误仍然存​​在,您应该重新生成绑定(bind)文件。确保您在项目的各个方面具有正确的服务器设置 enter image description here

要生成文件,您必须从 Java EE 工具中完成。 enter image description here

请记住,ibm-web-bnd.xml 和 web.xml 必须在同一目录中

构建并清理项目。

关于java - 在 ibm-web-bnd.xml 中找不到名称为 'jdbc/devl' 的资源引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25789117/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com