Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageJ cannot load the scripts #12

Open
fmeyenhofer opened this issue Mar 10, 2017 · 1 comment
Open

ImageJ cannot load the scripts #12

fmeyenhofer opened this issue Mar 10, 2017 · 1 comment

Comments

@fmeyenhofer
Copy link

Hi

When launching ImageJ from MATLAB I get the errors bellow telling me that some scripts cannot be loaded. However I checked the paths and the files are there.
Tjh IJM and MIJ objects are created though and they work.

I have the following setup:
OsX sierra
Java 1.8.0_40-b25 (as mentioned in the wiki)
MATLAB 2016b

>> ImageJ
[ERROR] Cannot create plugin: class='org.scijava.plugins.scripting.javascript.JavaScriptScriptLanguage', name='JavaScript', priority=0.0, enabled=true, pluginType=ScriptLanguage
java.lang.IllegalArgumentException: No such script engine: javascript
	at org.scijava.script.AdaptedScriptLanguage.findFactory(AdaptedScriptLanguage.java:151)
	at org.scijava.script.AdaptedScriptLanguage.<init>(AdaptedScriptLanguage.java:73)
	at org.scijava.plugins.scripting.javascript.JavaScriptScriptLanguage.<init>(JavaScriptScriptLanguage.java:59)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at java.lang.Class.newInstance(Class.java:442)
	at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:304)
	at org.scijava.plugin.DefaultPluginService.createInstance(DefaultPluginService.java:236)
	at org.scijava.plugin.DefaultPluginService.createInstances(DefaultPluginService.java:225)
	at org.scijava.plugin.DefaultPluginService.createInstancesOfType(DefaultPluginService.java:216)
	at org.scijava.plugin.AbstractSingletonService.initInstances(AbstractSingletonService.java:92)
	at org.scijava.plugin.AbstractSingletonService.getInstances(AbstractSingletonService.java:75)
	at org.scijava.script.DefaultScriptService.initScriptLanguageIndex(DefaultScriptService.java:273)
	at org.scijava.script.DefaultScriptService.scriptLanguageIndex(DefaultScriptService.java:238)
	at org.scijava.script.DefaultScriptService.getIndex(DefaultScriptService.java:118)
	at org.scijava.script.ScriptService.canHandleFile(ScriptService.java:314)
	at org.scijava.script.ScriptFinder.createInfos(ScriptFinder.java:165)
	at org.scijava.script.ScriptFinder.scanResources(ScriptFinder.java:133)
	at org.scijava.script.ScriptFinder.findScripts(ScriptFinder.java:109)
	at org.scijava.script.DefaultScriptService.initScripts(DefaultScriptService.java:314)
	at org.scijava.script.DefaultScriptService.scripts(DefaultScriptService.java:256)
	at org.scijava.script.DefaultScriptService.getScripts(DefaultScriptService.java:153)
	at net.imagej.legacy.LegacyService.getScriptsAndNonLegacyCommands(LegacyService.java:628)
	at net.imagej.legacy.IJ1Helper.addMenuItems(IJ1Helper.java:744)
	at net.imagej.legacy.LegacyService.initialize(LegacyService.java:488)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:353)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:340)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)
	at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:166)
	at org.scijava.Context.<init>(Context.java:278)
	at org.scijava.Context.<init>(Context.java:234)
	at org.scijava.Context.<init>(Context.java:174)
	at org.scijava.Context.<init>(Context.java:160)
	at net.imagej.ImageJ.<init>(ImageJ.java:77)
	at net.imagej.Main.launch(Main.java:61)
	at net.imagej.matlab.ImageJMATLAB.launch(ImageJMATLAB.java:151)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:105)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:92)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:81)
