Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Very Weird Casting Exception - I've Never Seen Anything Like This with EMF
Very Weird Casting Exception - I've Never Seen Anything Like This with EMF [message #1843747] Mon, 16 August 2021 16:07 Go to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
Caused by: java.lang.ClassCastException: class <package>.impl.InterconnectionTypeImpl cannot be cast to class <package>.InterconnectionType
(<package>.impl.InterconnectionTypeImpl is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @6c361fde;
<package>.InterconnectionType is in unnamed module of loader org.eclipse.sirius.editor.utils.WorkspaceClassLoading$2 @6fd0034f)

I'm in a Sirius service trying to scope the legal things I can reference trying to calculate Domain based edges.

I have never seen this type of cast error from EMF before since the beginning of my use with it.

Any ideas?

When I launched the debugger for the very first time, my Windows box complained about some firewall settings etc.etc... I closed the window not understanding what was going on. Would this have anything to do with it?

I blown away my plugins that were auto-generated from EMF and re-generated them. No luck. URIs and namespaces all look spelled the same.

I get the exception occuring in my services even during normal runtime - so it's not just the debugger.

Java 11, Eclipse 2020_06, Sirius 6.5.1

[Updated on: Mon, 16 August 2021 16:09]

Report message to a moderator

Re: Very Weird Casting Exception - I've Never Seen Anything Like This with EMF [message #1843764 is a reply to message #1843747] Tue, 17 August 2021 07:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

EMF CCE: I would normally suggest that this is a classic case of metamodel schizophrenia; same metamodel loaded twice, but in this case I see the "ClassLoader" and "unnamed module" red flags so I suggest that you have a 'bad' classpath that allows Java code to be loaded in conflicting fashions.

Even before Java 8 it was important to avoid multi-loading and you will find that there a number of places where EMF takes great care to use the context ClassLoader. It may be that you or the Sirius application code should do the same. It is very important for shared tooling plugins to reach out to use a ClassLoader that includes the user classes. The more recent versions of Java put stronger constraints on loading that I have so far succeeded in avoiding needing to understand.

As always, a fuller report can get a fuller answer. Why have you not shared the stack trace that is full of diagnostic information such as what looks like a bad call path to org.eclipse.sirius.editor.utils.WorkspaceClassLoading$2?

Regards

Ed Willink
Re: Very Weird Casting Exception - I've Never Seen Anything Like This with EMF [message #1843773 is a reply to message #1843764] Tue, 17 August 2021 11:54 Go to previous message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
After re-generating the model cod, I did a -clearPersistedData and then followed that with cleaning the entire workspace. I am back to working now.

That was a pretty wild error I'd never seen before.
Previous Topic:Anyone have success with 2020-06 modeling, Sirius 6.4.1 and ELK? Not me.
Next Topic:Property View in Sirius
Goto Forum:
  


Current Time: Tue Apr 16 05:29:08 GMT 2024

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

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

Back to the top