Fiji command unable to find JOGL library - minimal example

maven
fiji
Tags: #<Tag:0x00007fd542f2b858> #<Tag:0x00007fd542f2b448>

#1

Hi everybody,

I have troubles being able to work with JOGL using maven and ImageJ. To illustrate the problem, I made a minimal exmaple with a command (https://github.com/NicoKiaru/MinJOGLCmd).

This command has two dependencies :

<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>

<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>

The command works under eclipse, no problem.

When I deploy my command on a Fiji install, it seems to be conflicting with the Java 8 update site.

So I update Fiji (it doesn’t work anyway). And when I launch this command, I get an java.lang.UnsatisfiedLinkError.

java.lang.UnsatisfiedLinkError: Can't load library: E:\Dropbox\NicoWork\JOGLFiji\Fiji.app\natives\windows-amd64\\nativewindow_awt.dll
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:624)
	at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
	at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)

So Java wants the natives to be located in Fiji.app\natives\windows-amd64, but they are into a jar in Fiji.app\jars\win64 .

If I put the natives into the correct folder, then my command works. BUT this is quite annoying since I have to do this manipulation each time I need to deploy to Fiji. As well, if users want to use my plugin via an update site, they will get this error as well.

So, what should I change to integrate correctly this minimal command with FIJI and JOGL ?

Thanks for any suggestions!


#2

edit : (images updated, useless message)


#3

Hi @NicoKiaru

that’s strange…
The following Groovy script works for me (i.e. displays a window) in an up-to-date Fiji installation:

import com.jogamp.newt.NewtFactory
import com.jogamp.newt.opengl.GLWindow
import com.jogamp.opengl.GL
import com.jogamp.opengl.GL2
import com.jogamp.opengl.GLAutoDrawable
import com.jogamp.opengl.GLCapabilities
import com.jogamp.opengl.GLProfile

glProfile = GLProfile.get(GLProfile.GL2)
glCapabilities = new GLCapabilities(glProfile)

display = NewtFactory.createDisplay(null)
screen = NewtFactory.createScreen(display, 0)
glWindow = GLWindow.create(screen, glCapabilities)
glWindow.setUndecorated(false);
glWindow.setAlwaysOnTop(false);
glWindow.setFullscreen(false);
glWindow.setPointerVisible(true);
glWindow.confinePointer(false);
glWindow.setTitle("JOGLWindowTest");
glWindow.setSize(300, 300);
glWindow.setVisible(true);

If that works for you as well: can you post the full stack trace, so we can find out where in your code the JNILibLoaderBase gets called?

Also, do you have any additional (possibly conflicting) update sites enabled?


Sciview / Scenery graphics - first tests and first problems
#4

Thanks for looking at this!

1 - Your script works without any problem on my Fiji config (fresh install or not).
2 - I do not have any update site enabled apart from ImageJ / Fiji / Java-8 which are enabled by default.

The full stack trace is this one I guess :

[ERROR] Module threw error
java.lang.UnsatisfiedLinkError: Can't load library: E:\Dropbox\NicoWork\JOGLFiji\Fiji.app\natives\windows-amd64\\nativewindow_awt.dll
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:624)
	at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
	at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)
	at jogamp.nativewindow.NWJNILibLoader.access$000(NWJNILibLoader.java:39)
	at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:49)
	at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:41)
	at java.security.AccessController.doPrivileged(Native Method)
	at jogamp.nativewindow.NWJNILibLoader.loadNativeWindow(NWJNILibLoader.java:41)
	at jogamp.nativewindow.jawt.JAWTUtil.<clinit>(JAWTUtil.java:336)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:344)
	at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:340)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.nativewindow.NativeWindowFactory.initSingleton(NativeWindowFactory.java:340)
	at com.jogamp.newt.NewtFactory$1.run(NewtFactory.java:68)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.newt.NewtFactory.<clinit>(NewtFactory.java:65)
	at eu.kiaru.ij.JOGLWindowTest.<init>(JOGLWindowTest.java:30)
	at eu.kiaru.ij.MinJOGLIJCommand.run(MinJOGLIJCommand.java:39)
	at org.scijava.command.CommandModule.run(CommandModule.java:198)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:237)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

