GWT RPC and SpringBoot

Viewed 995

I'm trying to migrate the old Spring 2.5.x and GWT version 2.4 based MVC application to Spring-Boot with same GWT version 2.4 and gxt version 2.2; I'm able to migrate the Spring part of the application, Spring Boot application is able run and able to interact with DB, the problem is with GWT UI, when I try to load the UI, with pointing to a controller it throws the exception as below:

com.google.gwt.user.client.rpc.StatusCodeException:404

Even after trying the different request mapping as well, still I'm unable to solve the issue. I tried to follow the GWT project tutorial, and some other Spring and RPC related blogs, but no luck. Any help is appreciated.

Application uses GWT-RPC. Below is the current stack of the application

  1. GWT - 2.4,
  2. GXT - 2.2,
  3. Spring-Boot - 1.5.3,
  4. JDK- 1.8*

Below is my pom.xml,

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.4.0</version>
<configuration>
  <runTarget>app.html</runTarget>
  <module>com.myapp.app</module>
  <hostedWebapp>${webappDirectory}</hostedWebapp>
  <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
  <logLevel>DEBUG</logLevel>
  <logLevel>TRACE</logLevel>
  <disableCastChecking>true</disableCastChecking>
  <style>PRETTY</style>
  <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
  <force>true</force>
</configuration>
<executions>
  <execution>
    <goals>
      <goal>compile</goal>
    </goals>
  </execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<executions>
  <execution>
    <phase>compile</phase>
    <goals>
      <goal>exploded</goal>
    </goals>
  </execution>
</executions>
<configuration>
  <webappDirectory>${webappDirectory}</webappDirectory>
  <failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>

Below is my web.xml

<!-- Default page to serve -->
<welcome-file-list>
    <welcome-file>app.html</welcome-file>
</welcome-file-list>
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        classpath*:app-servlet.xml
        classpath*:applicationContext.xml
    </param-value>
</context-param>

<!-- Servlets -->
<servlet>
    <servlet-name>one</servlet-name>
    <servlet-class>
       com.example.server.common.controller.ServletOne
   </servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>servletOne</servlet-name>
    <url-pattern>/one</url-pattern>
</servlet-mapping>

<!-- Servlets -->
<servlet>
    <servlet-name>servletTwo</servlet-name>
    <servlet-class>
       com.example.server.common.controller.ServletTwo
   </servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>servlettwo</servlet-name>
    <url-pattern>/two</url-pattern>
</servlet-mapping>
<servlet>
    <servlet-name>myapp</servlet-name>
    <servlet-class>
      org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>myapp</servlet-name>
    <url-pattern>/myapp/controller/*</url-pattern>
</servlet-mapping>

My Spring Boot entry point code

 @SpringBootApplication
    @EnableTransactionManagement(proxyTargetClass=true)
    @ImportResource("classpath*:applicationContext.xml")
    public class Application{
      public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
0 Answers
Related