Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » IPC, Dirmi, BridgeClassloader
IPC, Dirmi, BridgeClassloader [message #1137210] Mon, 14 October 2013 06:35 Go to next message
Eclipse UserFriend
Hi,

I am trying to establish an inter-process communication between eclipse plugin and a separate java process launched within eclipse. I found a library Dirmi (https://github.com/cojen/Dirmi) as a good and light solution that would fit my needs. It is bidirectional and it says that it is faster than standard rmi.

During integration test I met some difficulties. As dirmi is working fine in standalone environemnt, I can't simply run it in Eclipse PDE. (Here is an issue that I made in dirmi project: https://github.com/cojen/Dirmi/issues/2). To demonstrate a problem I created a sample project: https://github.com/marekjagielski/eclipse-launcher-with-dirmi-server.

Dirmi is a library that uses runtime code generation. When I use it I get an exception:

java.lang.ClassCastException: com.systemincloud.modeler.launch.impl.common.ConsoleIApi$Stub$163 cannot be cast to com.systemincloud.modeler.launch.impl.common.ConsoleIApi

It can be due to the fact that at runtime each bundle has its own classloader. Someone has already provided a patch for dirmi: https://github.com/cojen/Dirmi/commit/c5809e090b83d41cb54cb6c9c696737a8fbb0393

In the commit message he explains the problem and that the solution is to use Bridge classloading. Only using a patch didn't solve my problem. However, in the explanation there is a sentence that I don't fully understand:

"The solution is to generate a bridge classloader for each application bundle classloader that simply delegates to the application bundle classloader, except when loading classes that starts with "org.cojen.dirmi" in which case it delegates to the Dirmi bundle classloader."

I don't undestand how can I replace a class loader for a plugin?

Thanks in advance,

Marek
Re: IPC, Dirmi, BridgeClassloader [message #1137825 is a reply to message #1137210] Mon, 14 October 2013 15:25 Go to previous message
Eclipse UserFriend
Issue solved by glerup on github: https://github.com/marekjagielski/eclipse-launcher-with-dirmi-server/pull/1

I am leaving the example for those who want to integrate light ipc in their eclipse plugins.
Thanks,
Previous Topic:Eclipse launch confuguration programatically
Next Topic:custom Editor development in eclipse plugin using eclipse ganymede version
Goto Forum:
  


Current Time: Wed Jul 16 05:45:37 EDT 2025

Powered by FUDForum. Page generated in 0.25688 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top