SerializationPolicy problems with a gwt-maven:compile, no issues with Intellij build

33 views
Skip to first unread message

krao

unread,
Aug 17, 2009, 5:16:54 AM8/17/09
to gwt-maven
I've been having problems trying to get Maven to create a war for my
project using the IntelliJ Maven plugin. I keep getting a 'SEVERE:
springDispatcher: WARNING: Failed to get the SerializationPolicy'
warning whenever I deploy a war that Maven creates. However, building
a war through IntelliJ (with the same code) creates a fully
functioning war. To create a war via Maven, I use the pom.xml shown
below, run Lifecycle:clean, then gwt-maven:compile, then war:war.

What am I missing?

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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.cggh.wwarn</groupId>
<artifactId>wwarn_register_test</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<inceptionYear>2009</inceptionYear>
<pluginRepositories>
<pluginRepository>
<id>gwt-maven</id>
<url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</
url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>gwt-maven</id>
<url>
http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/
</url>
</repository>
<repository>
<id>gilead</id>
<url>
https://gilead.svn.sourceforge.net/svnroot/gilead/gilead/maven-repo/
</url>
</repository>
<repository>
<id>MVNRepository</id>
<name>MVNRepository</name>
<layout>default</layout>
<url>http://repository.jboss.com/maven2/</url>
</repository>
</repositories>
<properties>
<gwtVersion>1.7.0</gwtVersion>
<war.classes.includes>true</war.classes.includes>
</properties>
<build>
<resources>
<resource>
<directory>src</directory>
<includes>
<include>**/client/**</include>
<include>**/public/**</include>
<include>**/*.gwt.xml</include>
<include>**/*.cfg.xml</include>
</includes>
</resource>
</resources>
<plugins>
<!--Required to allow annotations-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<!--To facilitate war compilation-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<webXml>web/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<!--Allow automatic GWT code compilation-->
<plugin>
<groupId>com.totsp.gwt</groupId>
<artifactId>maven-googlewebtoolkit2-plugin</artifactId>
<version>2.0-RC1</version>
<configuration>
<gwtHome>C:\gwt-windows-1.7.0</gwtHome>
<logLevel>INFO</logLevel>
<compileTargets>
<value>registration.registration</value>
</compileTargets>
<runTarget>registration.registration/registration.html</
runTarget>
<style>DETAILED</style>
<noServer>false</noServer>
<extraJvmArgs>-Xmx512m</extraJvmArgs>
<gwtVersion>${gwtVersion}</gwtVersion>
</configuration>
</plugin>
</plugins>
<!--Include source-->
<sourceDirectory>src</sourceDirectory>
</build>
<dependencies>
<dependency>
<groupId>org.cggh.wwarn</groupId>
<artifactId>register-interest-rpc-interface</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>system</scope>
<systemPath>C:\gwt-windows-1.7.0\gwt-user.jar</systemPath>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwtVersion}</version>
<scope>system</scope>
<systemPath>C:\gwt-windows-1.7.0\gwt-dev-windows.jar</
systemPath>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>net.sf.gwt-widget</groupId>
<artifactId>gwt-sl</artifactId>
<version>0.1.5</version>
</dependency>
<dependency>
<groupId>net.sf.gilead</groupId>
<artifactId>adapter-core</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>net.sf.gilead</groupId>
<artifactId>adapter4gwt</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>net.sf.gilead</groupId>
<artifactId>adapter-actionscript</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>net.sf.gilead</groupId>
<artifactId>hibernate-util</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>20040616</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-cglib-repack</artifactId>
<version>2.1_3</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.4.0.GA</version>
</dependency>
</dependencies>
</project>

Robert "kebernet" Cooper

unread,
Aug 17, 2009, 7:34:00 AM8/17/09
to gwt-...@googlegroups.com
Not really sure.

Are you getting the registration.registration/[hash].gwt.rpc files in the final war?

Also, what is the meaning of war.classes.includes = true? Isn't war.classes.includes a pattern match?
--
:Robert "kebernet" Cooper
::kebe...@gmail.com
Alice's cleartext
Charlie is the attacker
Bob signs and encrypts
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x9E8759F8

krao

unread,
Aug 17, 2009, 9:27:45 AM8/17/09
to gwt-maven
> Are you getting the registration.registration/[hash].gwt.rpc files in the
> final war?
Yeh the corresponding gwt.rpc file is included. Infact the IntelliJ
build war and the Maven war are identical apart from what's in the
base registration.registration folder in the war. One difference is
that the Maven war has one less *.cache.html file (6 vs 5) and the gwt
javascript are different because of this. However, I've no idea what
determines how many of these html files are created, or if it means
anything!

> Also, what is the meaning of war.classes.includes = true? Isn't
> war.classes.includes
> a pattern match?
I need this so that the classes are included in the WEB-INF folder of
the war. Not sure if that folder is needed, but I noticed that it
exists in the working war created by IntelliJ, and so put it in
(unfortunately, taking it out doesn't fix it!).

On Aug 17, 12:34 pm, "Robert \"kebernet\" Cooper" <keber...@gmail.com>
wrote:
> ::keber...@gmail.com

Robert "kebernet" Cooper

unread,
Aug 17, 2009, 9:35:01 AM8/17/09
to gwt-...@googlegroups.com
Ah HA! I think I may know.

Check your web.xml file when you build with maven vs intellij.

Make sure your RPC servlets (or whatever is setting in front of them if you are using Spring/Guice) are getting a map to [context]/registration.registration.

If you are using the Tomcat hosted mode, the Tomcat responder will answer requests on [context]/servlet AND [context]/module/servlet.  If you are using the Jetty hosted mode, you are doing the web.xml yourself (possibly) and putting them in [context]/servlet. The thing is, the servlet when it starts is going to look for hte .gwt.rpc file on its own path info from the request, so if you are hitting /servlet and not /reg.reg/servlet it won't find the file. IDEA might be fixing this transparently somehow. GWT-Maven's merge web.xml (if you are defining <servlet> tags in the module) will do this properly. Otherwise you need to make sure the web.xml is correct.
--
:Robert "kebernet" Cooper
::kebe...@gmail.com

krao

unread,
Aug 17, 2009, 11:51:22 AM8/17/09
to gwt-maven
I wish it was that, but thanks for trying!
The web.xml's in both wars are empty. The problem is scoped to what's
in the registration.registration base folder (I can copy over the
folder in the IntelliJ war to the Maven war to create a working war).
My RPC servlets are defined in a separate war and I don't touch them
when deploying either the Maven or IntelliJ war. So there are no
servlet's to deal with, just something in the javascript, or these
cache.html files (I think...).

(btw, I did try gwt-maven:mergewebxml just for the hell of it between
compile and war:war, but no luck).

On Aug 17, 2:35 pm, "Robert \"kebernet\" Cooper" <keber...@gmail.com>
wrote:
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages