Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ExceptionInInitializerError
ExceptionInInitializerError [message #427691] Thu, 26 February 2009 17:04 Go to next message
Adrian Rutle is currently offline Adrian RutleFriend
Messages: 20
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------090409060008040109070607
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Helo,

I am working on a project which combines EMF + GEF. The project worked
until I changed the metamodel (extended with a node and some
relationships). Corresponding classes (EditParts, EditPolicies ...etc)
are also created for to enable the created GEF based editors.

Anyway, the problem I have is created because of the code:

Roots2modelPackage.init();

I have tried to test the generated code in a test class, which passes
through (at least) this line without problem.

Any ideas why EPackageImpl cannot initialize my package?

PS! When I call the following 2 lines before the problem line, the
second one initiates the object "roots" with all its contained objects
(which are assigned null).

(1) roots = Roots2modelFactory.eINSTANCE.createROOTS2Model();
(2) rootsModelFactory =
Roots2modelPackage.eINSTANCE.getRoots2modelFactory();

(3) Roots2modelPackage.init();

Thanks in advance!


eclipse.buildId=M20080911-1700
java.version=1.6.0_0
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.platform.ide
Command-line arguments: -product org.eclipse.platform.ide -data
/home/aru/dev/workspace_2009_02/../runtime-EclipseApplicatio n -dev
file:/home/aru/dev/workspace_2009_02/.metadata/.plugins/org. eclipse.pde.core/Eclipse
Application/dev.properties -os linux -ws gtk -arch x86


Error
Thu Feb 26 17:42:09 CET 2009
Problems occurred when invoking code from plug-in: "org.eclipse.jface".

java.lang.ExceptionInInitializerError
at org.eclipse.emf.ecore.impl.EPackageImpl.<init>(EPackageImpl.java:167)
at
de.uni_marburg.roots2model.Roots2modelPackage.<init>(Roots2modelPackage.java:3354)
at
de.uni_marburg.roots2model.Roots2modelPackage.init(Roots2mod elPackage.java:3395)
at
de.uni_marburg.roots2model.Roots2modelPackage.<clinit>(Roots2modelPackage.java:63)
at
de.uni_marburg.roots2editor.model.ROOTS2ModelManager.getReso urceSet(ROOTS2ModelManager.java:87)
at
de.uni_marburg.roots2editor.model.ROOTS2ModelManager.getReso urce(ROOTS2ModelManager.java:55)
at
de.uni_marburg.roots2editor.model.ROOTS2ModelManager.load(RO OTS2ModelManager.java:157)
at
de.uni_marburg.roots2editor.editor.TreeEditor.setInput(TreeE ditor.java:372)
at
de.uni_marburg.roots2editor.editor.AbstractTreeEditor.init(A bstractTreeEditor.java:367)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:799)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:643)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileActio n.java:99)
at
org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystem EditorAction.java:99)
at
org.eclipse.ui.views.navigator.OpenActionGroup.runDefaultAct ion(OpenActionGroup.java:125)
at
org.eclipse.ui.views.navigator.MainActionGroup.runDefaultAct ion(MainActionGroup.java:329)
at
org.eclipse.ui.views.navigator.ResourceNavigator.handleOpen( ResourceNavigator.java:716)
at
org.eclipse.ui.views.navigator.ResourceNavigator$6.open(Reso urceNavigator.java:443)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3033)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.common.util.WrappedException:
java.lang.ClassNotFoundException: ecore.EcorePackage
at
org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:260)
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage( EPackageRegistryImpl.java:133)
at
org.eclipse.emf.ecore.impl.EcorePackageImpl.init(EcorePackag eImpl.java:484)
at org.eclipse.emf.ecore.EcorePackage.<clinit>(EcorePackage.java:72)
... 83 more
Caused by: java.lang.ClassNotFoundException: ecore.EcorePackage
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:481)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:313)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1274)
at
org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:253)
... 86 more

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkmmy6MACgkQtwhuhvDfdhiIegCg3hDavK0mv9lTCQIV7FA5 o7iy
fD4An26/Wjp1v6ilqxfRSkW8skcP28c2
=KpBF
-----END PGP SIGNATURE-----

