Spring 3 匹配通配符是严格的,但是找不到元素'jee:jndi-lookup'的声明 [英] Spring 3 The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'

查看:26
本文介绍了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"> 

这篇关于Spring 3 匹配通配符是严格的,但是找不到元素'jee:jndi-lookup'的声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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