Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Java services doesn't work
Java services doesn't work [message #1824262] Sat, 11 April 2020 11:47 Go to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 343
Registered: August 2013
Senior Member
Hi

1) I've got the following bug. I have a Java service with the following method:
    public EObject getEdgeTarget(DEdge edge) {
        DNode targetNode = (DNode) ((DEdge) edge).getTargetNode();
        return targetNode.getTarget();
    }

All of the methods defined in this service doesn't work. After debug I found that the bug is caused by Class::getMethods() method invoked in org.eclipse.sirius.common.tools.internal.interpreter.ServiceInterpreter.registerServiceClass().

Class::getMethods() just crashes silently. If one will debug it, than he will get the following exception: "java.lang.NoClassDefFoundError: org/eclipse/sirius/diagram/DEdge"

If I change the service method as follows:
    public EObject getEdgeTarget(EObject edge) {
        DNode targetNode = (DNode) ((DEdge) edge).getTargetNode();
        return targetNode.getTarget();
    }

than the rest of the methods starts working. But execution of this method causes the same exception: "java.lang.NoClassDefFoundError: org/eclipse/sirius/diagram/DEdge"

The only solution I've found is to move the service into a separate project. After that it works just fine.


2) But I've got a one more problem. According to https://www.eclipse.org/forums/index.php/t/1094092/ all services should be located in the representation plugin.

Both of the services (located in the specification project and in the separate project) works fine. But when I remove the specification project from a nested Eclipse workspace, both of the services stop working. I get "Could not find Java extension class" for both services.


Could you please help with these problems?
Re: Java services doesn't work [message #1824492 is a reply to message #1824262] Thu, 16 April 2020 08:28 Go to previous message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hi,

> than the rest of the methods starts working. But execution of this method causes the same exception: "java.lang.NoClassDefFoundError: org/eclipse/sirius/diagram/DEdge"
Try to add org.eclipse.sirius.diagram as required plugin in your dependencies.

I'm not sure to understand exactly what you mean by " I remove the specification project from a nested Eclipse workspace". Your modeler works properly in your development environment with your specification project (containing the java services and the odesign) alongside the representation project (with the aird file)?
Do you reference as required plugin in your specification project the plugin containing the java services?

Regards,

Florian


.
Previous Topic:Transfering a diagram to a service function
Next Topic:Delete Element Based Edge together with its Target/Source
Goto Forum:
  


Current Time: Fri Mar 29 07:57:17 GMT 2024

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

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

Back to the top