"java.io.IOException: Class not found" when scan suspendable

544 views
Skip to first unread message

Gary Wu

unread,
Dec 30, 2015, 4:37:54 AM12/30/15
to quasar-pulsar-user
I am using quasar 0.7.3 in my project.  When I try to scan suspendable in ant task for one gradle sub project I got following error:


17:23:38.721 [ERROR] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:scanSuspendables] java.io.IOException: Class not found
java.lang.RuntimeException: java.io.IOException: Class not found
at co.paralleluniverse.fibers.instrument.SuspendablesScanner.run(SuspendablesScanner.java:218)
at co.paralleluniverse.fibers.instrument.SuspendablesScanner.execute(SuspendablesScanner.java:134)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor540.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at groovy.util.AntBuilder.performTask(AntBuilder.java:319)
......
Caused by: java.io.IOException: Class not found
at co.paralleluniverse.asm.ClassReader.a(Unknown Source)
at co.paralleluniverse.asm.ClassReader.<init>(Unknown Source)
at co.paralleluniverse.fibers.instrument.SuspendablesScanner$2.visit(SuspendablesScanner.java:230)
at co.paralleluniverse.common.reflection.ClassLoaderUtil.scanJar(ClassLoaderUtil.java:180)
at co.paralleluniverse.common.reflection.ClassLoaderUtil.scanFrom(ClassLoaderUtil.java:130)
at co.paralleluniverse.common.reflection.ClassLoaderUtil.accept(ClassLoaderUtil.java:111)
at co.paralleluniverse.common.reflection.ClassLoaderUtil.accept(ClassLoaderUtil.java:102)
at co.paralleluniverse.fibers.instrument.SuspendablesScanner.scanExternalSuspendables(SuspendablesScanner.java:223)
at co.paralleluniverse.fibers.instrument.SuspendablesScanner.run(SuspendablesScanner.java:187)
... 104 more

I've confirmed the class file is actually generated, anyone have any idea how to solve this issue, Thanks so much.

I am using following in build.gradle which I suppose is correct according to the quasar doc.
classes {
doFirst {
ant.taskdef(name: 'scanSuspendables',
classname: 'co.paralleluniverse.fibers.instrument.SuspendablesScanner',
classpath: "build/classes/main:build/resources/main:${configurations.runtime.asPath}")
ant.scanSuspendables(auto: false,
suspendablesFile: "$sourceSets.main.output.resourcesDir/META-INF/suspendables",
supersFile: "$sourceSets.main.output.resourcesDir/META-INF/suspendable-supers",
append: true) {
fileset(dir: sourceSets.main.output.classesDir)
}
}
}

Fabio Tudone

unread,
Dec 30, 2015, 6:38:08 AM12/30/15
to quasar-pulsar-user
I got similar error at times, they went away after clearing Gradle dirs named ".gradle" in the project's dir and/or in the user's home (better check that you don't have any important settings / other things in there before doing so).

Let me know if it helps.

-- Fabio

Gary Wu

unread,
Dec 30, 2015, 7:27:06 AM12/30/15
to quasar-pulsar-user
Thanks Fabio. It works!

So looks like it is gradle's cache which lead to such issue.

在 2015年12月30日星期三 UTC+8下午7:38:08,Fabio Tudone写道:

Fabio Tudone

unread,
Dec 30, 2015, 8:46:24 AM12/30/15
to quasar-pulsar-user
Glad it does, yes it seems so (but I don't know why).
Reply all
Reply to author
Forward
0 new messages