Skip to content

Troubleshooting the Jangaroo IDEA Plugin

Frank Wienberg edited this page Feb 14, 2014 · 9 revisions

If you have trouble working with the Jangaroo IDEA Plugin, please consider the following advice.

IDEA Versions

The Jangaroo Plugin comes in two version: one for IDEA 13 (currently 0.26) and one for IDEA 10.5, 11.x or 12.x (currently 0.24). For IDEA 12, mind the advice to switch off the setting Use external build under Settings/ Project Settings/ Compiler for each project (details see below).

Plugin Version

Almost everybody should use the Jangaroo IDEA Plugin version Jangaroo 0.9 (the only version still available in the Jetbrains IDEA Plugin repository). If you are a CoreMedia customer and think you need an old version of the plugin, please contact CoreMedia support.

Broken Dependencies After Maven Import

Symptom: After importing a project from Maven, all dependencies are broken and IDEA says it cannot find somelibrary.jangaroo.

Applies to: IDEA 13 with Jangaroo 0.x / 1.x

Solution:

  • Open "Settings / Maven / Importing"
  • Uncheck "Use Maven 3 to import project"
  • In "Maven Projects" panel, click "Reimport All Maven Projects"

Copy Errors During Build

Symptom: During Build / Make Project, the build stops with an error like this one:

Error copying <source-folder>/com/acme/Foo.as to <target-folder>/classes/com/acme/Foo.as:
<source-folder>/com/acme/Foo.as (No such file or directory)     

Applies to: IDEA 12 and below

Solution:

  • Open "Settings / Compiler"
  • Check that your "Resource patterns" use the new negated patterns like !?*.java
  • Add negative resource patterns for ActionScript, EXML, and MXML, i.e. append ;!?*.as;!?*.exml;!?*.mxml.
  • Important: This is a project setting, and as such, has to be repeated for every new IDEA project using Jangaroo.

Evaluation: Before version 13, IDEA makes no distinction between source- and resource-folders. Thus, you have to configure patterns for resources. These patterns used to be white-lists (which file names are resources?), but can now also be black-lists (which file names are sources and should not be copied?), using the new negation operator !. With IDEA 12, the default resource pattern was changed to utilize the negation operator. However, the new default pattern does not contain rules for ActionScript source files, and thus IDEA 12 (in its default configuration) tries to copy ActionScript source files as if they were resources. This combined with the Jangaroo compiler generating ActionScript sources on the fly (from EXML) leads to the problem, and it is resolved by telling IDEA not to treat ActionScript source files as resources. We hope to integrate this configuration into a future version of the Jangaroo IDEA plugin, making the manual configuration obsolete.

Errors after updating

If you see errors or exceptions related to the Jangaroo IDEA Plugin after updating to the latest plugin version or the latest IDEA version, mind the following:

  • When using IDEA 12, it is important to switch off the setting Use external build under Settings/ Project Settings/ Compiler. If this option is set, the Jangaroo compiler is not invoked, because it does not yet implement IDEA's new external build API. Important: Note that this is a project setting, so you have to uncheck this option for every new IDEA project using Jangaroo.
  • If you import the whole project from Maven (as recommended), you can safely delete all Jangaroo and EXML facets, all Jangaroo SDKs and all IDEA "artifacts". After re-import, all needed items will re-appear and then should work.

Changes in IDEA are not visible in the browser

One of the most frequent problems with the Jangaroo IDEA Plugin is the impression that Make project does not compile the ActionScript or EXML sources to JavaScript. To avoid this problem, consider the following issues:

  • Clear the browser cache or tell your web server to deliver the JavaScript files under joo/classes with the well-known don't-cache headers. Chrome Developer Tools have an option to disable caching while they are open. We discourage to switch off caching globally, since you would not test the end user's experience of your Web application.
  • If using Jetty under Windows, make sure the option useFileMappedBuffers is set to false. This can be set in the web.xml or in a custom webdefaults.xml, where the latter has to be configured in your project's pom.xml. If Jetty locks the files, they cannot be updated while Jetty runs.
  • Make sure to invoke your application using #joo.debug in the hash part of the URL, because the Jangaroo IDEA Plugin only updates the single JavaScript files, not the concatenated *.classes.js file which is loaded in non-debug mode.
  • If you are working with Maven, re-import the Maven project. If that does not help, try the steps given in section "Errors after updating".
  • There may be a problem with IDEA's compiler caches. Use Rebuild project instead. For larger projects, this takes a while, but you only have to do this once. When the turn-around works again, you can continue to use Make project, which is very fast.
  • When working with multiple modules, the generated JavaScript files are written to the module's output directory, and the "Jangaroo packaging output" of that module is added to IDEA's "exploded" web application artifact. The Build on make option has to be checked for that artifact. When importing from Maven, the Jangaroo IDEA Plugin takes care of this setup, but without Maven, you have to do this step manually.