[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[ercp-dev] Class loading problems with J9
|
Title: Class loading problems with J9
Hi,
using eRCP on J9 I try to use extension points with callback objects.
Imagine this:
Plugin1 is offering the extension point.
Plugin2 extends the extension point using a callback object that implements an interface of Plugin1.
During runtime I try to get the callback object in Plugin1.
If I cast the callback object (retrieved from Plugin2) to the interface of Plugin1 than I get a ClassCastException.
I checked which classloader created the object in Plugin2 [callbackObject.getClass().getClassLoader().hashCode()]
I also checked which classloader is used in Plugin1. They are different.
If I compile and run this example using JDK1.5 no problem occurs - even if the classloaders are different.
If I compile this using J9c.exe or JDK1.3 and try to run this using j9.exe than I get the ClassCastException because the interface I used for the callback object is loaded twice.
I use the following configuration:
eRCP-v20050727/x86/eRCP-M3/plugins/org.eclipse.core.runtime_3.1.0.jar
eRCP-v20050727/x86/eRCP-M3/plugins/org.eclipse.osgi_3.1.0.jar
eRCP-v20050727/x86/eRCP-M3/plugins/org.eclipse.ercp.xmlParserAPIs_1.0.0.jar
eRCP-v20050727/x86/eRCP-M3/plugins/org.eclipse.ercp.xml_1.0.0.jar
eRCP-v20050727/x86/eRCP-M3/plugins/org.eclipse.ercp.swt_3.1.0.jar
eRCP-v20050727/x86/eRCP-M3/plugins/org.eclipse.ercp.swt.core.win32_3.1.0/ws/win32/eswt-core-win.jar
eRCP-v20050727/x86/eRCP-M3/plugins/org.eclipse.ercp.swt.expanded.win32_3.1.0/ws/win32/eswt-exp-win.jar
eRCP-v20050727/x86/eRCP-M3/plugins/org.eclipse.ercp.swt.mobile.win32_3.1.0/ws/win32/mobile.jar
I compile using this:
IBM/DeviceDeveloper/wsdd5.0/ive-2.2/bin/j9c.exe" -jcl:foun10 -d <dest_dir> <source>
I run this example using this:
IBM/DeviceDeveloper/wsdd5.0/ive-2.2/bin/j9 -jcl:foun10 -cp startup.jar org.eclipse.core.launcher.Main -application org.eclipse.ercp.swt.demo.eSWTDemoApp -console
Thanks a lot for any hint or help!!
Claudia.