[Mifos-developer] IllegalStateException: Unable to open nested compressed entry WEB-INF/lib/extension-0.0.1-SNAPSHOT.jar

613 views
Skip to first unread message

Michael Vorburger

unread,
Oct 8, 2014, 5:59:45 PM10/8/14
to Avik Ganguly, Developer
Hi Avik,

out of curiosity, I've just researched about that problem (below) which you reached out to my on Skype about earlier today when I had to run into a meeting for my day job and cut short, about how implementation partners specialists could add their own JAR which extend some Mifos API to the (now executable) WAR - and I think I now understand what's causing this for you:


Basically, the bottom line seems to be that one cannot just manually drop "any" JAR into WEB-INF/lib of the new executable WAR format using something like WinZip... you have to either use a "real" build (via Spring Boot's gradle or Maven plug-in, which take care of this and do the correct compression of JARs), or you have to manually fix the JAR to use no compression (?). Or use such manually hacked WARs on good ol' Tomcat instead of executable java -jar mifos*.war.

Personally I don't like people hacking archives built by tools, anyway. We should come up with a more robust mechanism - there should be a kind of dropins/ or ext/ or something folder, at a configurable location, say by default in a so named folder next to the executable WAR, which we add the the classpath... hm. Perhaps something like this already exists. I don't suppose anyone is willing to look into this further? (I'm unlikely to have time in the coming weeks.)

Best,
Michael

java -jar mifos*.war
java.lang.IllegalStateException: Unable to open nested compressed entry WEB-INF/lib/extension-0.0.1-SNAPSHOT.jar
at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:378)
at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:355)
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:341)
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:108)
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:92)
at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:68)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:60)
at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:80)
_______________________
Michael Vorburger
http://www.vorburger.ch

Markus Geiß

unread,
Oct 9, 2014, 12:38:26 AM10/9/14
to Mifos software development, Avik Ganguly
Hey Avik and Michael,

maybe this could be a solution:


see here on how to integrate with Spring ...


I was thinking about using this for our future modules/extension concept but didn't find the time to start a spike.

Cheers



Markus Geiss
Senior Software Engineer | Architect
YAGNI likes a DRY KISS

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
Mifos-developer mailing list
mifos-d...@lists.sourceforge.net
Unsubscribe or change settings at:
https://lists.sourceforge.net/lists/listinfo/mifos-developer

Avik Ganguly

unread,
Oct 9, 2014, 2:31:58 AM10/9/14
to Markus Geiß, Michael Vorburger, Mifos software development, Avik Ganguly
Hi Michael and Markus,

@Michael : I apologize for not giving the pretext -  I was trying spring-plugin and Java Simple Plugin Framework. Spring-plugin simply expects the plugins to be available in the classpath but JSPF can load external jar files by trying different loaders under the hood, has a Jar Cache to make sure there is no performance issue and does some kind of cleanup during shutdown (but JSPF is not available in any central repositories, does not have an order aware plugin registry and requires integration with Spring.) Spring DM(Gemini Blueprint) and Apache Aries put me off with all the talk about a separate OSGi container.

The problem was the requirement is drop a jar and spring picks it up during startup so no build process involved; and uncompressed jar(jar -cvf0(0 for uncompressed)) throws the compressed entry error. The initial extension jar(produced through gradle jar or jar tool) works if it goes through the build process but not if placed manually and there is no visual difference upon inspection of jar contents, size and properties between the jar transformed(?) by the build(which works) and the original jar.


@Markus : That is exactly what I was looking for. Thanks. Something must be seriously wrong with my Google search criteria skills. It will solve the issue of no tampering with the QA certified war.

Thanks again,
Avik.

Markus Geiß

unread,
Oct 9, 2014, 3:44:23 AM10/9/14
to Avik Ganguly, Mifos software development, Avik Ganguly
Hey Avik,

we should not rely on Spring DM b/c the stopped further development last year and won't support it wit 4.x and later releases.

I'm sure we'll be good with JPF and the Spring integration. You may could add the default behavior to the Mifos platform so it'll be available in future releases for all integrators and we simply write a simple How To guide.

Cheers


Markus Geiss
Senior Software Engineer | Architect
YAGNI likes a DRY KISS

Reply all
Reply to author
Forward
0 new messages