Dispatch Error when deployed to AppEngine

37 views
Skip to the first unread message

DVallejo

unread,
15 Nov 2016, 16:19:1015/11/2016
to GWTP
Dear all, I have an error when I call dispatch RPC in AppEngine Deployment, I will appreciate any advice or comment, it will be very valuable.

The  scenario is: I´m calling a simple Action/Result/ActionHandler,  in Development Server, it works perfectly, 
however, when I deploy it and run it in GAE, it generates the following exception.

THIS IS THE ERROR

ERROR java.lang.NoClassDefFoundError: com/google/gwt/user/client/rpc/IsSerializable
at com
.google.appengine.runtime.Request.process-a4e2438e19b364b3 (Request.java)
at java
.lang.ClassLoader.defineClass1 (Native Method)
at java
.lang.ClassLoader.defineClass (ClassLoader.java:820)
at java
.security.SecureClassLoader.defineClass (SecureClassLoader.java:142)
at java
.net.URLClassLoader.defineClass (URLClassLoader.java:449)
at sun
.reflect.GeneratedMethodAccessor5.invoke (Unknown Source)
at sun
.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java
.lang.reflect.Method.invoke (Method.java:606)
at java
.lang.ClassLoader.loadClass (ClassLoader.java:375)
at mx
.mobileobjects.dev.server.guice.ServerModule.configureHandlers (ServerModule.java:13)
at com
.gwtplatform.dispatch.rpc.server.guice.HandlerModule.configure (HandlerModule.java:90)
at com
.google.inject.AbstractModule.configure (AbstractModule.java:59)
at com
.google.inject.spi.Elements$RecordingBinder.install (Elements.java:223)
at com
.google.inject.spi.Elements.getElements (Elements.java:101)
at com
.google.inject.internal.InjectorShell$Builder.build (InjectorShell.java:133)
at com
.google.inject.internal.InternalInjectorCreator.build (InternalInjectorCreator.java:103)
at com
.google.inject.Guice.createInjector (Guice.java:95)
at com
.google.inject.Guice.createInjector (Guice.java:72)
at com
.google.inject.Guice.createInjector (Guice.java:62)
at mx
.mobileobjects.dev.server.guice.GuiceServletConfig.getInjector (GuiceServletConfig.java:10)
at com
.google.inject.servlet.GuiceServletContextListener.contextInitialized (GuiceServletContextListener.java:45)
at org
.mortbay.jetty.handler.ContextHandler.startContext (ContextHandler.java:548)
at org
.mortbay.jetty.servlet.Context.startContext (Context.java:136)
at org
.mortbay.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1250)
at org
.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:517)
at org
.mortbay.jetty.webapp.WebAppContext.doStart (WebAppContext.java:467)
at org
.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50)
at com
.google.tracing.TraceContext$TraceContextRunnable.runInContext (TraceContext.java:446)
at com
.google.tracing.TraceContext$TraceContextRunnable$1.run (TraceContext.java:453)
at com
.google.tracing.CurrentContext.runInContext (CurrentContext.java:276)
at com
.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref (TraceContext.java:312)
at com
.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext (TraceContext.java:304)
at com
.google.tracing.TraceContext$TraceContextRunnable.run (TraceContext.java:450)
at java
.lang.Thread.run (Thread.java:745)


FOR DEPLOY I´M USSING 

mvn appengine:update


THIS IS MY POM

<?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">
   
<modelVersion>4.0.0</modelVersion>


   
<groupId>com.arcbees.archetypes</groupId>
   
<artifactId>gwtp-appengine-guice-archetype</artifactId>
   
<version>1.5.3</version>
   
<packaging>war</packaging>


   
<name>GWTP AppEngine Guice</name>


   
<properties>
       
<!-- client -->
       
<gwt.version>2.7.0</gwt.version>
       
<gwtp.version>1.5.3</gwtp.version>
       
<gin.version>2.1.2</gin.version>
       
<gwt.style>OBF</gwt.style>


       
<!-- server -->
       