--------------090409060008040109070607
Content-Type: text/x-java;
name="ROOTS2ModelManager.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ROOTS2ModelManager.java"

package de.uni_marburg.roots2editor.model;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.eclipse.core.runtime.IPath;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;

import de.uni_marburg.roots2model.ROOTS2Model;
import de.uni_marburg.roots2model.Roots2modelFactory;
import de.uni_marburg.roots2model.Roots2modelPackage;
import de.uni_marburg.roots2model.TypeGraph;

/**
* Drives the model. Acts as the model entry point.
*/
public class ROOTS2ModelManager {

private static final String DEFAULT_MODEL_NAME = "TypeGraph";
private static final String DEFAULT_ROOTS_NAME = "ROOTS2Model";

/**
* For the purpose of the simple editor, a file can only contain one
* ROOTS2Model. In EMF, a resource provides the way to have access to the
* model content.
*/
private Resource resource = null;

/**
* Contains the factory associated with the model.
*/
private static Roots2modelFactory rootsModelFactory = null;

/**
* Gives access to the top level ressource contained in the resource.
*/
private ROOTS2Model roots = null;

/**
* Returns the resource containing the ROOTS2Model. Uses lazy
* initialization.
*/
public Resource getResource(IPath path) {
if (resource == null) {
ResourceSet resSet = getResourceSet();
System.out.println("ARU: In get Path URI "
+ URI.createPlatformResourceURI(path.toString()));
System.out.println("ARU: In get Path toString " + path.toString());
resource = resSet.getResource(URI.createPlatformResourceURI(path
.toString()), true);
}
return resource;
}

/**
* Creates a resource to contain the ROOTS2Model. The resource file does not
* exist yet.
*/
private Resource createResource(IPath path) {
if (resource == null) {
ResourceSet resSet = getResourceSet();
URI uri = URI.createFileURI(new File(path.toString()).getAbsolutePath());
resource = resSet.createResource(uri);
}
return resource;
}

/**
* Returns the resource set.
*/
@SuppressWarnings("unchecked")
private ResourceSet getResourceSet() {
// initialising underlaying EMF-Package
/* ARU If I comment out this, what happens? */

roots = Roots2modelFactory.eINSTANCE.createROOTS2Model();
rootsModelFactory = Roots2modelPackage.eINSTANCE.getRoots2modelFactory();

Roots2modelPackage.init();

// Register the XMI resource factory for the .rof extension

Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
reg.getExtensionToFactoryMap().put("rof", new XMIResourceFactoryImpl());


// ARU I don't know, whether we do the things above or not, you return a
// NEW resourceSet

// Obtain a new resource set
return new ResourceSetImpl();
}

/**
* Returns the factory associated with the model. Object creation are made
* through that factory.
*/
static public Roots2modelFactory getFactory() {
if (rootsModelFactory == null) {
// Access the factory (needed to create instances)
Map registry = EPackage.Registry.INSTANCE;
String networkURI = Roots2modelPackage.eNS_URI;
Roots2modelPackage roots2modelPackage = (Roots2modelPackage) registry
.get(networkURI);
rootsModelFactory = roots2modelPackage.getRoots2modelFactory();
// Why not the following:
// rootsModelFactory = Roots2modelFactory.eINSTANCE;
}
return rootsModelFactory;
}

/**
* Creates a new ROOTS2Model.
*/
@SuppressWarnings("unchecked")
public ROOTS2Model createROOTS(IPath path) {
// creates and initialise an empty model
createResource(path);
// Create a new ROOTS2Model model
// Map registry = EPackage.Registry.INSTANCE;
// String ROOTSModelURI = Roots2modelPackage.eNS_URI;
// Roots2modelPackage nPackage = (Roots2modelPackage) registry
// .get(ROOTSModelURI);
// Roots2modelFactory nFactory = nPackage.getRoots2modelFactory();

// Why not simply?
Roots2modelFactory nFactory = getFactory();
System.out.println("ARU Factory is created");

roots = nFactory.createROOTS2Model();
roots.setName(DEFAULT_ROOTS_NAME);

TypeGraph model = nFactory.createTypeGraph();
model.setName(DEFAULT_MODEL_NAME);
roots.setTypeGraph(model);

resource.getContents().add(roots);

return roots;
}

/**
* Loads the content of the model from the file.
*/
@SuppressWarnings("unchecked")
public void load(IPath path) throws IOException {
getResource(path);
Map options = new HashMap();
options.put(XMIResource.OPTION_DECLARE_XML, Boolean.TRUE);
resource.load(options);
}

/**
* reloads the content of the model from the file.
*/
public void reload(IPath path) throws IOException {
getResource(path).unload();
load(path);
}

/**
* Saves the content of the model to the file.
*/
@SuppressWarnings("unchecked")
public void save(IPath path) throws IOException {
getResource(path);
Map options = new HashMap();
options.put(XMIResource.OPTION_DECLARE_XML, Boolean.TRUE);
options.put(XMIResource.OPTION_ENCODING, "UTF-8");

resource.save(options);
}

/**
* Gets the top level ROOTS2Model model.
*/
public ROOTS2Model getModel() {
if (null == roots) {
EList l = resource.getContents();
Iterator i = l.iterator();
while (i.hasNext()) {
Object o = i.next();
if (o instanceof ROOTS2Model)
roots = (ROOTS2Model) o;
}
}
return roots;
}
}

