无法加载Spring 3模式 [英] Can't load spring 3 schemas

查看:86
本文介绍了无法加载Spring 3模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Spring 3.0.5.RELEASE 今天,当使用Maven构建项目时,我在 appicationContext.xml 文件中遇到以下错误:

i am using Spring 3.0.5.RELEASE and today when building the project with maven, i am getting following errors in appicationContext.xml file:

 - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 
     'context:component-scan'.
 - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-
 config'.
 - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-
     driven'.

我试图打开架构链接:

但是我总是会看到页面禁止!

but i always gets the page Forbidden !

这是我配置 applicationContext.xml 的方式:

<?xml version="1.0" encoding="UTF-8"?> 
<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:tx="http://www.springframework.org/schema/tx" 
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="
           http://www.springframework.org/schema/beans     
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/tx 
           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
           http://www.springframework.org/schema/context 
           http://www.springframework.org/schema/context/spring-context-3.0.xsd">

请告知如何解决此错误.

please advise how to fix this error.

推荐答案

似乎不再提供公共模式,因此我从类路径上的jar中加载了模式,如下所示:

seems that the public schemas are not available anymore, so i load the schemas from the jars on the classpath instead as follows:

<?xml version="1.0" encoding="UTF-8"?> 
<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:tx="http://www.springframework.org/schema/tx" 
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="  
           http://www.springframework.org/schema/beans 
           classpath:/org/springframework/beans/factory/xml/spring-beans-3.0.xsd
           http://www.springframework.org/schema/tx
           classpath:/org/springframework/transaction/config/spring-tx-3.0.xsd
           http://www.springframework.org/schema/context  
           classpath:/org/springframework/context/config/spring-context-3.0.xsd">

这篇关于无法加载Spring 3模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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