Error with SciJava services / context creation

Hi SciJava folks,
hi @imagejan and @ctrueden

I recently see error messages like the one below more and more often. However I don’t work with tables at all. I just open images and start clij and see this error message.

Would it be possible to hide those windows until I really do something with tables?

If I do something wrong in CLIJ, e.g. here. I’m happy to hear suggestions.

Thanks!

Best,
Robert

[ERROR] Cannot create plugin: class='org.scijava.table.DefaultTableIOPlugin', priority=-100.0, enabled=true, pluginType=IOPlugin
[ERROR] Invalid service: class='org.scijava.table.io.DefaultTableIOService', priority=0.0, enabled=true, pluginType=Service
org.scijava.InstantiableException: Class not found: org.scijava.table.io.DefaultTableIOService
	at org.scijava.plugin.PluginInfo.loadClass(PluginInfo.java:290)
	at org.scijava.service.ServiceHelper.findServiceClasses(ServiceHelper.java:368)
	at org.scijava.service.ServiceHelper.<init>(ServiceHelper.java:118)
	at org.scijava.Context.<init>(Context.java:276)
	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.haesleinhuepf.clij.CLIJ.convert(CLIJ.java:467)
	at net.haesleinhuepf.clij.CLIJ.push(CLIJ.java:406)
	at net.haesleinhuepf.clij.CLIJ.pushCurrentZStack(CLIJ.java:504)
	at net.haesleinhuepf.clij2.CLIJ2.pushCurrentZStack(CLIJ2.java:101)
	at net.haesleinhuepf.spimcat.io.CLIJxVirtualStack.imagePlusToBuffer(CLIJxVirtualStack.java:137)
	at net.haesleinhuepf.clijx.assistant.AssistantGUIStartingPoint.refresh(AssistantGUIStartingPoint.java:84)
	at net.haesleinhuepf.clijx.assistant.AssistantGUIStartingPoint.run(AssistantGUIStartingPoint.java:57)
	at net.haesleinhuepf.clijx.assistant.utilities.AssistantStartingPointTool$1.eventOccurred(AssistantStartingPointTool.java:24)
	at ij.IJ.notifyEventListeners(IJ.java:2444)
	at ij.gui.Toolbar.setTool2(Toolbar.java:840)
	at ij.gui.Toolbar.mousePressed(Toolbar.java:1070)
	at java.awt.Component.processMouseEvent(Component.java:6536)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	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:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	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.IllegalArgumentException: Cannot load class: org.scijava.table.io.DefaultTableIOService
	at org.scijava.util.Types.iae(Types.java:975)
	at org.scijava.util.Types.load(Types.java:234)
	at org.scijava.plugin.PluginInfo.loadClass(PluginInfo.java:284)
	... 39 more
Caused by: java.lang.NoClassDefFoundError: org/scijava/io/TypedIOService
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	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:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	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:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.scijava.util.Types.load(Types.java:226)
	... 40 more
