GWT Sample Application not working in IntelliJ IDEA

3

I've been trying to get started using GWT however I didn't want to switch over to Eclipse from my students IntelliJ IDEA Ultimate License, which is the IDE used in the gwtproject.org tutorial. In this tutorial they first want you to create a Sample Web App using webAppCreator, which I figure is the Sample Application that can be created when opening a new project with GWT support in IntelliJ. My problem, however, is that when launching their Sample Application I get a whole load of error messages in the Dev Mode Tab. Once my browser is launched there's only an HTTP Error 503 Message, saying the service is unavailable. This is using the 2.8.2 version of gwt with apache ant installed (if that's relevant). Using the 2.7.0 gwt distribution I don't even get there as it almost immediately crashes.

Thanks, upfront for any help!

I'm not sure if this is still accurate but I read that IntelliJ only supports gwt 2.7.0 which is why I included both in my question.

Dev Mode Log using Java 1.8 and gwt 2.7.0

Runing CodeServer with parameters: [-noprecompile, -port, 9876, -sourceLevel, 1.7, -bindAddress, 127.0.0.1, -launcherDir, C:\Users\nicol\.IntelliJIdea2018.3\system\gwt\java18and270.a6677367\java18and270.73130fb9\run\www, -logLevel, INFO, com.mySampleApplication.MySampleApplication]
Mär 25, 2019 12:45:31 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Super Dev Mode starting up
   workDir: C:\Users\nicol\AppData\Local\Temp\gwt-codeserver-4172072951619368748.tmp
Loading modules
   com.mySampleApplication.MySampleApplication
      Validating <servlet> tags for module 'MySampleApplication'
      For additional info see: file:/G:/nicol/Libraries/OneDrive/JavaDevelopment/WebDev/gwt-2.7.0/doc/helpInfo/servletMappings.html
         [WARN] Module declares a servlet class 'com.mySampleApplication.server.MySampleApplicationServiceImpl', but the web.xml has no corresponding declaration; please add the following lines to your web.xml:
<servlet>
  <servlet-name>mySampleApplicationServiceImpl</servlet-name>
  <servlet-class>com.mySampleApplication.server.MySampleApplicationServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>mySampleApplicationServiceImpl</servlet-name>
  <url-pattern>/MySampleApplication/MySampleApplicationService</url-pattern>
</servlet-mapping>
   Loading Java files in com.mySampleApplication.MySampleApplication.
Starting Jetty on port 8888
   [WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload{/,file:/C:/Users/nicol/.IntelliJIdea2018.3/system/gwt/java18and270.a6677367/java18and270.73130fb9/run/www/},C:\Users\nicol\.IntelliJIdea2018.3\system\gwt\java18and270.a6677367\java18and270.73130fb9\run\www
java.lang.NullPointerException
    at org.eclipse.jetty.servlet.ServletHolder.compareTo(ServletHolder.java:204)
    at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:321)
    at java.util.ComparableTimSort.sort(ComparableTimSort.java:188)
    at java.util.Arrays.sort(Arrays.java:1246)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:770)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:541)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:162)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:740)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:632)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1054)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
    at com.google.gwt.dev.DevMode.main(DevMode.java:413)
   Module setup completed in 13378 ms

The code server is ready at http://127.0.0.1:9876/
Code server started in 13692 ms
waited 9583 ms for code server to finish
Dev Mode initialized. Startup URL: 
http://127.0.0.1:8888/MySampleApplication.html
[ERROR] 503 - GET /MySampleApplication.html (127.0.0.1) 1311 bytes
   Request headers
      Host: 127.0.0.1:8888
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
      Accept-Language: de,en-US;q=0.7,en;q=0.3
      Accept-Encoding: gzip, deflate
      DNT: 1
      Connection: keep-alive
      Upgrade-Insecure-Requests: 1
   Response headers
      Cache-Control: must-revalidate,no-cache,no-store
      Content-Type: text/html;charset=ISO-8859-1
      Content-Length: 1311
