tomcatintellij-ideatomcat8gwt-platformtomcat8.5

How to run a GWTP web application with IntelliJ on local Tomcat server?


Is there a way to run a gwtp project on Intellij Idea and local Tomcat server? I tried it with run smart Tomcat and GWT configration, but I received an error like this:

Uncaught Error: java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable in client code! It cannot be called, for example, from server code.

This means that I am not allowed to use client code in server code. This is so bad, because this project runs perfectly on global server nginx and tomcat. The project also runs perfectly on local in development mode, with GWT configuration and different pom.xml.

Also, I receive the error if I do not start a GWT configuration:

could not load app from super dev mode at server http://localhost:9876


Solution

  • It's funny that I ran into this problem again after a long time. Both war address should be the same. tomcat and run configuration.

    Sample of run conf for this state:

    -logLevel
    INFO
    -startupUrl
    App.html
    -war
    <your project war directory. Ex: /target/gwttakeexam-0.0.1-SNAPSHOT>
    -bindAddress
    <your local IP address>
    -noserver
    -codeServerPort
    <some free port: 8085>
    -port
    <tomcat server port: 8080>
    -generateJsInteropExports
    onlineducation.monta.App
    

    Tomcat deployment conf

    Dev mode parameters of GWT run conf