Activating GWT Dev Mode on a GWT application built using Maven

916 views Asked by At

TL;DR: In order to debug the client-side, I ran gwt:run goal, launched the application on Chrome, and after login in, it threw the exception below, and GWT dev mode didn't launch (none of the client-side breakpoints worked)

    javax.el.ELException: /pages/common/gwt/commonLayoutGWT.xhtml: setAttribute: Non-serializable attribute with name sessionBean
        at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:90)
        at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
        at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
        ...

What should I do, or what should I check to get my GWT Dev mode working properly?


Some background: previously, our team used some ant scripts for compiling, debugging (server and client code), running and deploying our main application. It worked without a problem, although the process was really cumbersome and manual. We decided to make it a Maven application some months ago, and we were able to successfully execute all actions/goals after using Maven. Compiling, running and deploying the application became fast and convenient, which was our goal.

But up until now we didn't notice that at some point in the process, our client side debugging stopped working. Only after we got some bug reports and started trying to debug them, we did notice the issue. So now I need to set the GWT Dev Mode, and haven't been able to do it no matter what I've tried.

  1. I'm working with:

    • SmartGWT 4.0
    • JDK 1.8.0_121
    • GWT Eclipse Plugin 2.8.0
    • GlassFish 4.1
    • Maven 3.3
  2. I tried to follow some instructions from gwtproject, using the default linker xsiframe into gwt.xml file.

  3. But when I executed the gwt:compile goal, this error showed up:

    [INFO] Linking into D:\Development\Repos\Git\Java\MyApp\myApp\target\classes\..\..\..\myApp\WebContent\pages\module\gwt\com.myapp.client.gwt.MyAppClient
    [INFO]    Invoking Linker Cross-Site-Iframe
    [INFO]       [ERROR] The Cross-Site-Iframe linker does not support <script> tags in the gwt.xml files, but the gwt.xml file (or the gwt.xml files which it includes) contains the following script tags: 
    
  4. To solve this, I used one of the recommended solutions by the error itself: "...add this property to the gwt.xml file: <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>"

  5. I ran the gwt:compile again, and it finished successfuly

1

There are 1 answers

2
Thomas Broyer On

I suggest running your server-side code in a separate server (could be mvn jetty:run), and run GWT Dev Mode only for the clientside code (use <noserver>true</noserver>).

That solves so many problems (with running webapps inside DevMode's embedded server) that's it's the recommended setup nowadays.