The problem is due to the javascript language not being registered.
I modified some code I found on servicemix nabble to make sure the javascript engine is registered and has the key (language name) js
instead of ECMAScript
.
Same goes for groovy
(instead of Groovy
), although please note: this part is untested.
How to fix:
Copy the
Activator
code from this page and add it as a new class in your project.Modify the
register()
method inBundleLanguageResolver
as follows:public void register() { try { String language = factory.getLanguageName(); // Hack to register languages correctly if ("ECMAScript".equals(language)) language = "js"; if ("Groovy".equals(language)) language = "groovy"; Hashtable<String, Object> properties = new Hashtable<String, Object>(); properties.put("language", language); reg = bundle.getBundleContext().registerService( LanguageResolver.class, new ScriptLanguageResolver(), properties); LOG.debug("Register LanguageResolver: " + language); } catch(Exception e) { LOG.warn("Cannot register LanguageResolver: " + e.getClass().getName(), e); } }
Add the class you just created (e.g.
com.my.Activator
) to the manifest as aBundle-Activator
. The maven-bundle-plugin line can look like this:<Bundle-Activator>com.my.Activator</Bundle-Activator>
Perhaps there is another solution, but in the meantime this works for me.