Accessing GWT app deployed on Jetty fails

1,518 views
Skip to first unread message

Musicman75

unread,
Nov 8, 2010, 8:59:19 AM11/8/10
to Google Web Toolkit
Hello,

I've created a GWT war project with two subprojects.
When starting the server (Jetty standalone), the war is loaded:

2010-11-08 14:50:51.648:INFO::Deployable added: C:\Users\beutelsn
\DevTools\jetty-hightide-7.1.6.v20100715\webapps\dashboardClient-0.0.1-
SNAPSHOT.war
2010-11-08 14:50:51.727:INFO::Copying WEB-INF/lib jar:file:/C:/Users/
beutelsn/DevTools/jetty-hightide-7.1.6.v20100715/webapps/
dashboardClient-0.0.1-S
APSHOT.war!/WEB-INF/lib/ to C:\Users\beutelsn\AppData\Local\Temp
\6\Jetty_0_0_0_0_9090_dashboardClient.
0.0.1.SNAPSHOT.war__dashboardClient.0.0.1.SNAPS
OT__.hbn96r\webinf\WEB-INF\lib
2010-11-08 14:50:52.380:INFO::Copying WEB-INF/classes from jar:file:/
C:/Users/beutelsn/DevTools/jetty-hightide-7.1.6.v20100715/webapps/
dashboardClien
-0.0.1-SNAPSHOT.war!/WEB-INF/classes/ to C:\Users\beutelsn\AppData
\Local\Temp\6\Jetty_0_0_0_0_9090_dashboardClient.
0.0.1.SNAPSHOT.war__dashboardClien
.0.0.1.SNAPSHOT__.hbn96r\webinf\WEB-INF\classes
2010-11-08 14:50:54.101:INFO:/dashboardClient-0.0.1-
SNAPSHOT:Initializing Spring root WebApplicationContext null null
2010-11-08 14:50:56.545:INFO:/dashboardClient-0.0.1-
SNAPSHOT:Initializing Spring FrameworkServlet 'dispatcher' null null
2010-11-08 14:50:56.707:INFO::Deployable added: C:\Users\beutelsn
\DevTools\jetty-hightide-7.1.6.v20100715\webapps\async-rest
2010-11-08 14:50:56.762:INFO::Started
SelectChann...@0.0.0.0:9090

When accessing the war with the browser, I only get a popup with this
message:
---------------
GWT module 'com.XXX.Application' may need to be (re)compiled
--------------

In hosted mode everything works fine.

The war is created by maven. Here's my pom.xml:


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://
maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- POM generated by gwt-maven-plugin archetype -->
<parent>
<artifactId>dashboard2</artifactId>
<groupId>com.XXX</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.XXX</groupId>
<artifactId>dashboardClient</artifactId>
<name>Axivion Bauhaus Dashboard Client</name>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>

<properties>

<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>

</properties>

<dependencies>

<!-- project dependencies -->
<dependency>
<groupId>com.XXX</groupId>
<artifactId>dashboardServer</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>

<!-- GWT dependencies (from central repo) -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.octo.gwt.test</groupId>
<artifactId>gwt-test-utils</artifactId>
<scope>test</scope>
</dependency>

