New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maven repo central and project status #2
Comments
Yes, the project is still active. In the past I've found to to be a pain to get anything into the central repo, which is why I don't ever get around to doing it. Do you know of a simple way to upload artifacts? Have you gone through the process recently? |
Thanks for your reply. I will give your project a try and see if it fits my needs. If it works as it is described at your site I think that it is really worth to share it via maven central repo. More, this will help to increase the popularity of the project. Unfortunately, I haven't shared nothing in central repo yet so I can't help you with that. |
Can I register more server objects in one session? As it is in RMI, that objects are mapped by a key? |
I have problem with a basic sample (dirmi-1.1.2). As a standalone application, it is working fine. However when I try to integrate this example in my application I get: java.lang.ClassCastException: com.systemincloud.modeler.launch.impl.rmi.RemoteExample$Stub$141 cannot be cast to com.systemincloud.modeler.launch.impl.rmi.RemoteExample I want to establish a connection between a plugin eclipse and run of Java process via launch button. |
Make sure that both client and server have all the classes available -- common class paths. To register more objects in a session, create a "root" remote object which has methods to return more remote objects from a method that takes a name argument. The root object is the only one passed through the session directly. |
Ok, I understad what is going on. |
Can you confirm my hypothesis? Reloading of class is not so clean and easy as I thought. If yes, is it possible to prepare stubs before in the client application (eclipse). I think that the problem is that the client (eclipse) starts before than server (new process). And the eclipse plugin has references to remote interfaces that it makes it loaded before. |
You shouldn't need to do anything with class loaders. I don't use Eclipse, and so I cannot help you set it up properly. |
I recall a couple of years ago someone using OSGi was having class loading issues and provided a patch. I'll apply it to a branch, and then you can see if it works for you. |
Here's the link to the branch: https://github.com/cojen/Dirmi/tree/bridge-classloader You'll need to pull the branch using Git and then build the project with Maven. |
Ok, I tried the patched branch but the problem is still the same. |
The same issue I get when using dirmi server on the side eclipse but in different context. java.lang.ClassCastException: com.systemincloud.modeler.launch.impl.common.ConsoleIApi$Stub$163 cannot be cast to com.systemincloud.modeler.launch.impl.common.ConsoleIApi |
Do you know how can I debug this problem? Still, I don't fully understand low level Java topics. As I use on received object: In working example that you provided on the site there are: |
Before casting, print the ClassLoader used by ConsoleApi.class and the remote object you receive (of type ...Stub). The two should be different. On the stub class, call getInterfaces and print them all out. For each, also print the ClassLoader. One of the interfaces should be ConsoleApi, and it should have the same ClassLoader as what you printed earlier. If not, then you'll get a ClassCastException when casting to ConsoleApi. |
Ok, stub.getClass().getClassLoader() : stub.getClass().getInterfaces()[0] : stub.getClass().getInterfaces()[0].getClassLoader() : stub.getClass().getInterfaces()[1] : stub.getClass().getInterfaces()[1].getClassLoader() : It is true that I put dirmi libraries in a seperate plugin modeler.libs and I run the dirmi server from modeler.launch.impl. |
I am looking on Glerup's (@glerup) patch. As I understand he delegates creating stubs to the Dirmi bundle. To use this patch I should create a separate dirmi bundle. Am I right? In my case dirmi is in org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@6d41c14[com.systemincloud.modeler.libs:0.1.0.qualifier(id=815)] |
On the client Session object, try calling setClassLoader(ConsoleApi.class.getClassLoader()) before calling receive. ConsoleApi came from a class loader which is different than what loaded Dirmi classes. (@6c38237 != @6d41c14) Look at the Dirmi's ClassLoaderResolver class, which does the work of resolving client-side remote interfaces. |
I shared an example of what I try to do: |
I've written a description how to run the example as well a small description of project. I will try to find some advices on eclipse forum as it is an issue related to classloaders and osgi. |
We are using Dirmi (with a few patches) as part of our OSGi based server application, so I may be able to help you. I will take a look at your example as soon as possible. |
Issue solved thanks to @glerup (marekjagielski/eclipse-launcher-with-dirmi-server#1). @broneill , maybe you can edit the issue title that others can find it easier if they will meet similar problems. I will leave also my example what can be useful for others. It is a really good library ! |
Hi,
Does project Dirmi is still active? Do you plan to deploy the last version it to central maven repo ?
Thanks,
Marek
The text was updated successfully, but these errors were encountered: