Create account / Log in

NoClassDefFoundError for DigestUtils

Discussion area for the development team.

Moderators: uckelman, Tim M

Re: NoClassDefFoundError for DigestUtils

Postby Flint1b » July 19th, 2020, 1:53 pm

What we could do - package everything in a "uber-jar", using the Maven Shade Plugin: https://maven.apache.org/plugins/maven-shade-plugin/

This would lower the chance of the user messing up the installation by deleting/replacing/breaking single jars.

I have no idea whether this would fix this particular bug though. No way to reproduce, no way to test.
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: NoClassDefFoundError for DigestUtils

Postby uckelman » July 19th, 2020, 1:54 pm

Thus spake Flint1b:
>
> "Hello, you reported a bug in Vassal 8 years ago,

I've written that email quite a few times, in fact.

Would someone else like to put their hand up to take this issue and
contact the users for details? (Note that several of the reports are
fairly recent. The point of citing the old ones was to note that they've
persisted across time.)

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8985
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: NoClassDefFoundError for DigestUtils

Postby stew-rt » July 19th, 2020, 8:24 pm

I'm not confidant enough to contact users for remote sessions, but I spent about 2 hours today on my Windows VM trying to break it.. and I only managed to produce this output by exclusively deleting (or making unavailable, via permissions) "lib\commons-codec-1.13.jar", I tried the following:
* LOTS of dodgy JAVA_HOME and JRE_HOME environment variables. (even tried CLASSPATH directly to an old jar) - and adding a dir with the old JAR to PATH
* placing the old version(s) of the lib which is missing this class in the "lib\" dir
* placing the old version of the lib into $JAVA_HOME/lib/
* placing the old version of the lib into $JAVA_HOME/lib/ext/
* installing Java 1.8 (via the Oracle installer) and trying all the above again
* adding JAVA_HOME and JRE_HOME registry keys
* renaming old versions of the jar to the new one (this resulted in a crash, but different, java realised I'd done this, because the metadata didn't match and refused to load it)

For what it's worth (as essentially an outsider), I don't see a disadvantage to the uber-jar using Maven Shade, as I can't think of any benefits from the supporting libraries being distinct jar files...
User avatar
stew-rt
 
Posts: 23
Joined: May 22nd, 2020, 8:27 am
Location: Cornwall, UK

Re: NoClassDefFoundError for DigestUtils

Postby uckelman » July 19th, 2020, 9:03 pm

Thus spake stew-rt:
> I'm not confidant enough to contact users for remote sessions, but I
> spent about 2 hours today on my Windows VM trying to break it..

Thanks for taking a look.

I wasn't expecting anyone to contact users for _remote sessions_, just
to contact the users and ask them if they're still having the problem,
and if the problem is repeatable. If so, then do some basic investigation,
like have them check if any JARs are missing.

> I only managed to produce this output by exclusively deleting (or making
> unavailable, via permissions) "lib\commons-codec-1.13.jar", I tried the
> following:
> * LOTS of dodgy JAVA_HOME and JRE_HOME environment variables. (even
> tried CLASSPATH directly to an old jar) - and adding a dir with the old
> JAR to PATH
> * placing the old version(s) of the lib which is missing this class in
> the "lib\" dir
> * placing the old version of the lib into $JAVA_HOME/lib/
> * placing the old version of the lib into $JAVA_HOME/lib/ext/
> * installing Java 1.8 (via the Oracle installer) and trying all the
> above again
> * adding JAVA_HOME and JRE_HOME registry keys
> * renaming old versions of the jar to the new one (this resulted in a
> crash, but different, java realised I'd done this, because the metadata
> didn't match and refused to load it)

Good things to have checked.

> For what it's worth (as essentially an outsider), I don't see a
> disadvantage to the uber-jar using Maven Shade, as I can't think of any
> benefits from the supporting libraries being distinct jar files...

A disadvantage is that it's a dependency we don't have right now, which
solves a problem we may not actually have.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8985
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: NoClassDefFoundError for DigestUtils

Postby Flint1b » July 19th, 2020, 10:05 pm

uckelman wrote:A disadvantage is that it's a dependency we don't have right now, which solves a problem we may not actually have.


It would only be a build-time dependency, it wouldn't get into the final product, and we already have various maven plugins, one more won't hurt. I understand the worry about having too many dependencies, but if maven is already in use, the amount of maven plugins is usually of no concern as long as they help getting the job done.

Having the whole application including all its dependencies in a single .jar is often very convenient, it protects the bundle from being messed with, from single .jars ending up in the wrong place, from the user accidentally deleting one of them etc.

Even in the enterprise backend java world, life became much easier since we were able to package our applications as single .jar files including the embedded application server. The operations teams loved not having to maintain a running tomcat server anymore and have long phone calls with us about whose particular app took down the whole app server.
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Previous

Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests