Showing posts with label gwt problem Maven pom.xml IncompatibleClassChangeError. Show all posts
Showing posts with label gwt problem Maven pom.xml IncompatibleClassChangeError. Show all posts

Thursday, June 18, 2009

Integration Problem between Selenium-Maven_Plugin and GWT

Problem

When trying to run gwt in hosted mode, showed the following error message:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Class org.mortbay.jetty.servlet.HashSessionManager does not implement the requested interface org.mortbay.jetty.SessionManager
at org.mortbay.jetty.servlet.SessionHandler.setSessionManager(SessionHandler.java:88) at org.mortbay.jetty.servlet.SessionHandler.(SessionHandler.java:62) at org.mortbay.jetty.servlet.SessionHandler.(SessionHandler.java:53) at org.mortbay.jetty.webapp.WebAppContext.(WebAppContext.java:297) at com.google.gwt.dev.ServletValidator.create(ServletValidator.java:67) at com.google.gwt.dev.ServletValidator.create(ServletValidator.java:51) at com.google.gwt.dev.HostedMode.doStartup(HostedMode.java:344) at com.google.gwt.dev.HostedModeBase.startUp(HostedModeBase.java:585) at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:397) at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)

Reason

The following excerpt from pom.xml:
...
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<scope>test</scope>
</dependency>
...
The above depency is causing problems to execution of hosted mode. One solution proposed by someone here to exclude the jetty does not work.

Solution

As I was just wanting the libraries of selenium to run the tests, I used the dependence of Testng as below:
...

<dependency>
<groupId>org.apache.geronimo.testsupport</groupId>
<artifactId>testsupport-selenium</artifactId>
<version>2.1.3</version>
</dependency>
...

In this solution it also brings testng.jar. I will verify latter how to exclude it.