#5

The former stack trace was in the Console window.

I also get this one from a FIJI Exception window:

(Fiji Is Just) ImageJ 2.0.0-rc-61/1.51n; Java 1.8.0_66 [64-bit]; Windows 7 6.1; 57MB of 12185MB (<1%)
 
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: Can't load library: E:\Dropbox\NicoWork\JOGLFiji\Fiji.app\natives\windows-amd64\\nativewindow_awt.dll
	at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:291)
	at net.imagej.legacy.DefaultLegacyHooks.interceptRunPlugIn(DefaultLegacyHooks.java:163)
	at ij.IJ.runPlugIn(IJ.java)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: Can't load library: E:\Dropbox\NicoWork\JOGLFiji\Fiji.app\natives\windows-amd64\\nativewindow_awt.dll
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:287)
	... 5 more
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: E:\Dropbox\NicoWork\JOGLFiji\Fiji.app\natives\windows-amd64\\nativewindow_awt.dll
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:624)
	at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
	at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)
	at jogamp.nativewindow.NWJNILibLoader.access$000(NWJNILibLoader.java:39)
	at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:49)
	at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:41)
	at java.security.AccessController.doPrivileged(Native Method)
	at jogamp.nativewindow.NWJNILibLoader.loadNativeWindow(NWJNILibLoader.java:41)
	at jogamp.nativewindow.jawt.JAWTUtil.<clinit>(JAWTUtil.java:336)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:344)
	at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:340)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.nativewindow.NativeWindowFactory.initSingleton(NativeWindowFactory.java:340)
	at com.jogamp.newt.NewtFactory$1.run(NewtFactory.java:68)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.newt.NewtFactory.<clinit>(NewtFactory.java:65)
	at eu.kiaru.ij.JOGLWindowTest.<init>(JOGLWindowTest.java:30)
	at eu.kiaru.ij.MinJOGLIJCommand.run(MinJOGLIJCommand.java:39)
	at org.scijava.command.CommandModule.run(CommandModule.java:198)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:237)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	... 1 more

#6

Hey @NicoKiaru,

Did you try to set the scope of the dependencies to provided?

<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
<scope>provided</scope>

<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>
<scope>provided</scope>

This way, the jars shouldn’t be copied over during a mvn install. Hopefully the version you are depending on actually is the one provided by Fiji :worried:

Best,
Stefan


Sciview / Scenery graphics - first tests and first problems
#7

Hello @stelfrich

Thanks for the suggestion! I had a very good hope for this solution. Unfortunately this doesn’t work… There’s progress though : as expected, the jars are not copied thus Fiji do not ask me to replace the platform dependent jar with the general ones (see image above).

Regarding the version I do not specified it the Pom. If I believe what eclipse tells me, the version is inherited by the org.scijava pom file (eclipse warns me: “The managed version is 2.3.2 The artifact is managed in org.scijava:pom-scijava:16.2.0”).

The error I get again is:

[ERROR] Module threw error
java.lang.UnsatisfiedLinkError: Can't load library: E:\Dropbox\NicoWork\JOGLFiji\Fiji.app\natives\windows-amd64\\nativewindow_awt.dll
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:624)
	at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
	at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)
	at jogamp.nativewindow.NWJNILibLoader.access$000(NWJNILibLoader.java:39)
	at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:49)
	at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:41)
	at java.security.AccessController.doPrivileged(Native Method)
	at jogamp.nativewindow.NWJNILibLoader.loadNativeWindow(NWJNILibLoader.java:41)
	at jogamp.nativewindow.jawt.JAWTUtil.<clinit>(JAWTUtil.java:336)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:344)
	at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:340)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.nativewindow.NativeWindowFactory.initSingleton(NativeWindowFactory.java:340)
	at com.jogamp.newt.NewtFactory$1.run(NewtFactory.java:68)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.newt.NewtFactory.<clinit>(NewtFactory.java:65)
	at eu.kiaru.ij.JOGLWindowTest.<init>(JOGLWindowTest.java:30)
	at eu.kiaru.ij.MinJOGLIJCommand.run(MinJOGLIJCommand.java:39)
	at org.scijava.command.CommandModule.run(CommandModule.java:198)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:237)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

