`

Sping容器加载xsd文件时的问题

    博客分类:
  • java
阅读更多
今天遇到一个非常奇怪的spring容器问题,先看日志
]-303 Loading XML bean definitions from class path resource [com/eucita/component/activemq/applicationContext-activemq-topic.xml]
-75 Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]
r]-103 Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd]
r]-114 Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd
r]-103 Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/context/spring-context-2.5.xsd]
r]-114 Found XML schema [http://www.springframework.org/schema/context/spring-context-2.5.xsd] in classpath: org/springframework/context/config/spring-context-2.5.xsd
r]-103 Trying to resolve XML entity with public id [null] and system id [http://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd]

环境是

tomcat6.0(中间换glassfish2.0也试过)

spring2.5

activemq5.0

使用eclipse,和IDEA调试程序

问题是:在出了上面的日志以后,CPU占用率从50%左右直接下降到2-3%,然后就一直停在这里,没有响应。

 

team里面有3台同时出现这个问题,调试了一段时间找不到原因,试着重启了电脑,然后问题消失。

猜想是IDE造成的,但是同时几个人,不同IDE,出同样问题,非常诡异。

 

 

 

分享到:
评论
7 楼 zqs_wh 2008-11-17  
学习了哈
新手刚刚开始上路
6 楼 andyao 2008-02-29  
codeall 写道
我找到一个解决办法, 不知道是否根治

问题出在amq5的META-INF里的spring.schemas中

http\://activemq.apache.org/schema/activemq-core.xsd = activemq.xsd

这是错的

我在我的classespath中新建了META-INF

内容为

# fix amq5
http\://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd=activemq.xsd

我这里已经OK了


目前我的是spring2.5 + xbean-spring3.3 + activemq5, 在tomcat6.0.14/jdk6里



问题就是处在这里,其实不用自己建META-INF,更改spring xml配置的schema声明即可
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.org/config/1.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context-2.5.xsd
 	http://activemq.org/config/1.0
 	http://activemq.apache.org/schema/activemq-core-5.0.xsd">


将原来的http://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd改为http://activemq.apache.org/schema/activemq-core-5.0.xsd
5 楼 codeall 2008-02-22  
我找到一个解决办法, 不知道是否根治

问题出在amq5的META-INF里的spring.schemas中

http\://activemq.apache.org/schema/activemq-core.xsd = activemq.xsd

这是错的

我在我的classespath中新建了META-INF

内容为

# fix amq5
http\://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd=activemq.xsd

我这里已经OK了


目前我的是spring2.5 + xbean-spring3.3 + activemq5, 在tomcat6.0.14/jdk6里



4 楼 codeall 2008-02-22  
主要是想用activemq5
换了spring2+amq5还是不行
郁闷啊
3 楼 fsroger 2008-02-22  
spring2.5+activemq4.0以前试过可以的,好象xbean-spring.jar有关系。但后来sprin2.5跟其他类似quartz又有点冲突,最后我还是用spring2+activemq4.0这种方式。感觉spring2.5单独使用,替换spring2.0是没有问题的,但是一结合其他一些东西就出问题。不过这只是我个人的观点而已....
2 楼 codeall 2008-02-22  
我用spring2.0和2.5都是这样的问题, 到现在重启了几次还是这样
去掉http://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd, 使用spring1.0的xml语法就可以了.
我还没找到问题在哪里.
郁闷啊.
1 楼 xiaolin0105 2008-02-04  
spring,人人都用它,可惜我不会。。。
Global site tag (gtag.js) - Google Analytics