Closed tferr closed 8 years ago
@tferr
pom-fiji
version to the latest (21.4.0)DefaultGCD
op so that it extends AbstractOp
:-public class DefaultGCD implements BAR.GCD {
+public class DefaultGCD extends AbstractOp implements BAR.GCD {
BAR
namespace to work in Scripts, we to release the fix I just committed to correct namespace population.With these changes everything is working in my local Fiji :smile:
@hinerm Thanks a lot! I will wait for the new imagej-ops release.
Hi @hinerm,
Just did your proposed changes:
DefaultGCD
to extend AbstractOp
)I then updated the Maven Project, but I still get the same error. Any ideas?
@hinerm,
All is great! Sorry for the noise, it does work despite the annoying Type mismatch: cannot convert from Class<Namespace> to Class<? extends SciJavaPlugin>
error in Eclipse.
Any idea what is causing it/ how can it be silenced?
Anyway: I've updated the wiki page to reflect the new changes. I've also add some GitHub links so there are always permanent URLs to the latest code and a short description to the script template.
Thanks a lot for doing all this. It is great to see how everything gets so well integrated. The thew bar Op even appears on the Ops Browser! And sincere apologies for not looking into it earlier. I do hope to have enough time to look into extending this further.
@hinerm, Not so sure what is going on here. I thought this was solved, and pushed the new version to the update site. However, on a clean Fiji install subscribed to the BAR update site, running GCD.py [Templates >BAR>GCD (Python)] from the Script Editor fails:
[ERROR] Cannot create plugin: class='bar.BAR', priority=0.0, enabled=true, pluginType=Namespace
java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from Class<Namespace> to Class<? extends SciJavaPlugin>
at bar.BAR.<init>(BAR.java:12)
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.AbstractPTService.create(AbstractPTService.java:68)
at net.imagej.ops.DefaultNamespaceService.create(DefaultNamespaceService.java:53)
at net.imagej.ops.NamespacePreprocessor.assignNamespace(NamespacePreprocessor.java:76)
at net.imagej.ops.NamespacePreprocessor.process(NamespacePreprocessor.java:62)
at org.scijava.module.ModuleRunner.preProcess(ModuleRunner.java:104)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:156)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)
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)
[ERROR] Module threw exception
java.lang.NullPointerException
at net.imagej.ops.DefaultNamespaceService.create(DefaultNamespaceService.java:54)
at net.imagej.ops.NamespacePreprocessor.assignNamespace(NamespacePreprocessor.java:76)
at net.imagej.ops.NamespacePreprocessor.process(NamespacePreprocessor.java:62)
at org.scijava.module.ModuleRunner.preProcess(ModuleRunner.java:104)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:156)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)
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)
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at net.imagej.ui.swing.script.TextEditor.evalScript(TextEditor.java:2346)
at net.imagej.ui.swing.script.TextEditor.access$1000(TextEditor.java:151)
at net.imagej.ui.swing.script.TextEditor$20.execute(TextEditor.java:1937)
at net.imagej.ui.swing.script.TextEditor$Executer$1.run(TextEditor.java:1749)
Caused by: java.lang.NullPointerException
at net.imagej.ops.DefaultNamespaceService.create(DefaultNamespaceService.java:54)
at net.imagej.ops.NamespacePreprocessor.assignNamespace(NamespacePreprocessor.java:76)
at net.imagej.ops.NamespacePreprocessor.process(NamespacePreprocessor.java:62)
at org.scijava.module.ModuleRunner.preProcess(ModuleRunner.java:104)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:156)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)
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)
Any suggestions?
@tferr
Type mismatch: cannot convert from Class
to Class<? extends SciJavaPlugin>
there is a problem with BAR's annotation.. just like you saw in eclipse.. so I think it's not being annotated and thus not found by the Namespace
service. I am confused as to what's actually going on, though.
I also don't see the warning in eclipse.. you imported BAR as a Maven project? I wonder if it's my own error/warning settings...
OK @tferr so it looks like your jar was corrupted by being confused and picking up Eclipse classes.
To avoid this kind of corruption, I set up a Jenkins job for BAR. It can now deploy SNAPSHOT and RELEASE artifacts to the ImageJ maven repo (where you can download them for upload to your update site)
If you add a webhook to this repo Jenkins will build it automatically with each push. Then you can use the double push to master method of releasing new versions (note that you currently need to change your pom.xml version back to a SNAPSHOT)
Wow, this is superb.
mvn clean; mvn eclipse:clean eclipse:eclipse
Did it. Although 10 minutes later Eclipse started to complain about missing imports (on an unrelated class) even if the imports were properly declared. Eclipse is a beast. I guess I'll just keep running the command above every half an hour!
@hinerm Seriously, thanks a lot for looking into it. Just uploaded the new version to the update site and everything works as expected.
Next time at The Old Fashioned, its on me! 🍻
Closing this as all seems to be working now
@hinerm First of all thank you so much for all of your work in creating the first BAR Op!!, the tutorials and the wiki page. Impressive! Second, I am really sorry for not looking into it earlier. Simply other stuff got in the way. Third, I have to apologize also for merging your changes into my master branch in rather clumsy way. Anyway, just for reference, these are the relevant changes you introduced:
However, I get the following error in BAR.java:
Type mismatch: cannot convert from Class<Namespace> to Class<? extends SciJavaPlugin>
When I try to run CGD.py, I get a
java.lang.Error: Unresolved compilation problem:
in Fiji's console.I've tried all of Ecliple Mars Quick Fix suggestions without success. Any ideas?