Update site upload attempt throws unrelated dependency error

Hi all,

In attempting to update the bigwarp version on the Java-8 update site, I ran into the following:

Error: plugins/Trainable_Segmentation-3.2.2.jar
Depends on jars/imagescience.jar which is about to be removed.

which seems strange, as I have not touched Trainable_Segmentation or imagescience.
@ctrueden, @iarganda in particular - do you know what might be causing this?

Many thanks,
John

That dependency was marked as optional, I don’t know why it is still there…

The messages from the Updater in circumstances like this are a bit misleading. jars/imagescience.jar was not “about to be removed”—it was already removed. What the Updater means here is that it discovered a JAR which depends on something that is not present, and it’s warning about it. We should change the Updater’s message to be more correct and clear here.

Anyway, you can ignore it. Or you could fix it by editing the dependencies of Trainable_Segmentation. (And here I mean the Updater’s dependency list on the right-hand pane, not the POM.) Like @iarganda says, the imagescience dependency is optional, and should probably just be excluded from the Updater’s knowledge altogether since the Updater does not really support optional deps.

1 Like

It seems I had to put it back. I guess it can be removed now (from the pom)?

1 Like

Thanks for the quick reply you guys!

i.e. select “Break the dependency”?

After this, that error window no longer appeared. Thanks again! :slight_smile:

1 Like

On the Maven side, yes you had to put the version back because it is no longer managed in the parent POM.

As to whether you can remove the dependency itself: does TWS make explicit (compile-time) references to those classes, or not?

Well, you made the trick to check if ImageScience was present in running time. But if I remove the dependency from the pom, the helper class does not compile.

Sorry, I know. But I am madly scrambling to catch up on email, forums, etc., and didn’t want to take time to check the code. Thank you for the direct link. I see from the code that it does use compile-time linkage, so yes, you need the (optional!) dependency declared in the POM. The alternative (which we should not do here) would be to use Java reflection to load the ImageScience classes dynamically at runtime, in which case the POM would not need the explicit dependency. Leaning on the compiler is much better though because it checks our ImageScience API usage for correctness, and we can also still write unit tests against it that will run at test time.

Anyway, TL;DR: leave the optional dependency in the POM!

1 Like

@ctrueden,
Sorry to be a bother. Now, while there is no error, after typing in my password, nothing seems to happen (no messages). I’m likely doing something else wrong…

@bogovicj This happens repeatably? After restarting Fiji?

Checking the remote, bigwarp_fiji is indeed still at 2.1.2, from 2016-05-16. So it seems your upload did not go through.

There are no server-side errors either, so your credentials were presumably entered correctly.

Maybe the JAR has no different .class files in it than before? I don’t think that should be a problem if so, though…

You have successfully uploaded many times in the past, yeah?

There should indeed be changes to .class files, but will double check since the changes were minor indeed
( added a method that does nothing, and removed imports that were unused ).

I believe this has worked for me in the past, but its been a long time, and is possible that Stephan and I uploaded together (with his creds).

Class files do differ and problem persists after Fiji restart.

Aha, that was the culprit: you did not have permission to upload to the Java-8 site as Bogovic. I have now remedied that… try again?

Thanks! Still no luck though - I just recently changed my uploader password here, so hopefully that should not be an issue.

Same behavior? No reprompt for user/pass, but then it just hangs with nothing happening?

You are using Bogovic for the username, right?

Still no errors in the server logs, although the sites.imagej.net error log is suspiciously empty… investigating now. Edit: all is fine with the error logs. There were legitimately no errors for the past two days—until I forced one just now. :wink:

Edit 2: In case this somehow helps, I removed the imagescience dependency from Trainable_Segmentation on the server side, by editing db.xml.gz. So you should not receive that warning anymore.

Looks like I just wasn’t waiting long enough, message came back with "Bogovic does not have permissions…"
after awhile. Restarted Fiji and am trying again…

weird.

“User Bogovic lacks upload permissions for http://sites.imagej.net/Java-8/”

Edit: “Directory on Host” for the update site should be “./”, right?

Host: webdav:Bogovic
Directory on Host: ./

I don’t think the “Directory on Host” actually really matters, but I haven’t tested any other values.