Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Super dev mode from Intellij (new)

Latest Intellij seems to support debugging client side Vaadin. Tested on Intellij 15 and Vaadin 7.4.7.

  • Make sure GWT and Vaadin Support are added to Intellij. Not sure whether the Vaadin one is needed (?).

  • At the same time - check that the legacy third party Vaadin plugin is not installed since it will prevent automatic recognition of Vaadin as a carrier of GWT SDK. If it is installed - remove it:

 


  • Add magnolia-vaadin-widgetset module and create a new debug profile.

  • Increase the memory and tweak the dev mode parameters
    • VM options: -Xmx1024m
    • Dev mode parameters: -nostartServer -logLevel DEBUG -noincremental

Note: The log level is a quirk to work-around an issue with mgwt hick-up.


  • Create the GWT facet. Point it to the vaadin-client library inside your local m2-repository: /Users/you/.m2/repository/com/vaadin/vaadin-client/7.4.7

  • And add it to your widgetset-module:

  • Run it in debug mode. Don't forget to also start the application server.
    • The console will point you to the code-servers port where you can proceed as in the old procedure by creating the bookmarks.


  • If you run into javax.servlet.http.HttpSessionIdListener or java.lang.NullPointerException when starting gwt debug, include dependencies below in widgetset's pom.xml:
Code Block
<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.1.0</version>
</dependency>
<dependency>
  <groupId>com.google.code.gson</groupId>
  <artifactId>gson</artifactId>
  <version>2.6.2</version>
</dependency>

Debugging with Intellij using source maps

Prequsities

Configuration

Go to Run > Edit Configurations, click + button in the upper left corner (or hit ⌘N) and choose JavaScript Debug.

Configuration should look like this:


Put breakpoint in some client code and hit debug button. Chrome browser will start and debugging should now happen in Intellij.

In case debugging is not working, make sure you are running gwt in super dev mode, and that widgetset is compiled (use bookmars from gwt code server).

Super dev mode from vaadin code-server (old)

https://vaadin.com/wiki/-/wiki/Main/Using+SuperDevMode

$ cd /path/to/magnolia_widgetset

$ mvn clean install -U

$ mvn vaadin:compile

$ mvn vaadin:run-codeserver

[INFO] The code server is ready.
[INFO] Next, visit: http://localhost:9876/

Create Bookmark.

I have the following projects open in IDE (used for server side Java debugging):

Start up Magnolia (tomcat) from your IDE. Go to e.g. http://localhost:8080/.magnolia/admincentral

Hit the super-dev-mode-bookmark. Open chrome/firefox debugger. Enable source mapping (default):

Note: There is a plugin for eclipse, which will allow debugging the source maps in eclipse. Intellij should allow it per default. But did not get it running.


Eclipse launch configuration

Below is a launch configuration for eclipse. (warning) After importing, you will have to update the GWT libs on the classpath in "Debug Configurations..." (pointing to my maven repo by default).

Note that it does not enable debugging in the IDE.

M5 SuperDevMode.launch

Problems

Opening apps from the app-launcher is not working, due to mgwt. As a workaround use the browser location to get into your app: http://localhost:8080/.magnolia/admincentral#apps:pages

IntelliJ shows (compilation) errors related to language level

It seems that in some cases, the GWT compiler seems to default to Java 7, ignoring all other configuration. This shows as error messages in the editor like Lambda expressions are not supported at this language level. GWT facet of your module is configured with language level 1.7.

To force it using a certain language level, open your widgetset module's GWT facet settings (see above) and add the following under "Compiler parameters":

-sourceLevel 8