uuid748
2010-08-05 17:18spring配置问题
刚学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条回答
为你推荐
- idea无法识别spring的配置文件
- spring
- java
- maven
- intellij-idea
- java-ee
- 1个回答
- Spring 配置问题,菜鸟求解答
- spring
- 0个回答
- Spring整合Mybatis如何使用xml文件配置sql语句
- spring
- java
- 3个回答
- spring配置事务是用来干嘛的
- spring
- 事务
- 管理
- 6个回答
- Spring Boot 使用Redis缓存 配置问题
- spring
- 缓存
- redis
- 4个回答