Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Missing serialized package: uml.ecore
Missing serialized package: uml.ecore [message #477757] Fri, 26 September 2008 21:49 Go to next message
Hector M Chavez is currently offline Hector M ChavezFriend
Messages: 18
Registered: July 2009
Junior Member
I'm trying to manually create a few classes and this code:

org.eclipse.uml2.uml.Class class_ = UMLFactory.eINSTANCE.createClass();
class_.setName("class");

and is causing an exception the following:

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.eclipse.uml2.uml.UMLPackage$Literals.<clinit>(UMLPackage.java:2244)
...
...

Caused by: java.lang.RuntimeException: Missing serialized package:
uml.ecore
at
org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackag e(UMLPackageImpl.java:10902)
at
org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.init(UMLPa ckageImpl.java:1966)
at org.eclipse.uml2.uml.UMLPackage.<clinit>(UMLPackage.java:81)
... 11 more

I would appreciate any comments, thanks.
Re: Missing serialized package: uml.ecore [message #477767 is a reply to message #477757] Mon, 29 September 2008 14:05 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Hector,

It would appear that the UMLPackage is not yet properly initialized before
it is being used.
Are you by any chance "hijaaking" the UML Factory and registering your own
specialized one? Is your variable class_ declared statically?
Try setting a breakpoint at the top of UMLPackage.init() and re-run your
scenario. Are you hitting your error before you complete the init()?

- James.

"Hector M Chavez" <hectormch@gmail.com> wrote in message
news:b662eab1b98e051b86a4d15e277995ec$1@www.eclipse.org...
> I'm trying to manually create a few classes and this code:
>
> org.eclipse.uml2.uml.Class class_ = UMLFactory.eINSTANCE.createClass();
> class_.setName("class");
>
> and is causing an exception the following:
>
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at org.eclipse.uml2.uml.UMLPackage$Literals.<clinit>(UMLPackage.java:2244)
> ..
> ..
>
> Caused by: java.lang.RuntimeException: Missing serialized package:
> uml.ecore
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackag e(UMLPackageImpl.java:10902)
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.init(UMLPa ckageImpl.java:1966)
> at org.eclipse.uml2.uml.UMLPackage.<clinit>(UMLPackage.java:81)
> .. 11 more
>
> I would appreciate any comments, thanks.
>
Re: Missing serialized package: uml.ecore [message #477768 is a reply to message #477767] Mon, 29 September 2008 19:02 Go to previous messageGo to next message
Hector M Chavez is currently offline Hector M ChavezFriend
Messages: 18
Registered: July 2009
Junior Member
James,

Thanks for your answer, no I'm not hijacking the Factory and I'm hitting
the error before init() is completed, on init() within the
UMLPackage.loadPackage() function, getResource() is returning null.

URL url = getClass().getResource(packageFilename);
if (url == null) {
throw new RuntimeException("Missing serialized package: " +
packageFilename); //$NON-NLS-1$
}

Where packageFilename is "uml.ecore"

Hector
Re: Missing serialized package: uml.ecore [message #477769 is a reply to message #477768] Mon, 29 September 2008 21:45 Go to previous message
Hector M Chavez is currently offline Hector M ChavezFriend
Messages: 18
Registered: July 2009
Junior Member
James,

Just realize it was a problem with the project set up, I'm not sure
exactly what was the problem, I just erased the project and created a new
one, now it is working fine. Thanks for your help.

Hector
Re: Missing serialized package: uml.ecore [message #626965 is a reply to message #477757] Mon, 29 September 2008 14:05 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Hector,

It would appear that the UMLPackage is not yet properly initialized before
it is being used.
Are you by any chance "hijaaking" the UML Factory and registering your own
specialized one? Is your variable class_ declared statically?
Try setting a breakpoint at the top of UMLPackage.init() and re-run your
scenario. Are you hitting your error before you complete the init()?

- James.

"Hector M Chavez" <hectormch@gmail.com> wrote in message
news:b662eab1b98e051b86a4d15e277995ec$1@www.eclipse.org...
> I'm trying to manually create a few classes and this code:
>
> org.eclipse.uml2.uml.Class class_ = UMLFactory.eINSTANCE.createClass();
> class_.setName("class");
>
> and is causing an exception the following:
>
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at org.eclipse.uml2.uml.UMLPackage$Literals.<clinit>(UMLPackage.java:2244)
> ..
> ..
>
> Caused by: java.lang.RuntimeException: Missing serialized package:
> uml.ecore
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackag e(UMLPackageImpl.java:10902)
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.init(UMLPa ckageImpl.java:1966)
> at org.eclipse.uml2.uml.UMLPackage.<clinit>(UMLPackage.java:81)
> .. 11 more
>
> I would appreciate any comments, thanks.
>
Re: Missing serialized package: uml.ecore [message #626966 is a reply to message #477767] Mon, 29 September 2008 19:02 Go to previous message
Hector M Chavez is currently offline Hector M ChavezFriend
Messages: 18
Registered: July 2009
Junior Member
James,

Thanks for your answer, no I'm not hijacking the Factory and I'm hitting
the error before init() is completed, on init() within the
UMLPackage.loadPackage() function, getResource() is returning null.

URL url = getClass().getResource(packageFilename);
if (url == null) {
throw new RuntimeException("Missing serialized package: " +
packageFilename); //$NON-NLS-1$
}

Where packageFilename is "uml.ecore"

Hector
Re: Missing serialized package: uml.ecore [message #626967 is a reply to message #477768] Mon, 29 September 2008 21:45 Go to previous message
Hector M Chavez is currently offline Hector M ChavezFriend
Messages: 18
Registered: July 2009
Junior Member
James,

Just realize it was a problem with the project set up, I'm not sure
exactly what was the problem, I just erased the project and created a new
one, now it is working fine. Thanks for your help.

Hector
Previous Topic:problem with UML2.ecore file
Next Topic:eclipse 3.5M2 versus uml2 tools?
Goto Forum:
  


Current Time: Mon Mar 30 14:54:08 GMT 2020

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

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

Back to the top