Compile Error - RequestFactory not found in project sources or resources

1,065 views
Skip to first unread message

otth2oskier

unread,
Apr 4, 2012, 11:49:40 AM4/4/12
to Google Web Toolkit
I get the following message when I do a Maven compile of my project. I
suspect it is looking for a gwt.xml file for RequestFactory somewhere
but i snot finding it. I am not sure what dependencies I am missing.

Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:
2.4.0:compile (default) on project GWTPrototype: GWT Module
com.google.web.bindery.requestfactory.RequestFactory not found in
project sources or resources.

my Project gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//
EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-
source/core/src/gwt-module.dtd">
<module>
<inherits name="com.google.gwt.user.User" />
<inherits
name='com.google.web.bindery.requestfactory.RequestFactory' />
<source path="client" />
<source path="shared" />

<set-property name="user.agent" value="safari" />
<entry-point class='com.avaya.gwtproto.client.GWTPrototype' />
</module>

Here are my maven dependencies:

<dependencies>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.0.Alpha1</version>
</dependency>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-server</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-server</artifactId>
<version>2.4.0</version>
<classifier>sources</classifier>
</dependency>
</dependencies>

Maven plugin configuration:


<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>index.html</runTarget>
<module>com.avaya.gwtproto.GWTPrototype</module>
<compileSourcesArtifacts>
<compileSourcesArtifact>com.google.web.bindery.requestfactory</
compileSourcesArtifact>
</compileSourcesArtifacts>
</configuration>
</plugin>

Thomas Broyer

unread,
Apr 4, 2012, 12:29:01 PM4/4/12
to google-we...@googlegroups.com
gwt-servlet contains the classes from requestfactory-server, so you don't need that one (or gwt-servlet, depends if you use something else than RequestFactory on the server-side or not).
 
                <dependency>
                        <groupId>com.google.web.bindery</groupId>
                        <artifactId>requestfactory-server</artifactId>
                        <version>2.4.0</version>
                        <classifier>sources</classifier>
                </dependency>

You don't need it (particularly if you keep the default <scope>!)
 
        </dependencies>

Where's gwt-user?
Add it with <scope>provided</scope> so as to not deploy it into your WAR.


Maven plugin configuration:


                        <plugin>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>gwt-maven-plugin</artifactId>
                                <version>2.4.0</version>

Latest version is 2.4.0-1.
 
                                <executions>
                                        <execution>
                                                <goals>
                                                        <goal>compile</goal>
                                                        <goal>test</goal>
                                                </goals>
                                        </execution>
                                </executions>
                                <configuration>
                                        <runTarget>index.html</runTarget>
                                        <module>com.avaya.gwtproto.GWTPrototype</module>
                                        <compileSourcesArtifacts>
                                                <compileSourcesArtifact>com.google.web.bindery.requestfactory</
compileSourcesArtifact>
                                        </compileSourcesArtifacts>

Remove the compileSourcesArtifacts (plus: the value you give here is not an artifact's identifier; see the very end of http://mojo.codehaus.org/gwt-maven-plugin/user-guide/project.html)

otth2oskier

unread,
Apr 4, 2012, 5:34:30 PM4/4/12
to Google Web Toolkit
Thanks. That did the trick.

On Apr 4, 12:29 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
> On Wednesday, April 4, 2012 5:49:40 PM UTC+2, otth2oskier wrote:
>
> > I get the following message when I do a Maven compile of my project. I
> > suspect it is looking for a gwt.xml file for RequestFactory somewhere
> > but i snot finding it. I am not sure what dependencies I am missing.
>
> > Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:
> > 2.4.0:compile (default) on project GWTPrototype: GWT Module
> > com.google.web.bindery.requestfactory.RequestFactory not found in
> > project sources or resources.
>
> > my Project gwt.xml
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//
> > EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-
> > source/core/src/gwt-module.dtd<http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source...>">
Reply all
Reply to author
Forward
0 new messages