[ERROR] 503 - GET /favicon.ico (127.0.0.1) 1298 bytes
   Request headers
      Host: 127.0.0.1:8888
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
      Accept-Language: de,en-US;q=0.7,en;q=0.3
      Accept-Encoding: gzip, deflate
      DNT: 1
      Connection: keep-alive
   Response headers
      Cache-Control: must-revalidate,no-cache,no-store
      Content-Type: text/html;charset=ISO-8859-1
      Content-Length: 1298

Dev Mode Log using java 1.8 and gwt 2.8.2

    Running CodeServer with parameters: [-noprecompile, -port, 9876, -sourceLevel, 1.8, -bindAddress, 127.0.0.1, -launcherDir, C:\Users\nicol\.IntelliJIdea2018.3\system\gwt\java18and282.a6677388\java18and282.cbb23d59\run\www, -logLevel, INFO, -style, OBFUSCATED, com.mySampleApplication.MySampleApplication]
Mär 25, 2019 12:47:21 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Super Dev Mode starting up
   workDir: C:\Users\nicol\AppData\Local\Temp\gwt-codeserver-9053967864514777082.tmp
2019-03-25 12:47:22.461:INFO::main: Logging initialized @2528ms
   Loading Java files in com.mySampleApplication.MySampleApplication.
   Module setup completed in 16450 ms
2019-03-25 12:47:37.943:INFO:oejs.Server:main: jetty-9.2.z-SNAPSHOT
2019-03-25 12:47:37.971:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@64dcaf38{/,null,AVAILABLE}
2019-03-25 12:47:37.998:INFO:oejs.ServerConnector:main: Started ServerConnector@184e6e74{HTTP/1.1}{127.0.0.1:9876}
2019-03-25 12:47:37.998:INFO:oejs.Server:main: Started @18064ms

The code server is ready at http://127.0.0.1:9876/
Code server started in 16.78 s ms
Loading modules
   com.mySampleApplication.MySampleApplication
      Validating <servlet> tags for module 'MySampleApplication'
      For additional info see: file:/G:/nicol/Libraries/OneDrive/JavaDevelopment/WebDev/gwt-2.8.2/doc/helpInfo/servletMappings.html
         [WARN] Module declares a servlet class 'com.mySampleApplication.server.MySampleApplicationServiceImpl', but the web.xml has no corresponding declaration; please add the following lines to your web.xml:
<servlet>
  <servlet-name>mySampleApplicationServiceImpl</servlet-name>
  <servlet-class>com.mySampleApplication.server.MySampleApplicationServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>mySampleApplicationServiceImpl</servlet-name>
  <url-pattern>/MySampleApplication/MySampleApplicationService</url-pattern>
</servlet-mapping>
2019-03-25 12:47:38.166:INFO:oejs.Server:main: jetty-9.2.z-SNAPSHOT
2019-03-25 12:47:40.252:WARN:/:main: unavailable
javax.servlet.UnavailableException: No class in holder
    at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:88)
    at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:338)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:870)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:354)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:760)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
    at com.google.gwt.dev.DevMode.main(DevMode.java:432)
2019-03-25 12:47:40.253:WARN:oejuc.AbstractLifeCycle:main: FAILED null@5353c376==null,-1,false: javax.servlet.UnavailableException: No class in holder
javax.servlet.UnavailableException: No class in holder
    at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:88)
    at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:338)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:870)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:354)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:760)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
    at com.google.gwt.dev.DevMode.main(DevMode.java:432)
2019-03-25 12:47:40.267:WARN:/:main: unavailable
javax.servlet.UnavailableException: No class in holder
    at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:88)
    at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:338)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:888)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:354)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:760)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
    at com.google.gwt.dev.DevMode.main(DevMode.java:432)
2019-03-25 12:47:40.268:WARN:oejuc.AbstractLifeCycle:main: FAILED null@5353c376==null,-1,false: javax.servlet.UnavailableException: No class in holder
javax.servlet.UnavailableException: No class in holder
    at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:88)
    at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:338)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:888)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:354)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:760)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
    at com.google.gwt.dev.DevMode.main(DevMode.java:432)
