gpt4 book ai didi

Spring 3匹配的通配符很严格,但是找不到元素 'jee:jndi-lookup'的声明

转载 作者:行者123 更新时间:2023-12-04 04:52:07 26 4
gpt4 key购买 nike

所以我遇到了类似这里的问题...

Spring 3.0 Error: The matching wildcard is strict, but no declaration can be found for element

我的pom看起来像这样

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
...
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/db" resource-ref="true" />

但是,当我尝试在Websphere上运行服务时,得到以下信息...
Line 16 in XML document from ServletContext resource [/WEB-INF/context/loyalty-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'.

看来这与我的链接不同,因为我已经在 namespace 中有了模式。有任何想法吗?

最佳答案

请注意xsi:schemaLocation中其他项目的模式-xmlns:*属性中的每个 namespace URI都应跟随其各自的XSD位置:

 xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">

关于Spring 3匹配的通配符很严格,但是找不到元素 'jee:jndi-lookup'的声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10951262/

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