Announcement Announcement Module
Collapse
No announcement yet.
Unable to generate Selenium tests because of Xerces error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to generate Selenium tests because of Xerces error

    I am working on this tutorial, but getting stuck when trying to create Selenium tests.

    Code:
    ~.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
    A person at this forum suggested removing Xerces from the classpath because Java 6 has its own XML parser based on Xerces. However, I haven't come across a clear way to remove something from the classpath, only setting it (which I think would be tedious each time).

    UPDATE

    Here is the full trace with "development mode":

    Code:
    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)
    Does anyone know of a clear way to remove jars from the classpath? Has anyone encountered this problem before and solved it another way?

    This question is also posted at StackOverflow.
    Last edited by wraithmonster; May 25th, 2010, 10:37 PM. Reason: Requested by answerer

  • #2
    Can you try this with Java 6? Also could you try typing "development mode" then hitting enter before executing the command, so we can see the exception in more depth?

    Comment


    • #3
      Originally posted by Ben Alex View Post
      Can you try this with Java 6? Also could you try typing "development mode" then hitting enter before executing the command, so we can see the exception in more depth?
      Done - please see UPDATE above.

      Comment


      • #4
        It depends where it was loaded from. In your roo.bat or roo.sh in the launch: section add a -verbose flag to the java call, this should show information about where the classes are getting loaded from. Perhaps you've just got something in the endorsed directory or similar...

        Comment


        • #5
          Can you type 'backup' and attach the resulting ZIP file here so we can try it on one of our machines? Thanks. We need to verify the XPath expression at MenuOperationsImpl.java:88 is actually selecting the correct node.

          Comment

          Working...
          X