spring配置问题

刚学spring,一开始就遇到个异常。
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [xml/1.xml]; nested exception is org.springframework.beans.FatalBeanException: Unable to load schema mappings from location [META-INF/spring.schemas]; nested exception is java.util.zip.ZipException: 拒绝访问。

 我一共就干了3件事。

加jar包

aspectjrt.jar

aspectjweaver.jar

cglib-nodep-2.1_3.jar

common-annotations.jar

commons-dbcp.jar

commons-logging.jar

commons-pool.jar

log4j-1.2.15.jar

spring.jar

spring-webmvc-struts.jar

写配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
</beans>

 

搞个main方法测一下。。。。结果就报错。。。

public static void main(String[] args){
  ApplicationContext ac = new ClassPathXmlApplicationContext(
  "xml/1.xml");
 }

 

 

应该是配置文件写的有问题,建议你下载spring的完整包。里边会提供一些实例。吧哪里的配置文件拷过来,然后按照自己的配置更改!

配置文件beans里面写错了。到网上找个,太多了

spring的配置写的有问题

路劲正确??