Caused by: java.lang.ClassNotFoundException: org.scijava.io.TypedIOService
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 66 more
Buffer [Lnet.haesleinhuepf.clij.clearcl.ClearCLBuffer;@6f1aafbf
Buffer[0]  ClearCLBuffer [mClearCLContext=ClearCLContext [device=ClearCLDevice [mClearCLPlatform=ClearCLPlatform [name=Intel(R) OpenCL HD Graphics], name=Intel(R) UHD Graphics]], mNativeType=UnsignedByte, mNumberOfChannels=1, mDimensions=[1376, 1032], getMemAllocMode()=Best, getHostAccessType()=ReadWrite, getKernelAccessType()=ReadWrite, getBackend()=net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL@58c4404f, getPeerPointer()=net.haesleinhuepf.clij.clearcl.ClearCLPeerPointer@15e7fd70]
Buffer[0] pointer net.haesleinhuepf.clij.clearcl.ClearCLPeerPointer@15e7fd70
Buffer slice net.haesleinhuepf.clij.clearcl.ClearCLPeerPointer@2f3adf24
Channel 0
Attach menu
Menu attached
Set Auto
Set Auto
Fileinfo: 
name=Untitled, dir=, width=1376, height=1032, nImages=1, offset=0, gap=0, type=byte, byteOrder=big, format=0, url=, whiteIsZero=f, lutSize=256, comp=1, ranges=null, samples=1
[ERROR] Invalid service: class='org.scijava.table.io.DefaultTableIOService', priority=0.0, enabled=true, pluginType=Service
org.scijava.InstantiableException: Class not found: org.scijava.table.io.DefaultTableIOService
	at org.scijava.plugin.PluginInfo.loadClass(PluginInfo.java:290)
	at org.scijava.service.ServiceHelper.findServiceClasses(ServiceHelper.java:368)
	at org.scijava.service.ServiceHelper.<init>(ServiceHelper.java:118)
	at org.scijava.Context.<init>(Context.java:276)
	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.haesleinhuepf.clijx.assistant.services.CLIJMacroPluginService.<init>(CLIJMacroPluginService.java:14)
	at net.haesleinhuepf.clijx.assistant.services.CLIJMacroPluginService.getInstance(CLIJMacroPluginService.java:31)
	at net.haesleinhuepf.clijx.assistant.services.SuggestionService.<init>(SuggestionService.java:61)
	at net.haesleinhuepf.clijx.assistant.services.SuggestionService.getInstance(SuggestionService.java:109)
	at net.haesleinhuepf.clijx.assistant.AssistantGUIStartingPoint.run(AssistantGUIStartingPoint.java:67)
	at net.haesleinhuepf.clijx.assistant.utilities.AssistantStartingPointTool$1.eventOccurred(AssistantStartingPointTool.java:24)
	at ij.IJ.notifyEventListeners(IJ.java:2444)
	at ij.gui.Toolbar.setTool2(Toolbar.java:840)
	at ij.gui.Toolbar.mousePressed(Toolbar.java:1070)
	at java.awt.Component.processMouseEvent(Component.java:6536)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	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:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	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.IllegalArgumentException: Cannot load class: org.scijava.table.io.DefaultTableIOService
	at org.scijava.util.Types.iae(Types.java:975)
	at org.scijava.util.Types.load(Types.java:234)
	at org.scijava.plugin.PluginInfo.loadClass(PluginInfo.java:284)
	... 37 more
Caused by: java.lang.NoClassDefFoundError: org/scijava/io/TypedIOService
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	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:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	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:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.scijava.util.Types.load(Types.java:226)
	... 38 more
Caused by: java.lang.ClassNotFoundException: org.scijava.io.TypedIOService
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 64 more

In the line you linked:

… you’re creating a Context limited to CLIJConverterService and no other services. Instead of creating a new context (you could also use new Context() without arguments to get all services available at runtime), I’d recommend getting the actual Context of your Fiji instance using something like:

(Maybe these few lines should be ported to a utility function in imagej-legacy??)


Nevertheless, I don’t think the suggestions above will solve your issue.

Your error message (if you scroll down all the way) is caused by:

java.lang.ClassNotFoundException: org.scijava.io.TypedIOService

… which suggests some version skew in your installation, since TypedIOService was added by @frauzufall here:

… and released with scijava-common-2.84.0 and later. Can you check your runtime version of scijava-common?

3 Likes

Yes, I think so, too. But my ImageJ appears up to date. In this screenshot you see I use scihava-common-2.83.3 as current on the update site. You also see a related error messag in the background which pops up when I start Fiji:

Thanks for the hint Jan. As you know, we’re talking about a library which also runs in ImageJ, Icy, Matlab and QuPath. None of those has a Fiji instance. So I think I stay with the new Context() for now. It is supposed to work the way I use it, right?

2 Likes

Ok, I fixed it. I had local changes of scijava-table installed by maven I assume.

So the error is likely related to my local changes:

After overwriting these three with the current versions from the update sites, the errors are gone.

Thanks for the headsup @imagejan !

3 Likes