Problem: I run mvn install
on my GWT 2.5.0 project that I built with the gwt-maven-plugin and get the error Rebind result 'c3gw.fwk.gui.client.ClientFactory' must be a class
.
This is a snippet of my pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
<goal>i18n</goal>
<goal>resources</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>C3gwGui.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>c3gw.fwk.gui.client.Messages</i18nMessagesBundle>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
This is a snippet of my C3gwGui.gwt.xml:
<replace-with class="c3gw.fwk.gui.client.ClientFactoryImpl">
<when-type-is class="c3gw.fwk.gui.client.ClientFactory" />
</replace-with>
This is a snippet of the line where the error is thrown:
public void onModuleLoad() {
ClientFactory clientFactory = GWT.create(ClientFactory.class);
...
}
ClientFactory is an interface and ClientFactoryImpl implements the interface.
What I've figured out so far: The code works perfectly fine in Eclipse when I run debug, it just doesn't work when I do mvn install. I've run all the goals available for gwt-maven-plugin (clean, compile, sources, etc...) and they all work so the only conclusion I can have at this point is that something is happening during the maven-war-plugin phase or much later.
I also took the basics of this code from the following google tutorial and they use an interface so it should work, assuming that the example project also works that is.
Removing war:exploded, as Thomas indicated, solved the issue.