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

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

问题描述:

所以我有一个类似于这里的问题...

So I am having an issue similar to here...

Spring 3.0错误:匹配的通配符是严格的,但不能为元素找到声明

我的pom看起来像这样

my pom looks like this

<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上运行服务时,我得到以下内容...

But when I try to run the service on Websphere I get the following...

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'.

似乎这与我的链接不同,因为我已经在命名空间中有模式。任何想法?

It seems this is different from my link because I already have the schema in the namespace. Any ideas?

请注意 xsi中的其他项目的模式:schemaLocation - 来自 xmlns:* 属性的每个命名空间URI后面应该有相应的XSD位置:

Note the pattern of other items in xsi:schemaLocation - each namespace URI from xmlns:* attribute should be followed by its respective XSD location:

 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">