Cofoja and Java 9 - known issues?

117 views
Skip to first unread message

David Squire

unread,
Apr 17, 2018, 1:29:51 AM4/17/18
to cofoja
I have given students in my classes the option of using cofoja. I am getting reports of problems from some students using a Java 9 runtime, for projects I configured and tested using Java 8. Here is an example of the output:

[com.google.java.contract:agent FATAL ERROR while instrumenting BankAccount (stack trace follows)]

java.lang.IllegalArgumentException

at org.objectweb.asm.ClassReader.<init>(Unknown Source)

at org.objectweb.asm.ClassReader.<init>(Unknown Source)

at org.objectweb.asm.ClassReader.<init>(Unknown Source)

at com.google.java.contract.core.agent.ContractClassFileTransformer.analyze(ContractClassFileTransformer.java:354)

at com.google.java.contract.core.agent.ContractClassFileTransformer.transform(ContractClassFileTransformer.java:267)

at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)

at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)

at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:550)

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007)

at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)

at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:801)

at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:699)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:622)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)

at java.base/java.lang.Class.getDeclaredMethods0(Native Method)

at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3139)

at java.base/java.lang.Class.getMethodsRecursive(Class.java:3280)

at java.base/java.lang.Class.getMethod0(Class.java:3266)

at java.base/java.lang.Class.getMethod(Class.java:2063)

at java.base/sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:710)

at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:569)


This was using jdk-9.0.4.jdk on a Mac, with Eclipse Oxygen, and cofoja-1.3-20160207.jar

Is this a known issue?

Everything seems to be working just fine for Java 8.

Regards,

David

Nhat Minh Lê

unread,
Apr 17, 2018, 2:58:33 AM4/17/18
to Cofoja
Hi,

I haven't gotten around to trying Cofoja with Java 9 yet, but I'd suggest the first thing would be to try to run Cofoja with a more recent version of ASM in case the bytecode format/instrumentation changed in some way.

Best,
Nhat

--
You received this message because you are subscribed to the Google Groups "cofoja" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cofoja+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Squire

unread,
Apr 17, 2018, 4:04:13 AM4/17/18
to cofoja
Can you point me to a jar for that?
To unsubscribe from this group and stop receiving emails from it, send an email to cofoja+un...@googlegroups.com.

Nhat Minh Lê

unread,
Apr 18, 2018, 1:25:56 PM4/18/18
to Cofoja
You can use the unbundled JAR file for Cofoja which doesn't include ASM and then put a more recent version of ASM in the classpath, and it might or might not work, but it's worth a try.

Otherwise I'll have a look this week-end see if I can build a bundled JAR with an updated library and test it against Java 9; I changed my development machine since the last time I worked on Cofoja so this'll have to wait until I get some time to set things up again. In the meantime, you can try the unbundled setup above, or compiling Cofoja yourself if you have Ant, it's fairly easy; just put the libs in lib and/or run Ivy, then run Ant.

Nhat

To unsubscribe from this group and stop receiving emails from it, send an email to cofoja+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages