uuid748
uuid748
2010-08-05 17:18

spring配置问题

  • 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");
 }

 

 

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐

换一换