--------------090409060008040109070607--
Re: ExceptionInInitializerError [message #427693 is a reply to message #427691] Thu, 26 February 2009 18:03 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050507050302080405070607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Adrian,

This line makes me suspicious:

java.lang.ClassNotFoundException: ecore.EcorePackage

There isn't such a class so where is this dependency coming from? Do
you have a spurious generated_package registration in some plugin.xml
that registers the above bogus name to the Ecore namespace?


Adrian Rutle wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Helo,
>
> I am working on a project which combines EMF + GEF. The project worked
> until I changed the metamodel (extended with a node and some
> relationships). Corresponding classes (EditParts, EditPolicies ...etc)
> are also created for to enable the created GEF based editors.
>
> Anyway, the problem I have is created because of the code:
>
> Roots2modelPackage.init();
>
> I have tried to test the generated code in a test class, which passes
> through (at least) this line without problem.
>
> Any ideas why EPackageImpl cannot initialize my package?
>
> PS! When I call the following 2 lines before the problem line, the
> second one initiates the object "roots" with all its contained objects
> (which are assigned null).
>
> (1) roots = Roots2modelFactory.eINSTANCE.createROOTS2Model();
> (2) rootsModelFactory =
> Roots2modelPackage.eINSTANCE.getRoots2modelFactory();
>
> (3) Roots2modelPackage.init();
>
> Thanks in advance!
>
>
> eclipse.buildId=M20080911-1700
> java.version=1.6.0_0
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
> Framework arguments: -product org.eclipse.platform.ide
> Command-line arguments: -product org.eclipse.platform.ide -data
> /home/aru/dev/workspace_2009_02/../runtime-EclipseApplicatio n -dev
> file:/home/aru/dev/workspace_2009_02/.metadata/.plugins/org. eclipse.pde.core/Eclipse
> Application/dev.properties -os linux -ws gtk -arch x86
>
>
> Error
> Thu Feb 26 17:42:09 CET 2009
> Problems occurred when invoking code from plug-in: "org.eclipse.jface".
>
> java.lang.ExceptionInInitializerError
> at org.eclipse.emf.ecore.impl.EPackageImpl.<init>(EPackageImpl.java:167)
> at
> de.uni_marburg.roots2model.Roots2modelPackage.<init>(Roots2modelPackage.java:3354)
> at
> de.uni_marburg.roots2model.Roots2modelPackage.init(Roots2mod elPackage.java:3395)
> at
> de.uni_marburg.roots2model.Roots2modelPackage.<clinit>(Roots2modelPackage.java:63)
> at
> de.uni_marburg.roots2editor.model.ROOTS2ModelManager.getReso urceSet(ROOTS2ModelManager.java:87)
> at
> de.uni_marburg.roots2editor.model.ROOTS2ModelManager.getReso urce(ROOTS2ModelManager.java:55)
> at
> de.uni_marburg.roots2editor.model.ROOTS2ModelManager.load(RO OTS2ModelManager.java:157)
> at
> de.uni_marburg.roots2editor.editor.TreeEditor.setInput(TreeE ditor.java:372)
> at
> de.uni_marburg.roots2editor.editor.AbstractTreeEditor.init(A bstractTreeEditor.java:367)
> at org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:799)
> at
> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:643)
> at
> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
> at
> org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
> at
> org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
> at
> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
> at
> org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
> at
> org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
> at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
> at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
> at
> org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
> at
> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
> at
> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
> at
> org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
> at
> org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
> at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
> at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileActio n.java:99)
> at
> org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystem EditorAction.java:99)
> at
> org.eclipse.ui.views.navigator.OpenActionGroup.runDefaultAct ion(OpenActionGroup.java:125)
> at
> org.eclipse.ui.views.navigator.MainActionGroup.runDefaultAct ion(MainActionGroup.java:329)
> at
> org.eclipse.ui.views.navigator.ResourceNavigator.handleOpen( ResourceNavigator.java:716)
> at
> org.eclipse.ui.views.navigator.ResourceNavigator$6.open(Reso urceNavigator.java:443)
> at
> org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:880)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
> at
> org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
> at
> org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
> at
> org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
> at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
> at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3401)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3033)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:616)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
> Caused by: org.eclipse.emf.common.util.WrappedException:
> java.lang.ClassNotFoundException: ecore.EcorePackage
> at
> org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:260)
> at
> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage( EPackageRegistryImpl.java:133)
> at
> org.eclipse.emf.ecore.impl.EcorePackageImpl.init(EcorePackag eImpl.java:484)
> at org.eclipse.emf.ecore.EcorePackage.<clinit>(EcorePackage.java:72)
> ... 83 more
> Caused by: java.lang.ClassNotFoundException: ecore.EcorePackage
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:481)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:313)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1274)
> at
> org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:253)
> ... 86 more
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.9 (GNU/Linux)
> Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkmmy6MACgkQtwhuhvDfdhiIegCg3hDavK0mv9lTCQIV7FA5 o7iy
> fD4An26/Wjp1v6ilqxfRSkW8skcP28c2
> =KpBF
> -----END PGP SIGNATURE-----
>

