uuid748 2010-08-05 17:18
浏览 176
已采纳

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条回答

  • wangyu19830327 2010-08-13 20:10
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog