Summary: | RMI ClassCastException when casting Stub | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Lautier Teva <teva.lautier> |
Component: | Resources | Assignee: | Platform-Resources-Inbox <platform-resources-inbox> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P5 | CC: | eclipse |
Version: | 1.0 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Lautier Teva
2002-07-08 09:19:46 EDT
This happens when the same class is loaded by two different class loaders. In eclipse, this means you have two different plugins that define the same class. In this case, it appears that MyServer.class is located in two different plugins. If this is the case, you need to remove one of them. Closing. This happens if the same class is found in two different plugins. If this is not the case, please reopen. Jhon Arthorne said
>This happens if the same class is found in two different plugins
This is definitely not the case!
As you can see from the Tomcat PR you mentioned, if you don't put the stubs in the plug-in runtime classpath, the RMI classloader will load them (and the remote interfaces they implement) from the server. This causes the class cast exception. There are two workarounds. One is putting the stubs in your plug-in runtime classpath (as you did). The other is to set the context classloader to be your plug-in's classloader before retrieving references to remote objects (see bug 8907). Closing as duplicate of bug 8907 (you get ClassCastExceptions because you have specified a security manager). *** This bug has been marked as a duplicate of 8907 *** |