--------------050507050302080405070607
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Adrian,<br>
<br>
This line makes me suspicious:<br>
<blockquote>
<pre wrap="">java.lang.ClassNotFoundException: ecore.EcorePackage</pre>
</blockquote>
There isn't such a class so where is this dependency coming from?&nbsp; Do
you have a spurious generated_package registration in some plugin.xml
that registers the above bogus name to the Ecore namespace?<br>
<br>
<br>
Adrian Rutle wrote:
<blockquote cite="mid:49A6CBA4.7050307@rutle.no" type="cite">
<pre wrap="">-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Helo,

I am working on a project which combines EMF + GEF. The project worked
until I changed the metamodel (extended with a node and some
relationships). Corresponding classes (EditParts, EditPolicies ...etc)
are also created for to enable the created GEF based editors.

Anyway, the problem I have is created because of the code:

Roots2modelPackage.init();

I have tried to test the generated code in a test class, which passes
through (at least) this line without problem.

Any ideas why EPackageImpl cannot initialize my package?

PS! When I call the following 2 lines before the problem line, the
second one initiates the object "roots" with all its contained objects
(which are assigned null).

(1) roots = Roots2modelFactory.eINSTANCE.createROOTS2Model();
(2) rootsModelFactory =
Roots2modelPackage.eINSTANCE.getRoots2modelFactory();

(3) Roots2modelPackage.init();

Thanks in advance!


eclipse.buildId=M20080911-1700
java.version=1.6.0_0
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.platform.ide
Command-line arguments: -product org.eclipse.platform.ide -data
/home/aru/dev/workspace_2009_02/../runtime-EclipseApplicatio n -dev
<a class="moz-txt-link-freetext" href=" file:/home/aru/dev/workspace_2009_02/.metadata/.plugins/org. eclipse.pde.core/Eclipse "> file:/home/aru/dev/workspace_2009_02/.metadata/.plugins/org. eclipse.pde.core/Eclipse </a>
Application/dev.properties -os linux -ws gtk -arch x86


Error
Thu Feb 26 17:42:09 CET 2009
Problems occurred when invoking code from plug-in: "org.eclipse.jface".

java.lang.ExceptionInInitializerError
at org.eclipse.emf.ecore.impl.EPackageImpl.&lt;init&gt; (EPackageImpl.java:167)
at
de.uni_marburg.roots2model.Roots2modelPackage.&lt;init&a mp;gt;(Roots2modelPackage.java:3354)
at
de.uni_marburg.roots2model.Roots2modelPackage.init(Roots2mod elPackage.java:3395)
at
de.uni_marburg.roots2model.Roots2modelPackage.&lt;clinit &gt;(Roots2modelPackage.java:63)
at
de.uni_marburg.roots2editor.model.ROOTS2ModelManager.getReso urceSet(ROOTS2ModelManager.java:87)
at
de.uni_marburg.roots2editor.model.ROOTS2ModelManager.getReso urce(ROOTS2ModelManager.java:55)
at
de.uni_marburg.roots2editor.model.ROOTS2ModelManager.load(RO OTS2ModelManager.java:157)
at
de.uni_marburg.roots2editor.editor.TreeEditor.setInput(TreeE ditor.java:372)
at
de.uni_marburg.roots2editor.editor.AbstractTreeEditor.init(A bstractTreeEditor.java:367)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManag er.java:799)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:643)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileActio n.java:99)
at
org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystem EditorAction.java:99)
at
org.eclipse.ui.views.navigator.OpenActionGroup.runDefaultAct ion(OpenActionGroup.java:125)
at
org.eclipse.ui.views.navigator.MainActionGroup.runDefaultAct ion(MainActionGroup.java:329)
at
org.eclipse.ui.views.navigator.ResourceNavigator.handleOpen( ResourceNavigator.java:716)
at
org.eclipse.ui.views.navigator.ResourceNavigator$6.open(Reso urceNavigator.java:443)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3033)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.common.util.WrappedException:
java.lang.ClassNotFoundException: ecore.EcorePackage
at
org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:260)
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage( EPackageRegistryImpl.java:133)
at
org.eclipse.emf.ecore.impl.EcorePackageImpl.init(EcorePackag eImpl.java:484)
at org.eclipse.emf.ecore.EcorePackage.&lt;clinit&gt;(Ec orePackage.java:72)
... 83 more
Caused by: java.lang.ClassNotFoundException: ecore.EcorePackage
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:481)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:313)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1274)
at
org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:253)
... 86 more

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - <a class="moz-txt-link-freetext" href="http://enigmail.mozdev.org">http://enigmail.mozdev.org</a>

iEYEARECAAYFAkmmy6MACgkQtwhuhvDfdhiIegCg3hDavK0mv9lTCQIV7FA5 o7iy
fD4An26/Wjp1v6ilqxfRSkW8skcP28c2
=KpBF
-----END PGP SIGNATURE-----
</pre>
</blockquote>
</body>
</html>

--------------050507050302080405070607--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Re: ECORE 2 XML Schema and back
Next Topic:carriage returns when loading file
Goto Forum:
  


Current Time: Fri Apr 19 19:17:03 GMT 2024

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

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

Back to the top