Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with java.lang.ExceptionInInitializerError #107

Open
seanabraham opened this issue Sep 26, 2017 · 2 comments
Open

Build fails with java.lang.ExceptionInInitializerError #107

seanabraham opened this issue Sep 26, 2017 · 2 comments

Comments

@seanabraham
Copy link

seanabraham commented Sep 26, 2017

I've seen many builds fail nondeterministically (with multiple modules and gradle running in parallel mode) with the following error:

error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider icepick.processor.IcepickProcessor could not be instantiated: java.lang.ExceptionInInitializerError

A cursory look through IcepickProcessor.java makes me think that there's potentially a race condition introduced because of the changing of classloaders. Thoughts, @frankiesardo?

@seanabraham
Copy link
Author

I've seen this in multiple build systems actually, both Gradle and Buck. Here's are some stacktrace frames:

Caused by: java.lang.ExceptionInInitializerError
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at clojure.lang.RT.classForName(RT.java:2154)
	at clojure.lang.RT.classForName(RT.java:2163)
	at clojure.lang.RT.loadClassForName(RT.java:2182)
	at clojure.lang.RT.load(RT.java:436)
	at clojure.lang.RT.load(RT.java:412)
	at clojure.core$load$fn__5448.invoke(core.clj:5866)
	at clojure.core$load.doInvoke(core.clj:5865)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invoke(core.clj:5671)
	at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
	at clojure.core$load_lib.doInvoke(core.clj:5710)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invoke(core.clj:632)
	at clojure.core$load_libs.doInvoke(core.clj:5749)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invoke(core.clj:634)
	at clojure.core$use.doInvoke(core.clj:5843)
	at clojure.lang.RestFn.invoke(RestFn.java:436)
	at stencil.parser$loading__5340__auto____127.invoke(parser.clj:1)
	at stencil.parser__init.load(Unknown Source)
	at stencil.parser__init.<clinit>(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
...

which eventually yields:


Caused by: java.lang.IllegalStateException: zip file closed
--
  | at java.util.zip.ZipFile.ensureOpen(ZipFile.java:669)
  | at java.util.zip.ZipFile.getEntry(ZipFile.java:309)
  | at java.util.jar.JarFile.getEntry(JarFile.java:240)
  | at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:128)
  | at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:132)
  | at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89)
  | at clojure.lang.RT.lastModified(RT.java:388)
  | at clojure.lang.RT.load(RT.java:427)
  | at clojure.lang.RT.load(RT.java:412)
  | at clojure.core$load$fn__5448.invoke(core.clj:5866)
  | at clojure.core$load.doInvoke(core.clj:5865)
  | at clojure.lang.RestFn.invoke(RestFn.java:408)
  | at clojure.pprint__init.load(Unknown Source)
  | at clojure.pprint__init.<clinit>(Unknown Source)
  | ... 160 more

@seanabraham
Copy link
Author

This Stackoverflow post further suggests this issue may manifest from how the classloaders are manipulated in IcepickProcess.java: https://stackoverflow.com/questions/22582962/illegalstateexception-zip-file-closed-during-file-write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant