关闭

webx工程tomcat启动报错 ( 方案不能包含具有相同名称的两个全局组件; 而此方案中包含两个)

1070人阅读 评论(0) 收藏 举报
webx工程tomcat启动报错
2012-06-15, 15:09 UTC,
webx工程tomcat启动报错
webx工程maven 打包之后,放到tomcat7下运行,报错信息:

1672 [2012-06-15 15:00:01 ] - [ip=, ref=, ua=, sid=]
ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 i
n XML document from ServletContext resource [/WEB-INF/webx.xml] is invalid; nest
ed exception is org.xml.sax.SAXParseException: sch-props-correct.2: A schema can
not contain two global components with the same name; this schema contains two o
ccurrences of 'http://www.alibaba.com/schema/services/uris,URIBrokerServerInfo'.

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:396) ~[spring-beans-3.0.6.RELEASE.ja
r:3.0.6.RELEASE]

这个是什么原因啊?webx.xml都是创建项目的时候自动生成的。。。。
2012-06-15, 15:45 UTC,
RE: webx工程tomcat启动报错
给个完整的stacktrace,再把webx.xml贴上来。
2012-06-18, 09:29 UTC, (这个帖子最后修改于: 2012-06-18, 13:48 UTC {2} by baobao.)
RE: webx工程tomcat启动报错
代码:
2140 [2012-06-18 09:27:36 ] -   [ip=, ref=, ua=, sid=]
  INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from
ServletContext resource [/WEB-INF/webx.xml]

2562 [2012-06-18 09:27:36 ] -   [ip=, ref=, ua=, sid=]
ERROR o.s.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 i n XML document from ServletContext resource [/WEB-INF/webx.xml] is invalid; nest ed exception is org.xml.sax.SAXParseException: sch-props-correct.2: A schema can not contain two global components with the same name; this schema contains two o ccurrences of 'http://www.alibaba.com/schema/services/uris,URIBrokerServerInfo'.
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) ~[spring-beans-3.0.6.RELEASE.ja r:3.0.6.RELEASE]
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) ~[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) ~[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) ~[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) ~[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) ~[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) ~[spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) ~[spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) ~[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) ~[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) ~[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282) ~[spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204) ~[spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at com.alibaba.citrus.webx.context.WebxComponentsLoader.initWebApplicationContext(WebxComponentsLoader.java:127) [citrus-webx-all-3.0.7.jar:3.0.7]
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723) [catalina.jar:7.0.22]
        at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226) [catalina.jar:7.0.22]
        at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221) [catalina.jar:7.0.22]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [na:1.6.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:138) [na:1.6.0_21]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_21]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_21]
        at java.lang.Thread.run(Thread.java:619) [na:1.6.0_21]