[ERROR] Invalid script URL: file:/Users/turf/Applications/Fiji.app/plugins/Scripts/File/Open_Samples/Comparing_Lengths.ijm
java.io.FileNotFoundException: /Users/turf/Applications/Fiji.app/plugins/Scripts/File/Open_Samples/Comparing_Lengths.ijm (Too many open files)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:93)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
	at java.net.URL.openStream(URL.java:1038)
	at org.scijava.script.ScriptInfo.<init>(ScriptInfo.java:139)
	at org.scijava.script.ScriptFinder.createInfos(ScriptFinder.java:193)
	at org.scijava.script.ScriptFinder.scanDirectory(ScriptFinder.java:152)
	at org.scijava.script.ScriptFinder.findScripts(ScriptFinder.java:115)
	at org.scijava.script.DefaultScriptService.initScripts(DefaultScriptService.java:314)
	at org.scijava.script.DefaultScriptService.scripts(DefaultScriptService.java:256)
	at org.scijava.script.DefaultScriptService.getScripts(DefaultScriptService.java:153)
	at net.imagej.legacy.LegacyService.getScriptsAndNonLegacyCommands(LegacyService.java:628)
	at net.imagej.legacy.IJ1Helper.addMenuItems(IJ1Helper.java:744)
	at net.imagej.legacy.LegacyService.initialize(LegacyService.java:488)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:353)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:340)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)
	at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:166)
	at org.scijava.Context.<init>(Context.java:278)
	at org.scijava.Context.<init>(Context.java:234)
	at org.scijava.Context.<init>(Context.java:174)
	at org.scijava.Context.<init>(Context.java:160)
	at net.imagej.ImageJ.<init>(ImageJ.java:77)
	at net.imagej.Main.launch(Main.java:61)
	at net.imagej.matlab.ImageJMATLAB.launch(ImageJMATLAB.java:151)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:105)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:92)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:81)
[ERROR] Invalid script URL: file:/Users/turf/Applications/Fiji.app/plugins/Scripts/Image/Color/Set_Color_By_Wavelength.ijm
java.io.FileNotFoundException: /Users/turf/Applications/Fiji.app/plugins/Scripts/Image/Color/Set_Color_By_Wavelength.ijm (Too many open files)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:93)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
	at java.net.URL.openStream(URL.java:1038)
	at org.scijava.script.ScriptInfo.<init>(ScriptInfo.java:139)
	at org.scijava.script.ScriptFinder.createInfos(ScriptFinder.java:193)
	at org.scijava.script.ScriptFinder.scanDirectory(ScriptFinder.java:152)
	at org.scijava.script.ScriptFinder.findScripts(ScriptFinder.java:115)
	at org.scijava.script.DefaultScriptService.initScripts(DefaultScriptService.java:314)
	at org.scijava.script.DefaultScriptService.scripts(DefaultScriptService.java:256)
	at org.scijava.script.DefaultScriptService.getScripts(DefaultScriptService.java:153)
	at net.imagej.legacy.LegacyService.getScriptsAndNonLegacyCommands(LegacyService.java:628)
	at net.imagej.legacy.IJ1Helper.addMenuItems(IJ1Helper.java:744)
	at net.imagej.legacy.LegacyService.initialize(LegacyService.java:488)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:353)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:340)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)
	at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:166)
	at org.scijava.Context.<init>(Context.java:278)
	at org.scijava.Context.<init>(Context.java:234)
	at org.scijava.Context.<init>(Context.java:174)
	at org.scijava.Context.<init>(Context.java:160)
	at net.imagej.ImageJ.<init>(ImageJ.java:77)
	at net.imagej.Main.launch(Main.java:61)
	at net.imagej.matlab.ImageJMATLAB.launch(ImageJMATLAB.java:151)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:105)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:92)
	at net.imagej.matlab.ImageJMATLAB.start(ImageJMATLAB.java:81)
@ctrueden
Copy link
Member

java.lang.IllegalArgumentException: No such script engine: javascript

This is a more general problem with the fact that Java 8 ships the Nashorn JavaScript engine as a platform extension, and I guess in some cases the platform extensions are not initialized properly. I have seen this error outside the context of MATLAB as well. For now, I suggest ignoring it unless you need JavaScript scripting from MATLAB specifically.

(Too many open files)

From the Miji page:

There are over 300 jar and plugin files that ship with Fiji, and depending on your operating system and configuration, you may run into too many files open errors (for example, on OSX MATLAB seems to use the default soft limit for open files, which is typically 256). If this happens you will need to increase the open file limit per-session or system-wide. See this guide for helpful instructions on doing so for OSX and Linux.

Maybe that guide helps alleviate the issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants