On Aug 23, 2006, at 2:56 PM, Torsten Curdt wrote:
On running the javaflow transformation task, I get the following
exception:
/Users/mdeluigi/SourceCode/build.xml:114:
org.apache.bcel.verifier.exc.AssertionViolatedException: INTERNAL
ERROR: Missing class: java.lang.ClassNotFoundException: Exception
while looking for class edu.ethz.cs.smp.database.Config:
java.io.IOException: Couldn't find: edu/ethz/cs/smp/database/
Config.class
The class file is right there. The exception is only with this class.
If I uncomment the usage, everything works fine.
Is it a bug or did I miss something?
Sounds like a BCEL bug ...can you please provide a testcase?
here it is:
----------8<----------
package edu.ethz.cs.smp.jobcontrol;
import java.util.Set;
import java.util.TreeSet;
class Foo {
public Set<Object> getSecurities() throws Exception {
return new TreeSet<Object>();
}
}
public class TestThread implements Runnable {
public void run () {
try {
Foo foo = new Foo();
Set<Object> securities = foo.getSecurities();
}
catch (Exception e) {
}
System.out.println("Finished");
}
}
---------->8----------
The Ant Task is as follows:
-----
<javaflow srcdir="${src.dir}" dstDir="${src.dir}/..">
<include name="**/TestThread.class" />
</javaflow>
-----
And the exception:
BUILD FAILED
/Users/mdeluigi/SourceCode/build.xml:115:
org.apache.bcel.verifier.exc.AssertionViolatedException: INTERNAL
ERROR: Missing class: java.lang.ClassNotFoundException: Exception
while looking for class edu.ethz.cs.smp.jobcontrol.Foo:
java.io.IOException: Couldn't find: edu/ethz/cs/smp/jobcontrol/Foo.class
The exception is _not_ thrown if either the try .. except block is
missing _or_ the "securities" collection is initialized within the run
() method.
Does "ASM based instrumentation" mean the Continuation Class Loader?
That one works fine:
---
try {
File dir = new File(System.getProperty("user.dir"));
URL url = dir.toURL();
ClassLoader cl = new ContinuationClassLoader( new URL[]{ url },
Foo.class.getClassLoader()); // parent class loader
Class cls = cl.loadClass("TestThread");
System.out.println("Successfully loaded");
TestThread bar = (TestThread) cls.newInstance();
Continuation.startWith( bar );
}
catch (Exception e) {
System.out.println(e);
}
---
Greetings
Marcus
...or at least the original class file. Without the other classes
it might be hard to track down though.
Did you try the ASM based instrumentation?
cheers
--
Torsten
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]