Hi,
I've recently moved to Juno (EMF 2.8.0.v20120606-0717, UML 4.0.0.v20120604-0919) and came across a strange behavior.

If I reload or re-generate some of my genmodels, I get the following exception when I hit "Finish" in the genmodel wizard. As far as I can see, this only happens if the models reference the UML metamodel. Any idea what might be causing this?
(The genmodel looks fine if I ignore this)

Joel

java.lang.reflect.InvocationTargetException
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:121)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1028)
at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard.performFinish(ModelConverterWizard.java:240)
at org.eclipse.emf.importer.ui.contribution.base.ModelImporterWizard.performFinish(ModelImporterWizard.java:170)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:259)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:279)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:210)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:492)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
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:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
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:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
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:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: org.eclipse.core.runtime.CoreException: An error occurred while performing this operation.
at org.eclipse.emf.common.util.DiagnosticException.toCoreException(DiagnosticException.java:41)
at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard$1.execute(ModelConverterWizard.java:229)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
... 58 more
Caused by: org.eclipse.emf.common.util.DiagnosticException: An error occurred while performing this operation.
at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard$1.execute(ModelConverterWizard.java:228)
... 61 more
Caused by: java.io.IOException: PUT failed with HTTP response code 405
at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl$1.close(URIHandlerImpl.java:123)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(ResourceImpl.java:1228)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:972)
at org.eclipse.emf.importer.ModelImporter.saveGenModelAndEPackages(ModelImporter.java:763)
at org.eclipse.emf.importer.ui.contribution.base.ModelImporterWizard.doPerformFinish(ModelImporterWizard.java:157)
at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard$1.execute(ModelConverterWizard.java:222)
... 61 more

Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=382637 is marked as fixed, and I have not had the problem discussed in this thread in a while. However, now that I have installed Luna and UML2 5.0.0, it seems to be back. Is anyone else having this problem again?

The original bug was a consequence of the UML 2.4.1 support separating
out a (Primitive)Types package and not ensuring that it was always
registered.

Similar problems occurred in the Luna run up with the UML 2.5 support.

However there is now a UMLResourcesUtil.init() that ensures that the
many required registrations occur. Any user/application that does not
call this is guaranteed to have major migration headaches.

Regards

Ed Willink

On 22/08/2014 22:42, Ed Seidewitz wrote:
> Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=382637 is marked as
> fixed, and I have not had the problem discussed in this thread in a
> while. However, now that I have installed Luna and UML2 5.0.0, it seems
> to be back. Is anyone else having this problem again?

Some of the UML 2.4.1 problems were caused by being helpful; the new
Types model was hidden/auto-referenced so that migrating users did not
need to worry about it. This made the hidden package very irregular. I
think that it is now regular so perhaps you need to include
Types.genmodel in your used genmodels.

Regards

Ed Willink

On 23/08/2014 09:01, Ed Willink wrote:
> Hi Ed
>
> The original bug was a consequence of the UML 2.4.1 support separating
> out a (Primitive)Types package and not ensuring that it was always
> registered.
>
> Similar problems occurred in the Luna run up with the UML 2.5 support.
>
> However there is now a UMLResourcesUtil.init() that ensures that the
> many required registrations occur. Any user/application that does not
> call this is guaranteed to have major migration headaches.
>
> Regards
>
> Ed Willink
>
>
> On 22/08/2014 22:42, Ed Seidewitz wrote:
>> Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=382637 is marked as
>> fixed, and I have not had the problem discussed in this thread in a
>> while. However, now that I have installed Luna and UML2 5.0.0, it seems
>> to be back. Is anyone else having this problem again?
>

I do use UMLResourceUtil.init() when using the metamodel at runtime, but I am not sure that this is relevant to creating a genmodel.

And I did have Types.genmodel included as a used genmodel from before. However, when I tried to reload the ecore model into the genmodel under Luna, I got the old error again. I also get the error when I try to create a new genmodel. There does not seem to be any way to select Types to be used model during the genmodel dialog, but even trying to fix up the genmodel XMI by hand after the fact doesn't seem to work for me.

On 25/08/2014 15:45, Ed Seidewitz wrote:
> Ed --
>
> I do use UMLResourceUtil.init() when using the metamodel at runtime, but
> I am not sure that this is relevant to creating a genmodel.
>
> And I did have Types.genmodel included as a used genmodel from before.
> However, when I tried to reload the ecore model into the genmodel under
> Luna, I got the old error again. I also get the error when I try to
> create a new genmodel. There does not seem to be any way to select Types
> to be used model during the genmodel dialog, but even trying to fix up
> the genmodel XMI by hand after the fact doesn't seem to work for me.
>
> -- Ed