在观看Roo Google IO之后,我决定使用this tutorial尝试一下,但在尝试创建Selenium测试时我遇到了困难。
~.web roo> selenium test --controller ~.web.PizzaOrderController
Created SRC_MAIN_WEBAPP/selenium
Created SRC_MAIN_WEBAPP/selenium/test-pizzaorder.xhtml
Created SRC_MAIN_WEBAPP/selenium/test-suite.xhtml
Undo create SRC_MAIN_WEBAPP/selenium/test-suite.xhtml
Undo create SRC_MAIN_WEBAPP/selenium/test-pizzaorder.xhtml
Undo create SRC_MAIN_WEBAPP/selenium
com.sun.org.apache.xerces.internal.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
this forum的人建议从类路径中删除Xerces,因为Java 6有自己的基于 Xerces 的XML解析器。但是,我没有找到一种明确的方法来删除类路径中的内容,只有setting it(我认为每次都会很乏味)。
有没有人知道从类路径中删除jar 的明确方法?有没有人遇到过这个Roo问题并以另一种方式解决了它?
根据要求,这是更详细的输出:
roo> development mode
Development mode set to true
roo> selenium test --controller ~.web.PizzaOrderController
Created SRC_MAIN_WEBAPP/selenium
Created SRC_MAIN_WEBAPP/selenium/test-pizzaorder.xhtml
Created SRC_MAIN_WEBAPP/selenium/test-suite.xhtml
Undo create SRC_MAIN_WEBAPP/selenium/test-suite.xhtml
Undo create SRC_MAIN_WEBAPP/selenium/test-pizzaorder.xhtml
Undo create SRC_MAIN_WEBAPP/selenium
com.sun.org.apache.xerces.internal.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
at org.springframework.roo.addon.web.menu.MenuOperationsImpl.addMenuItem(MenuOperationsImpl.java:88)
at org.springframework.roo.addon.web.selenium.SeleniumOperationsImpl.manageTestSuite(SeleniumOperationsImpl.java:185)
at org.springframework.roo.addon.web.selenium.SeleniumOperationsImpl.generateTest(SeleniumOperationsImpl.java:140)
at org.springframework.roo.addon.web.selenium.SeleniumCommands.generateTest(SeleniumCommands.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191)
at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:34)
at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:169)
at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:132)
at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:32)
at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:158)
at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:200)
at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:126)
at java.lang.Thread.run(Thread.java:619)
答案 0 :(得分:0)
是否可以输入“开发模式”,按回车键,然后重新运行Selenium命令并包含更详细的堆栈跟踪?