Caused by: org.xml.sax.SAXParseException: sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://www.alibaba.com/schema/services/uris,URIBrokerServerInfo'.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2537) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2528) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.checkForDuplicateNames(XSDHandler.java:2202) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.buildGlobalNameRegistries(XSDHandler.java:1158) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:575) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2436) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1781) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235) ~[na:1.6.0_21]
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284) ~[na:1.6.0_21]
        at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) ~[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388) ~[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
        ... 22 common frames omitted2012-6-18 9:27:36 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart


附件
.txt   webx.xml.txt (大小: 5.82 KB / 下载: 5)
2012-06-18, 13:58 UTC,
RE: webx工程tomcat启动报错
1. 我帮你把异常信息格式化了。以后最好能格式化好以后再贴,否则太难看了。

2. 从你目前的信息我还无法判断根本原因,能不能请你:

* 从你的web项目下(不是parent项目,如果有的话),执行mvn springext:run
* 打开浏览器,查看:http://localhost:8080/schema/services-uris.xsd
* 把内容贴给我看。

从症状上看,你的系统中出现了重复的schema文件,这个有可能是jar包冲突,或是你自己创建schema时没处理好导致冲突。
2012-06-19, 08:55 UTC, (这个帖子最后修改于: 2012-06-19, 10:44 UTC {2} by jql294671405.)
RE: webx工程tomcat启动报错
谢谢baobao,以下是http://localhost:8080/schema/services-uris.xsd的内容,出现了重复的http://localhost:8080/schema/services/uris/content-uri.xsd
这个是什么原因引起的呢?我自己没有手动创建过schema
代码:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:springext="http://www.alibaba.com/schema/springext/base" xmlns="http://www.alibaba.com/schema/services/uris" targetNamespace="http://www.alibaba.com/schema/services/uris" elementFormDefault="qualified">
<xsd:include schemaLocation="http://localhost:8080/schema/www.alibaba.com/schema/services/uris/uris-base.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/content-uri.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/servlet-content-uri.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/servlet-uri.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/turbine-classic-uri.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/turbine-content-uri.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/turbine-uri.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/uri-bean.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/uri.xsd"/>
<xsd:include schemaLocation="http://localhost:8080/schema/services/uris/content-uri.xsd"/>
</xsd:schema>
2012-06-19, 13:52 UTC,
RE: webx工程tomcat启动报错
你查找一下你的系统中有多少个:META-INF/services-uris.bean-definition-parsers 文件,能否列出它们的内容?

可以用下面的代码:

com.alibaba.citrus.util.ClassLoaderUtil.getResources("META-INF/services-uris.bean-definition-parsers");
2012-06-20, 09:09 UTC,
RE: webx工程tomcat启动报错
只有一个url,具体内容如下
jar:file:/D:/MavenRepository/com/alibaba/citrus/citrus-webx-all/3.0.7/citrus-webx-all-3.0.7.jar!/META-INF/services-uris.bean-definition-parsers

代码:
uri=com.alibaba.citrus.service.uribroker.impl.uri.GenericURIBrokerDefinitionParser
content-uri=com.alibaba.citrus.service.uribroker.impl.uri.ContentURIBrokerDefinitionParser
servlet-uri=com.alibaba.citrus.service.uribroker.impl.uri.GenericServletURIBrokerDefinitionParser
servlet-content-uri=com.alibaba.citrus.service.uribroker.impl.uri.ServletContentURIBrokerDefinitionParser
turbine-classic-uri=com.alibaba.citrus.service.uribroker.impl.uri.TurbineClassicURIBrokerDefinitionParser

uri-bean=com.alibaba.citrus.springext.support.parser.DefaultElementDefinitionParser

turbine-uri=com.alibaba.citrus.turbine.uribroker.uri.impl.TurbineURIBrokerDefinitionParser
turbine-content-uri=com.alibaba.citrus.turbine.uribroker.uri.impl.TurbineContentURIBrokerDefinitionParser
2012-06-21, 16:11 UTC,
RE: webx工程tomcat启动报错
这个问题我现在想不出原因,能否把你的war包精减一下发给我试试?
2012-06-28, 13:26 UTC,
RE: webx工程tomcat启动报错
源码已经发送了,不知是否已收到?
 
2012-06-28, 18:17 UTC,
RE: webx工程tomcat启动报错
已经找到原因了,jar包冲突
2012-06-28, 22:43 UTC,
RE: webx工程tomcat启动报错
(2012-06-28, 18:17 UTC)jql294671405 提到: 已经找到原因了,jar包冲突

能告诉我哪两个jar包冲突吗?
2012-06-29, 09:11 UTC,
RE: webx工程tomcat启动报错
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>2.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
2012-06-29, 15:49 UTC,
RE: webx工程tomcat启动报错
这有什么冲突?
2013-07-05, 14:53 UTC,
RE: webx工程tomcat启动报错
神奇的冲突,今天遇到了。
不小心从1.4升级到2.0,直接崩溃了。
2013-12-24, 15:58 UTC, (这个帖子最后修改于: 2013-12-24, 15:59 UTC {2} by baobao.)
RE: webx工程tomcat启动报错
Webx和velocity-tools无怨无仇,两者完全没有交集,怎么可能因为有了velocity-tools而导致webx出错?

我把你们的项目跟踪了一下,终于找到了原因!这个原因是我也没有想到的:

你在项目下用mvn dependency:tree查看依赖关系,看看velocity-tools带来了什么?

代码:
[INFO] +- org.apache.velocity:velocity-tools:jar:2.0:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] |  +- commons-digester:commons-digester:jar:1.8:compile
[INFO] |  +- commons-chain:commons-chain:jar:1.1:compile
[INFO] |  +- commons-collections:commons-collections:jar:3.2:compile
[INFO] |  +- commons-logging:commons-logging:jar:99.0-does-not-exist:compile
[INFO] |  +- commons-validator:commons-validator:jar:1.3.1:compile
[INFO] |  +- dom4j:dom4j:jar:1.1:compile
[INFO] |  +- oro:oro:jar:2.0.8:compile
[INFO] |  +- sslext:sslext:jar:1.2-0:compile
[INFO] |  +- org.apache.struts:struts-core:jar:1.3.8:compile
[INFO] |  |  \- antlr:antlr:jar:2.7.2:compile
[INFO] |  +- org.apache.struts:struts-taglib:jar:1.3.8:compile
[INFO] |  +- org.apache.struts:struts-tiles:jar:1.3.8:compile

原来velocity-tools依赖了dom4j:1.1,而webx则依赖dom4j较高的版本。
由于你的项目中没有对dom4j定义dependencyManagement,所以dom4j因为引入velocity-tools而被降级为1.1版。

Dom4j 1.1缺少一个webx所需要的特性:webx需要对dom4j document中的elements用iterator遍历并修改,但dom4j:1.1不支持它。这样就间接导致了webx生成了一些错误的schema,表现为重复include同一个文件。

所以这个错误并不“神奇”,也不是什么冲突。只是因为你的pom写得不够完全而已。加上以下内容,一切恢复正常:

代码:
<dependencyManagement>
    <dependencies>
...
            <dependency>
                <groupId>dom4j</groupId>
                <artifactId>dom4j</artifactId>
                <version>1.6.1</version>
            </dependency>
    </dependencies>
</dependencyManagement>
2013-12-24, 19:29 UTC,
RE: webx工程tomcat启动报错
楼主的专注精神令人敬佩。
2013-12-25, 22:52 UTC,
RE: webx工程tomcat启动报错
2012的一个问题,2013再来研究,太厉害了
2013-12-27, 11:27 UTC,
RE: webx工程tomcat启动报错
(2013-12-25, 22:52 UTC)tianba 提到: 2012的一个问题,2013再来研究,太厉害了

以前我不以为意,最近有人提同样的问题,所以就旧事重提了。
2014-02-01, 13:13 UTC,
RE: webx工程tomcat启动报错
<br>People go in one by one or in pairs to dance.Punta music for wakes is played with traditional instruments. These include first and second drums, maracas, a conch shell and sometimes claves two hardwood sticks that are beat together.The miserable have more fury and greater resolution. Now even the gods are beginning to pity us, http://www.go-sales.net/ for they are keeping away the Roman general, and detaining his army far from us in another island. We have already taken the hardest step; we are deliberating.It felt astonishing, superdry tracksuits women didnt it Being aware that your ex boyfriend loved you so intensely. When the relationship initially started you not at all would have expected that both of you would ever break up. The relationship coming to an end was shocking and ever since then you have been finding it difficult to progress with your life.<br><br>Accept the fact that hes decided not to leave her. Tell him that youre not his best friend and to leave you alone. Then go enjoy your promotion.Good job, green superdry jacket Zack. Congratulations! said one girl.A new window will appear, superdry sale allowing you to create your new widget.12 Type a title for your widget in the title text box. This can be something such as Follow Me on Facebook.The moment affected me, too. When I emerged from that shower, superdry sales I realized that things were pretty damn good the way they were. I was with a good guy; I had a good job and a good apartment.edit TwentyThree September Park , Across from Ben Thanh Market and rnning the length of Phan Ngu Lao Street . Running along Phan Ngu Lao Street are a number of parks which fill up with locals before sunset, superdry student discount after work. They play a variety of games which you can participate in: badminton, kicking a shuttlecock and womens group aerobics to music are all very popular and great to watch.<br><br>It consists of uncooked rolled oats, wheat nuggets, bran threads, wheat germ and fruits and nuts. It can actually be made at home.Somewhere in the literature on the history of granola the Soxex Company seems to have played a role as well.A month after he and Goodrem split, he met Irish model and DJ Vogue Williams, 26. They married in Florence last September.‘WhenYou can go trekking together or travelling to a famous sightseeing spot. Most women lie zoo and amusement park so you can try them too. Seventh , show her that you are serious.Although marcel irons take some getting used toand coordination, professional stylists are able to use marcel irons toeffortlessly smooth, bend, c, and flip the hair to perfection.<br> rrrrrr



0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:17699次
    • 积分:209
    • 等级:
    • 排名:千里之外
    • 原创:1篇
    • 转载:18篇
    • 译文:0篇
    • 评论:2条
    文章分类
    文章存档
    最新评论