[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: "Initialize by loading" & DocumentRoot

Frabrice,

When you invoke "Generate Test Code" there will be an XyzExample.java that should just run as a Java application with no errors...

The wizard code looks like this:

  protected EObject createInitialModel()
  {
    EClass eClass = ExtendedMetaData.INSTANCE.getDocumentRoot(libraryPackage);
    EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(initialObjectCreationPage.getInitialObjectName());
    EObject rootObject = libraryFactory.create(eClass);
    rootObject.eSet(eStructuralFeature, EcoreUtil.create((EClass)eStructuralFeature.getEType()));
    return rootObject;
  }

This implies that the document root EClass is found, but it can't find a feature with a matching name.  Is there something wrong with the document root's features that there is no matching feature found?

It's hard to imagine given that elsewhere the choices are populated like this:
  protected Collection<String> getInitialObjectNames()
  {
    if (initialObjectNames == null)
    {
      initialObjectNames = new ArrayList<String>();
      for (EStructuralFeature eStructuralFeature : ExtendedMetaData.INSTANCE.getAllElements(ExtendedMetaData.INSTANCE.getDocumentRoot(libraryPackage)))
      {
        if (eStructuralFeature.isChangeable())
        {
          EClassifier eClassifier = eStructuralFeature.getEType();
          if (eClassifier instanceof EClass)
          {
            EClass eClass = (EClass)eClassifier;
            if (!eClass.isAbstract())
            {
              initialObjectNames.add(eStructuralFeature.getName());
//  If you add this code does it ever print false?
System.put.println("?" + (eClass.getEStructuralFeature(eStructuralFeature.getName()) == eStructuralFeature));

            }
          }
        }
      }


Fabrice Dubach wrote:
Does the generated example work?
    
What do you mean by the "generated exemple" ? The mine ? A repository one ?

  
We should publish 3.5M2 today, so perhaps the problem is gone...
    
I hope so, even I would like to understand what's wrong.

  
Can you share the full stack trace of the failure? (You know about looking 
in the Error Log view or the <workspace>/.metadata/.log file?)
    
Here it is (sorry for the size) :

!SESSION 2008-09-23 
22:06:58.259 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_07
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments:  -application 
library.editor.LibraryEditorAdvisorApplication
Command-line arguments:  -application 
library.editor.LibraryEditorAdvisorApplication -data C:\Documents and 
Settings\fd\workspace/runtime-library.editor.LibraryEditorAdvisorApplication 
 -dev file:C:/Documents and 
Settings/fd/workspace/.metadata/.plugins/org.eclipse.pde.core/library.editor.LibraryEditorAdvisorApplication/dev.properties 
 -os win32 -ws win32 -arch x86

!ENTRY library.editor 2 0 2008-09-23 22:07:15.791
!MESSAGE
!STACK 0
java.lang.NullPointerException
 at org.eclipse.emf.ecore.util.EcoreUtil.create(EcoreUtil.java:3206)
 at 
com.example.library.presentation.LibraryModelWizard.createInitialModel(LibraryModelWizard.java:202)
 at 
com.example.library.presentation.LibraryModelWizard$1.run(LibraryModelWizard.java:243)
 at 
org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:446)
 at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:354)
 at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:934)
 at 
com.example.library.presentation.LibraryModelWizard.performFinish(LibraryModelWizard.java:263)
 at 
org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
 at 
org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
 at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
 at 
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
 at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
 at org.eclipse.jface.window.Window.open(Window.java:801)
 at 
com.example.library.presentation.LibraryActionBarContributor$NewAction.run(LibraryActionBarContributor.java:77)
 at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
 at 
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
 at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
 at 
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
 at 
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
 at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
 at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
 at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
 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(Workbench.java:488)
 at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
 at 
com.example.library.presentation.LibraryEditorAdvisor$Application.start(LibraryEditorAdvisor.java:107)
 at 
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:386)
 at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 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)

!ENTRY org.eclipse.emf.edit.ui 2 0 2008-09-23 22:07:15.822
!MESSAGE lib.library (Le fichier spécifié est introuvable)
!STACK 0
java.io.FileNotFoundException: lib.library (Le fichier spécifié est 
introuvable)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.<init>(Unknown Source)
 at 
org.eclipse.emf.ecore.resource.impl.FileURIHandlerImpl.createInputStream(FileURIHandlerImpl.java:105)
 at 
org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:301)
 at 
org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:295)
 at 
org.eclipse.emf.edit.ui.util.EditUIUtil.getDefaultEditor(EditUIUtil.java:203)
 at 
com.example.library.presentation.LibraryEditorAdvisor.openEditor(LibraryEditorAdvisor.java:512)
 at 
com.example.library.presentation.LibraryModelWizard.performFinish(LibraryModelWizard.java:265)
 at 
org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
 at 
org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
 at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
 at 
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
 at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
 at org.eclipse.jface.window.Window.open(Window.java:801)
 at 
com.example.library.presentation.LibraryActionBarContributor$NewAction.run(LibraryActionBarContributor.java:77)
 at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
 at 
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
 at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
 at 
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
 at 
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
 at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
 at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
 at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
 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(Workbench.java:488)
 at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
 at 
com.example.library.presentation.LibraryEditorAdvisor$Application.start(LibraryEditorAdvisor.java:107)
 at 
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:386)
 at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 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)