Seam Test 的解析器问题
我在 Eclipse 中有一个 Maven 项目,一个使用 Seam 的 Web 项目。现在我想使用Seam Test 进行单元测试。我没有使用 SeamGen 来创建项目。
我遵循了本指南,但是当我运行测试时出现此错误。我感觉使用了错误的 sax 解析器。有人认得吗?
[Parser] Running: :\Documents and Settings\PEJA715\Local Settings\Temp\testng-eclipse\testng-customsuite.xml FAILED CONFIGURATION: @BeforeSuite startSeam java.lang.RuntimeException: Unable to bootstrap: at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:147) at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183) at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195) at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11) at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024) at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915) at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100) at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:85) at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130) at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142) ... 21 more Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.(SaxJBossXBParser.java:97) at org.jboss.xb.binding.UnmarshallerImpl.(UnmarshallerImpl.java:55) at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96) ... 24 more Caused by: javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized. at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source) at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.(SaxJBossXBParser.java:92) ... 26 more ... Removed 15 stack frames SKIPPED CONFIGURATION: @BeforeClass setupClass SKIPPED CONFIGURATION: @BeforeMethod begin SKIPPED CONFIGURATION: @AfterMethod end SKIPPED CONFIGURATION: @AfterClass cleanupClass SKIPPED: testRegister =============================================== TestOfTest Tests run: 1, Failures: 0, Skips: 1 Configuration Failures: 1, Skips: 4 =============================================== =============================================== effsort-web Total tests run: 1, Failures: 0, Skips: 1 Configuration Failures: 1, Skips: 5 =============================================== [org.testng.internal.PoolService] Shutting down poolservice org.testng.internal.PoolService@1117a20 terminated:false
I have a maven project in Eclipse, a web-project using Seam. Now I wanted to use Seam Test for unit test. I dit not use SeamGen to create the project.
I followed this guide, but when I run my test I get this error. I get a feeling the wrong sax parser is being used. Does anyone recognize it?
[Parser] Running: :\Documents and Settings\PEJA715\Local Settings\Temp\testng-eclipse\testng-customsuite.xml FAILED CONFIGURATION: @BeforeSuite startSeam java.lang.RuntimeException: Unable to bootstrap: at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:147) at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183) at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195) at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11) at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024) at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915) at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100) at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:85) at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130) at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142) ... 21 more Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.(SaxJBossXBParser.java:97) at org.jboss.xb.binding.UnmarshallerImpl.(UnmarshallerImpl.java:55) at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96) ... 24 more Caused by: javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized. at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source) at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.(SaxJBossXBParser.java:92) ... 26 more ... Removed 15 stack frames SKIPPED CONFIGURATION: @BeforeClass setupClass SKIPPED CONFIGURATION: @BeforeMethod begin SKIPPED CONFIGURATION: @AfterMethod end SKIPPED CONFIGURATION: @AfterClass cleanupClass SKIPPED: testRegister =============================================== TestOfTest Tests run: 1, Failures: 0, Skips: 1 Configuration Failures: 1, Skips: 4 =============================================== =============================================== effsort-web Total tests run: 1, Failures: 0, Skips: 1 Configuration Failures: 1, Skips: 5 =============================================== [org.testng.internal.PoolService] Shutting down poolservice org.testng.internal.PoolService@1117a20 terminated:false
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很难从堆栈跟踪中看出(显示您的依赖项可能会有所帮助),但请仔细检查您是否使用 JBoss 5.0.1.GA 使用的 SAX 解析器(而不是您可能会通过传递获得的 xml-api)。
Hard to say from the stacktrace (showing your dependencies might help) but double check that you use the SAX parser used by JBoss 5.0.1.GA (and not xml-apis that you might get transitively).