I’ve been struggling for a while now on this (see How to correctly write Ij2 plugins?). I suspect there’s some kind of customization that has been made in fiji to handle native libraries, and that this is conflicting the standard dependency deployement, but I’m not sure where this has been done and how to adapt my command into it.

PS : i pushed your modification to a branch tests in my github repository:
https://github.com/NicoKiaru/MinJOGLCmd/commit/a0e8f96af4cc9768fef0535dff4eef5988407327


#8

It startles me that the script works, but your Command doesn’t. For me, neither @imagejan’s script nor you command work as expected on Windows 10.


#9

Thanks again!
I think you’ve put your finger on something very interesting:

  • If I start Fiji, then launch @imagejan’s script directly, it works. If, without relaunching Fiji, I start my comand, it works as well!
  • If I start Fiji, then launch my command, I get the error already mentioned. If, with this initial error, I now try to launch @imagejan 's script, I get a new error :
Started New_.groovy at Tue Aug 15 14:28:37 CEST 2017
java.lang.UnsatisfiedLinkError: jogamp.nativewindow.windows.GDI.GetCurrentProcess()J
	at jogamp.nativewindow.windows.GDI.GetCurrentProcess(Native Method)
	at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory$WindowsProcessAffinity.set(WindowsWGLDrawableFactory.java:776)
	at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory.enterThreadCriticalZone(WindowsWGLDrawableFactory.java:244)
	at com.jogamp.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1873)
	at com.jogamp.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1843)
	at com.jogamp.opengl.GLProfile.access$000(GLProfile.java:80)
	at com.jogamp.opengl.GLProfile$1.run(GLProfile.java:230)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.opengl.GLProfile.initSingleton(GLProfile.java:216)
	at com.jogamp.opengl.GLProfile.getProfileMap(GLProfile.java:2297)
	at com.jogamp.opengl.GLProfile.get(GLProfile.java:988)
	at com.jogamp.opengl.GLProfile.get(GLProfile.java:1004)
	at com.jogamp.opengl.GLProfile$get.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at Script1.run(Script1.groovy:9)
	at org.scijava.plugins.scripting.groovy.GroovyScriptEngine.eval(GroovyScriptEngine.java:303)
	at org.scijava.plugins.scripting.groovy.GroovyScriptEngine.eval(GroovyScriptEngine.java:122)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:159)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:237)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

So my understanding is that the way groovy is looking for natives libraries is different from the way my ImageJ command is looking for natives. But if groovy has loaded the library correctly, then my command can use it, since it has already been correctly loaded.

Did you try to launch the script directly after starting Fiji?


#10

Oh, you are right!

  1. The loading of native libs is somehow achieved by using class loaders. Maybe, different class loaders are used?
  2. JOGL has a caching mechanism s.t. there are no loading issues after the script was executed successfully before

#11

I get a different error on my Linux machine:

com.jogamp.opengl.GLException: No default device available
	at com.jogamp.opengl.GLProfile.getProfileMap(GLProfile.java:2300)
	at com.jogamp.opengl.GLProfile.get(GLProfile.java:988)
	at com.jogamp.opengl.GLProfile.get(GLProfile.java:1004)
	at com.jogamp.opengl.GLProfile$get.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at Script5.run(Script5.groovy:10)
	at org.scijava.plugins.scripting.groovy.GroovyScriptEngine.eval(GroovyScriptEngine.java:303)
	at org.scijava.plugins.scripting.groovy.GroovyScriptEngine.eval(GroovyScriptEngine.java:122)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:159)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:237)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

#12

Jars on classpaths are different when you run as a script in Fiji v. run as a project in some IDE v. run as a command.

IIRC you need to use the system classpath to discover where the native libs are for this JOGL stuff. The solution is somewhere in Scenery or SciView, I forgot where we put it for now.

coughjustuseSciViewcough Volume rendering is working in OpenGL now which was one of the last major features that was needed. The full release is coming soon and snapshots are already available on the imagej maven.