<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<outputDirectory>war/WEB-INF/classes</outputDirectory>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<webappDirectory>war</webappDirectory>
<webXml>war/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<excludes>
<exclude>**/*_Roo_*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.1.2.v20100523</version>
<configuration>
<webAppConfig>
<contextPath>/${project.name}</contextPath>
</webAppConfig>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<logLevel>INFO</logLevel>
<style>PRETTY</style>
<gwtVersion>2.1.0</gwtVersion>
<runTarget>com.XXX.dashboard.Application/Application.html</
runTarget>
<modules>
<module>com.XXX.dashboard.Application</module>
</modules>
<copyWebapp>true</copyWebapp>
</configuration>
<executions>
<execution>
<id>gwtcompile</id>
<phase>prepare-package</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- manage dependencies -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<configuration>
<includeTypes>jar</includeTypes>
<stripVersion>true</stripVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>copy-deps</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<projectsDirectory>.</projectsDirectory>
<pomIncludes>
<pomInclude>pom.xml</pomInclude>
</pomIncludes>
<streamLogs>true</streamLogs>
<goals>
<goal>dependency:copy-dependencies</goal>
</goals>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>


Any ideas how I can solve my problem?

Thanks a lot for any hints.

Y2i

unread,
Nov 8, 2010, 1:33:44 PM11/8/10
to Google Web Toolkit
I use Eclipse projects instead of maven, but I do see similar errors
when I create and deploy a war file without doing GWT compilation
first. After GWT re-compilation and re-deploying the war file the
errors disappear.

> SelectChannelConnec...@0.0.0.0:9090


>
> When accessing the war with the browser, I only get a popup with this
> message:
> ---------------
> GWT module 'com.XXX.Application' may need to be (re)compiled
> --------------
>
> In hosted mode everything works fine.
>
> The war is created by maven. Here's my pom.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://

> maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">

Musicman75

unread,
Nov 8, 2010, 5:28:53 PM11/8/10
to Google Web Toolkit
That's Why i posted my pom file. I think the maven execution is done
in the wrong order.

Could anyone please post a pom file to create a war and compile the
GWT app before?
> ...
>
> Erfahren Sie mehr »

David Chandler

unread,
Nov 8, 2010, 7:25:11 PM11/8/10
to google-we...@googlegroups.com
What mvn command are you using? In this POM, gwt-maven-plugin is
executing gwt:compile during the prepare-package phase, so you should
run "mvn package" to trigger it.

HTH,
/dmc

> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

--
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/

Musicman75

unread,
Nov 9, 2010, 2:27:35 AM11/9/10
to Google Web Toolkit
I executed mvn clean install, mvn clean package with and without
executing mvn gwt:compile before.
Same problem with all generated war files.
> ...
>
> Erfahren Sie mehr »
Message has been deleted

Musicman75

unread,
Nov 9, 2010, 4:26:41 AM11/9/10
to Google Web Toolkit
I solved the issue.

I've to add webAppDirectory to the GWT maven plugin.
The generated files were not placed in my webapp directory. They were
created in the target directory.
The webapp only contains a few files, but not all of them.

Here's my actual working pom file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://
maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- POM generated by gwt-maven-plugin archetype -->
<parent>
<artifactId>dashboard2</artifactId>
<groupId>com.dev</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.dev</groupId>
<artifactId>dashboardClient</artifactId>
<name>Dev Bauhaus Dashboard Client</name>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>

<properties>

<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>

</properties>

<dependencies>

<!-- project dependencies -->
<dependency>
<groupId>com.dev</groupId>
<outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webappDirectory>src/main/webapp</webappDirectory>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<webAppConfig>
<contextPath>/${project.name}</contextPath>
</webAppConfig>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<logLevel>INFO</logLevel>
<style>PRETTY</style>
<gwtVersion>2.1.0</gwtVersion>
<runTarget>com.axivion.dashboard.Application/Application.html</
runTarget>
<modules>
<module>com.axivion.dashboard.Application</module>
</modules>
<copyWebapp>true</copyWebapp>
<webappDirectory>src/main/webapp</webappDirectory>
</configuration>
<executions>
<execution>
<id>gwtcompile</id>
<phase>prepare-package</phase>
<goals>
<goal>compile</goal>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- manage dependencies -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<includeTypes>jar</includeTypes>
<stripVersion>true</stripVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<executions>
<execution>
<id>copy-deps</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<projectsDirectory>.</projectsDirectory>
<pomIncludes>
<pomInclude>pom.xml</pomInclude>
</pomIncludes>
<streamLogs>true</streamLogs>
<goals>
<goal>dependency:copy-dependencies</goal>
</goals>
<encoding>UTF-8</encoding>
Reply all
Reply to author
Forward
0 new messages