Bug #18
cannot use bundle types as parameters for remote calls
| Status: | Closed | Start: | 10/02/2009 | |
|---|---|---|---|---|
| Priority: | Urgent | Due date: | ||
| Assigned to: | % Done: | 100% |
||
| Category: | Weaving | |||
| Target version: | 0.5.2 |
Description
Only primitive types are allowed as parameters. Using a type defined in the bundle, this occurs:
java.lang.RuntimeException: org.bundlebee.testbundle.impl.TestBundleReturn<br /> at javassist.runtime.Desc.getClassType(Desc.java:156)<br /> at javassist.runtime.Desc.getType(Desc.java:122)<br /> at javassist.runtime.Desc.getParams(Desc.java:70)<br /> at org.bundlebee.testbundle.impl.TestBundleImpl.echoReturn(TestBundleImpl.java:97)
See also #5
History
Updated by Jörg Plewe over 2 years ago
- Target version changed from 0.5.3 to 0.5.2
Updated by Jörg Plewe over 2 years ago
- Category set to Weaving
- Status changed from New to Resolved
- % Done changed from 0 to 100
javassist generates code that resolves paramter class for $sig with Class.forName() by default.
For some reasons, bundle types cannot be resolved by that.
Therefore, we switch javassist.runtim.Desc to use Thread.currentThread().getContextClassLoader().
When the bundle runs a separate thread to access the method (e.g. a Swing thread started from the bundle),
I had to configure the threads contextclassloader to the one of 'this'
This is a bare workaround!! I have no idea about the reasons.
String determineSignature = "javassist.runtime.Desc.useContextClassLoader = true;"
+ "Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());";
See r2778, r2783
Updated by Philipp Haußleiter about 2 years ago
- Status changed from Resolved to Closed