#13

I knew you put some issues on purpose so that people have to use sciview :stuck_out_tongue_winking_eye:.

Seriously, no doubt I will switch to SciView once I have fixed other urgent buggy stuff. The reason I’d like to recycle a not-so-clean-viewer-of-my-own (for now) is because it is already too tightly integrated into other parts of a plugin I develop.

BUT, I’m preparing to migrate : for instance I use point cloud which can all exported into .ply files, a format that’s working with SciView.

PS : thanks for the amazing work on SciView :wink:
PS2 : I was also worried regarding natives deployement in general, since I will need to use a mavenized version of JCUDA, but I think it’s ok


#14

@NicoKiaru Since we link to JOGL, maybe you can load SciView/Scenery to solve your JOGL dependencies, but not actually use them. Might be a lazy hack solution…


#15

Sure, the lazier the better! But how should I do this ? Should I had a GAV into the pom file ? Is a GAV already in the ImageJ Maven Repository for SciView ?

Or do you mean merging your source with mine in eclipse ?

I’ll also have a look deeper into SciView.


#16

Maybe you can try:

<dependency> <groupId>sc.iview</groupId> <artifactId>sciview</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency>

Note that we don’t have a stable sciview release yet, but will before long.


#17

I did this:

https://github.com/NicoKiaru/MinJOGLCmd/commit/9b2a4f91ea7adf72e46cb043cd1c46dc70c5c0ef

I had to add some repositories for maven install, I hope they are the correct ones.
Unfortunately, upon fiji startup I get this error :

[ERROR] Cannot create plugin: class='sc.iview.ActiveSciViewPreprocessor', priority=0.0, enabled=true, pluginType=PreprocessorPlugin
java.lang.NoClassDefFoundError: graphics/scenery/SceneryDefaultApplication
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at sc.iview.ActiveSciViewPreprocessor.<init>(ActiveSciViewPreprocessor.java:31)
	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.module.DefaultModuleService.pre(DefaultModuleService.java:365)
	at org.scijava.module.DefaultModuleService.run(DefaultModuleService.java:184)
	at org.scijava.command.DefaultCommandService.run(DefaultCommandService.java:186)
	at org.scijava.command.DefaultCommandService.run(DefaultCommandService.java:169)
	at net.imagej.updater.DefaultUpdateService.onEvent(DefaultUpdateService.java:100)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.scijava.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:300)
	at org.scijava.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:274)
	at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)
	at org.scijava.event.DefaultEventBus.access$101(DefaultEventBus.java:56)
	at org.scijava.event.DefaultEventBus$1.run(DefaultEventBus.java:190)
	at org.scijava.thread.DefaultThreadService$2.run(DefaultThreadService.java:220)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: graphics.scenery.SceneryDefaultApplication
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 51 more

Ant I suspect this may prevent the loading of JOGL libraries. Thus I get the same unsatisfied link error.


#18

I found this:

I’ll have a closer look.


#19

Upps, it should work to link to SciView now (updated snapshot on maven). It can get a little messy since we’re working from snapshots of both Scenery and SciView at the moment, and I hadn’t pushed the latest SciView to master.


#20

Thanks!

I just tried it, and I didn’t get the error on Fiji startup anymore!
However this still doesn’t work. I get this error when launching my Command:

[ERROR] Module threw error
java.lang.NoClassDefFoundError: com/jogamp/opengl/GLCapabilitiesImmutable
	at eu.kiaru.ij.MinJOGLIJCommand.run(MinJOGLIJCommand.java:39)
	at org.scijava.command.CommandModule.run(CommandModule.java:198)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:237)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.jogamp.opengl.GLCapabilitiesImmutable
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 10 more

I honeslty didn’t know this native thing could be so complicated…

Updated commit (removes GLEventListener which was also sending a sort of NoClassDefFoundError :

https://github.com/NicoKiaru/MinJOGLCmd/commit/0edcf578b4f7c2954dea089dc50749ae83d2f90d

I was also thinking, is there a way to launch programmatically a groovy script ? I could thus execute @imagejan’s script just to load the library before any other command?