Starting Jetty on port 8888
   [WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@30de9fe5{/,file:/C:/Users/nicol/.IntelliJIdea2018.3/system/gwt/java18and282.a6677388/java18and282.cbb23d59/run/www/,STARTING}{C:\Users\nicol\.IntelliJIdea2018.3\system\gwt\java18and282.a6677388\java18and282.cbb23d59\run\www}
MultiException[javax.servlet.UnavailableException: No class in holder, javax.servlet.UnavailableException: No class in holder]
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:842)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:354)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:760)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
    at com.google.gwt.dev.DevMode.main(DevMode.java:432)
    Suppressed: javax.servlet.UnavailableException: No class in holder
        at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:88)
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:338)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:888)
        ... 23 more
Caused by: javax.servlet.UnavailableException: No class in holder
    at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:88)
    at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:338)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:870)
    ... 23 more
2019-03-25 12:47:40.272:INFO:oejs.ServerConnector:main: Started ServerConnector@14ff45c2{HTTP/1.1}{127.0.0.1:8888}
2019-03-25 12:47:40.273:INFO:oejs.Server:main: Started @20339ms
Dev Mode initialized. Startup URL: 
http://127.0.0.1:8888/MySampleApplication.html
[ERROR] 503 - GET /MySampleApplication.html (127.0.0.1) 312 bytes
   Request headers
      Host: 127.0.0.1:8888
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
      Accept-Language: de,en-US;q=0.7,en;q=0.3
      Accept-Encoding: gzip, deflate
      DNT: 1
      Connection: keep-alive
      Upgrade-Insecure-Requests: 1
   Response headers
      Date: Mon, 25 Mar 2019 11:47:41 GMT
      Cache-Control: must-revalidate,no-cache,no-store
      Content-Type: text/html; charset=ISO-8859-1
      Content-Length: 312
java
intellij-idea
gwt
asked on Stack Overflow Mar 25, 2019 by Nicolai Hornung • edited Mar 25, 2019 by Nicolai Hornung

1 Answer

1

The problem seems to be that the "sample GWT project" created by IntelliJ is missing the servlet declarations in the web.xml file, as noticed by this warning you're getting in the logs:

[WARN] Module declares a servlet class 'com.mySampleApplication.server.MySampleApplicationServiceImpl', but the web.xml has no corresponding declaration; please add the following lines to your web.xml:
<servlet> <servlet-name>mySampleApplicationServiceImpl</servlet-name> <servlet-class>com.mySampleApplication.server.MySampleApplicationServiceImpl</servlet-class> </servlet> <servlet-mapping> <servlet-name>mySampleApplicationServiceImpl</servlet-name> <url-pattern>/MySampleApplication/MySampleApplicationService</url-pattern> </servlet-mapping>

After inspection, I can confirm that IntelliJ's generated web.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <servlet/>
</web-app>

So you'll need to add the lines mentioned in the log for this to work:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <servlet>
        <servlet-name>mySampleApplicationServiceImpl</servlet-name>
        <servlet-class>com.mySampleApplication.server.MySampleApplicationServiceImpl</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>mySampleApplicationServiceImpl</servlet-name>
        <url-pattern>/MySampleApplication/MySampleApplicationService</url-pattern>
    </servlet-mapping>
</web-app>

For reference, compare with the sample web.xml created by GWT SDK's webAppCreator command, which does not have this problem:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">

  <!-- Servlets -->
  <servlet>
    <servlet-name>greetServlet</servlet-name>
    <servlet-class>com.example.server.GreetingServiceImpl</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>greetServlet</servlet-name>
    <url-pattern>/stockwatcher/greet</url-pattern>
  </servlet-mapping>

  <!-- Default page to serve -->
  <welcome-file-list>
    <welcome-file>StockWatcher.html</welcome-file>
  </welcome-file-list>

</web-app>
answered on Stack Overflow Mar 27, 2019 by walen

User contributions licensed under CC BY-SA 3.0