<gae.version>1.9.20</gae.version>
       
<guice.version>3.0</guice.version>
       
<servlet-api.version>2.5</servlet-api.version>
       
<javax.validation.version>1.0.0.GA</javax.validation.version>


       
<!-- testing -->
       
<junit.version>4.12</junit.version>
       
<jukito.version>1.4.1</jukito.version>


       
<!-- maven -->
       
<maven-war-plugin.version>2.6</maven-war-plugin.version>
       
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>


       
<target.jdk>1.7</target.jdk>
       
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>


       
<webappDirectory>C:\\coding\\projects\\arcbees\\archetypes\\target\\checkout\\gwtp-appengine-guice\\target/gwtp-appengine-guice-archetype-1.5.3</webappDirectory>
       
<gae.home>
            C:\\Users\\Christopher\\.m2\\repository/com/google/appengine/appengine-java-sdk/${gae.version}/appengine-java-sdk-${gae.version}/appengine-java-sdk-${gae.version}
       
</gae.home>
   
</properties>


   
<build>
       
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>


       
<resources>
           
<resource>
               
<directory>src/main/resources</directory>
           
</resource>
       
</resources>


       
<plugins>
           
<plugin>
               
<groupId>com.google.appengine</groupId>
               
<artifactId>appengine-maven-plugin</artifactId>
               
<version>${gae.version}</version>
               
<configuration>
                   
<enableJarSplitting>true</enableJarSplitting>
                   
<port>8888</port>
               
</configuration>
           
</plugin>


           
<plugin>
               
<groupId>org.apache.maven.plugins</groupId>
               
<artifactId>maven-compiler-plugin</artifactId>
               
<version>${maven-compiler-plugin.version}</version>
               
<configuration>
                   
<source>${target.jdk}</source>
                   
<target>${target.jdk}</target>
                   
<encoding>UTF-8</encoding>
                   
<proc>none</proc>
               
</configuration>
           
</plugin>


           
<!-- GWT -->
           
<plugin>
               
<groupId>org.codehaus.mojo</groupId>
               
<artifactId>gwt-maven-plugin</artifactId>
               
<version>${gwt.version}</version>
               
<configuration>
                   
<strict>true</strict>


                   
<testTimeOut>180</testTimeOut>
                   
<mode>htmlunit</mode>
                   
<includes>**/*GwtTest.java</includes>


                   
<logLevel>INFO</logLevel>


                   
<runTarget>index.html</runTarget>
                   
<module>mx.mobileobjects.dev.Test10</module>


                   
<server>com.google.appengine.tools.development.gwt.AppEngineLauncher</server>
                   
<appEngineVersion>${gae.version}</appEngineVersion>
                   
<appEngineHome>${gae.home}</appEngineHome>
               
</configuration>
               
<executions>
                   
<execution>
                       
<goals>
                           
<goal>compile</goal>
                           
<goal>test</goal>
                       
</goals>
                   
</execution>
               
</executions>
           
</plugin>
       
</plugins>
   
</build>


   
<dependencies>
       
<!-- GWT -->
       
<dependency>
           
<groupId>com.google.gwt</groupId>
           
<artifactId>gwt-user</artifactId>
           
<version>${gwt.version}</version>
           
<scope>provided</scope>
       
</dependency>


       
<!-- GWTP -->
       
<dependency>
           
<groupId>com.gwtplatform</groupId>
           
<artifactId>gwtp-mvp-client</artifactId>
           
<version>${gwtp.version}</version>


       
</dependency>


       
<!-- Google App Engine API -->
       
<dependency>
           
<groupId>com.google.appengine</groupId>
           
<artifactId>appengine-api-1.0-sdk</artifactId>
           
<version>${gae.version}</version>
       
</dependency>


       
<!-- DI -->
       
<dependency>
           
<groupId>com.google.inject</groupId>
           
<artifactId>guice</artifactId>
           
<version>${guice.version}</version>
       
</dependency>
       
<dependency>
           
<groupId>com.google.inject.extensions</groupId>
           
<artifactId>guice-servlet</artifactId>
           
<version>${guice.version}</version>
       
</dependency>
       
<dependency>
           
<groupId>com.google.gwt.inject</groupId>
           
<artifactId>gin</artifactId>
           
<version>${gin.version}</version>


       
</dependency>


       
<!-- Other -->
       
<dependency>
           
<groupId>javax.servlet</groupId>
           
<artifactId>servlet-api</artifactId>
           
<version>${servlet-api.version}</version>
           
<scope>runtime</scope>
       
</dependency>


       
<!-- Test -->
       
<dependency>
           
<groupId>junit</groupId>
           
<artifactId>junit</artifactId>
           
<version>${junit.version}</version>
           
<scope>test</scope>
       
</dependency>
       
<dependency>
           
<groupId>org.jukito</groupId>
           
<artifactId>jukito</artifactId>
           
<version>${jukito.version}</version>
           
<scope>test</scope>
       
</dependency>
       
<dependency>
           
<groupId>com.google.appengine</groupId>
           
<artifactId>appengine-api-labs</artifactId>
           
<version>${gae.version}</version>
           
<scope>test</scope>
       
</dependency>
       
<dependency>
           
<groupId>com.google.appengine</groupId>
           
<artifactId>appengine-api-stubs</artifactId>
           
<version>${gae.version}</version>
           
<scope>test</scope>
       
</dependency>
       
<dependency>
           
<groupId>com.google.appengine</groupId>
           
<artifactId>appengine-testing</artifactId>
           
<version>${gae.version}</version>
           
<scope>test</scope>
       
</dependency>
       
<dependency>
           
<groupId>com.gwtplatform</groupId>
           
<artifactId>gwtp-dispatch-rpc-shared</artifactId>
           
<version>1.4</version>
       
</dependency>
       
<dependency>
           
<groupId>com.gwtplatform</groupId>
           
<artifactId>gwtp-dispatch-rpc-server-guice</artifactId>
           
<version>1.4</version>
       
</dependency>
       
<dependency>
           
<groupId>com.gwtplatform</groupId>
           
<artifactId>gwtp-dispatch-rpc-client</artifactId>
           
<version>1.4</version>
       
</dependency>
   
</dependencies>
</project>



GUICE CONFIGURATION 

public class DispatchServletModule extends ServletModule {
   
@Override
   
protected void configureServlets() {
       serve
("/"+ ActionImpl.DEFAULT_SERVICE_NAME+"*").with(DispatchServiceImpl.class);
   
}
}


public class GuiceServletConfig extends GuiceServletContextListener {
   
@Override
   
protected Injector getInjector() {
       
return Guice.createInjector(new ServerModule(), new DispatchServletModule());
   
}
}


public class ServerModule extends HandlerModule {


   
@Override
   
protected void configureHandlers() {


        bindHandler
(PruebaAction.class, PruebaActionHandler.class);


   
}
}

THE GWT.XML 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN"
        "http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">

<module rename-to='Test10'>
<inherits name='com.google.gwt.user.User'/>
<inherits name="com.gwtplatform.mvp.MvpWithEntryPoint"/>
<inherits name="com.gwtplatform.dispatch.rpc.DispatchRpcShared"/>
<inherits name="com.gwtplatform.dispatch.rpc.DispatchRpc"/>




<extend-configuration-property name="gin.ginjector.modules"
                               
value="mx.mobileobjects.dev.client.gin.ClientModule"/>


<!-- Specify the paths for translatable code                    -->
<source path='client'/>
<source path='shared'/>


<set-configuration-property name="CssResource.enableGss" value="true"/>
</module>


Thanks in advance !!! 

DVallejo

unread,
23 Nov 2016, 09:40:5523/11/2016
to GWTP
I have solved the problem

The gwt-servlet dependency was missing in the POM 

<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
</dependency>
Reply all
Reply to author
Forward
0 new messages