Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » EMF integration
EMF integration [message #72314] Tue, 08 February 2005 02:59 Go to next message
Eclipse UserFriend
Originally posted by: daniel.rohe.stud.tu-ilmenau.de

WE have a problem with our plugin and the WTP M4 on Eclipse 3.1M4. When a
user creates a new J2EE project with the wizard he gets the following error
log:

java.lang.reflect.InvocationTargetException
at
org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:333)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:269)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 824)
at
org.eclipse.wst.common.frameworks.internal.ui.WTPWizard.perf ormFinishWTPWizard.java:83)
at
org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:670)
at
org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:342)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:543)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:718 )
at org.eclipse.jface.window.Window.open(Window.java:696)
at
org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardActi on.run(AbstractOpenWizardAction.java:129)
at
org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardWork benchAction.run(AbstractOpenWizardWorkbenchAction.java:49)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:244)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:555)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:505)
at
org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:419)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1569)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:285)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:102)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:220)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
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.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:710)
at org.eclipse.core.launcher.Main.main(Main.java:694)
Caused by: java.lang.ClassCastException:
StrutsConfig11.util.StrutsConfig11ResourceImpl
at
org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentDescriptorWithRoot
(WebEditModel.java:90)
at
org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation$1.execute
(WebModuleCreationOperation.java:77)
at
org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(WTPOperation.java:211)
at
org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation.createDeploymentDescriptor
(WebModuleCreationOperation.java:80)
at
org.eclipse.jst.j2ee.application.operations.J2EEModuleCreati onOperation.execute
(J2EEModuleCreationOperation.java:55)
at
org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation.execute
(WebModuleCreationOperation.java:84)
at
org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(WTPOperation.java:211)
at
org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration$1.run(WTPOperation.java:146)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1674)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1694)
at
org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.run(WTPOperation.java:164)
at
org.eclipse.wst.common.frameworks.internal.ui.RunnableWithPr ogressWrapper.run
(RunnableWithProgressWrapper.java:64)
at
org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:322)
.... 38 more

I think the following part is the main reason:

Caused by: java.lang.ClassCastException:
StrutsConfig11.util.StrutsConfig11ResourceImpl
at
org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentDescriptorWithRoot
(WebEditModel.java:90)
at
org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation$1.execute
(WebModuleCreationOperation.java:77)

In WebEditModel at line 90 you cast the Resource to the your extended
XMLResource. But we currently use the normal EMF Resource.

If possible could someone explain in more detail how the EMF integration in
the WTP works, so we can move our plugin over from plain EMF to the EMF
integration of WTP.
Currently I'm so far, that I understand the EMFWorkbench from the JEM tool.
But I don't know if I have to extend the EMFNature and/or must use the
extension point nature_registration. The second point is the EditModel in
the WTP. What purpose has it? How must I extend it. And the third point is
the usage of the TranslatorResource but that seems very clear.

Thanks
Daniel
Re: EMF integration [message #72809 is a reply to message #72314] Wed, 09 February 2005 17:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.rohe.stud.tu-ilmenau.de

The problem is solved. In our plugin the generated EMF model plugin uses the
extension point org.eclipse.emf.ecore.extension_parser with the type "xml".
Changing that type to "struts-config.xml" solved our problem. But could
someone anyway explain how the EMF integration in WTP works.

Greetings
Daniel

"Daniel Rohe" <daniel.rohe@stud.tu-ilmenau.de> schrieb im Newsbeitrag
news:cu9rhn$b09$1@www.eclipse.org...
> WE have a problem with our plugin and the WTP M4 on Eclipse 3.1M4. When a
> user creates a new J2EE project with the wizard he gets the following
> error log:
>
> java.lang.reflect.InvocationTargetException
> at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:333)
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:269)
> at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 824)
> at
> org.eclipse.wst.common.frameworks.internal.ui.WTPWizard.perf ormFinishWTPWizard.java:83)
> at
> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:670)
> at
> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:342)
> at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:543)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:718 )
> at org.eclipse.jface.window.Window.open(Window.java:696)
> at
> org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardActi on.run(AbstractOpenWizardAction.java:129)
> at
> org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardWork benchAction.run(AbstractOpenWizardWorkbenchAction.java:49)
> at
> org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:244)
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:555)
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:505)
> at
> org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:419)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1569)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:285)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:144)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:102)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:220)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
> 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.core.launcher.Main.basicRun(Main.java:185)
> at org.eclipse.core.launcher.Main.run(Main.java:710)
> at org.eclipse.core.launcher.Main.main(Main.java:694)
> Caused by: java.lang.ClassCastException:
> StrutsConfig11.util.StrutsConfig11ResourceImpl
> at
> org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentDescriptorWithRoot
> (WebEditModel.java:90)
> at
> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation$1.execute
> (WebModuleCreationOperation.java:77)
> at
> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(WTPOperation.java:211)
> at
> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation.createDeploymentDescriptor
> (WebModuleCreationOperation.java:80)
> at
> org.eclipse.jst.j2ee.application.operations.J2EEModuleCreati onOperation.execute
> (J2EEModuleCreationOperation.java:55)
> at
> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation.execute
> (WebModuleCreationOperation.java:84)
> at
> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(WTPOperation.java:211)
> at
> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration$1.run(WTPOperation.java:146)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1674)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1694)
> at
> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.run(WTPOperation.java:164)
> at
> org.eclipse.wst.common.frameworks.internal.ui.RunnableWithPr ogressWrapper.run
> (RunnableWithProgressWrapper.java:64)
> at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:322)
> ... 38 more
>
> I think the following part is the main reason:
>
> Caused by: java.lang.ClassCastException:
> StrutsConfig11.util.StrutsConfig11ResourceImpl
> at
> org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentDescriptorWithRoot
> (WebEditModel.java:90)
> at
> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation$1.execute
> (WebModuleCreationOperation.java:77)
>
> In WebEditModel at line 90 you cast the Resource to the your extended
> XMLResource. But we currently use the normal EMF Resource.
>
> If possible could someone explain in more detail how the EMF integration
> in the WTP works, so we can move our plugin over from plain EMF to the EMF
> integration of WTP.
> Currently I'm so far, that I understand the EMFWorkbench from the JEM
> tool. But I don't know if I have to extend the EMFNature and/or must use
> the extension point nature_registration. The second point is the EditModel
> in the WTP. What purpose has it? How must I extend it. And the third point
> is the usage of the TranslatorResource but that seems very clear.
>
> Thanks
> Daniel
>
Re: EMF integration [message #72970 is a reply to message #72809] Thu, 10 February 2005 14:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexsmr.NOJUNK.sympatico.ca

Daniel,

Can you share your knowledge on JEM. I'm trying to grasp the main
architecture ideas, but the process goes very slowly as no documantation
exists. Any information will help.

Thanks,
Alex

Daniel Rohe wrote:
> The problem is solved. In our plugin the generated EMF model plugin uses the
> extension point org.eclipse.emf.ecore.extension_parser with the type "xml".
> Changing that type to "struts-config.xml" solved our problem. But could
> someone anyway explain how the EMF integration in WTP works.
>
> Greetings
> Daniel
>
> "Daniel Rohe" <daniel.rohe@stud.tu-ilmenau.de> schrieb im Newsbeitrag
> news:cu9rhn$b09$1@www.eclipse.org...
>
>>WE have a problem with our plugin and the WTP M4 on Eclipse 3.1M4. When a
>>user creates a new J2EE project with the wizard he gets the following
>>error log:
>>
>>java.lang.reflect.InvocationTargetException
>>at
>> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:333)
>>at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:269)
>>at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 824)
>>at
>> org.eclipse.wst.common.frameworks.internal.ui.WTPWizard.perf ormFinishWTPWizard.java:83)
>>at
>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:670)
>>at
>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:342)
>>at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:543)
>>at
>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
>>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
>>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
>>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
>>at org.eclipse.jface.window.Window.runEventLoop(Window.java:718 )
>>at org.eclipse.jface.window.Window.open(Window.java:696)
>>at
>> org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardActi on.run(AbstractOpenWizardAction.java:129)
>>at
>> org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardWork benchAction.run(AbstractOpenWizardWorkbenchAction.java:49)
>>at
>> org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:244)
>>at
>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:555)
>>at
>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:505)
>>at
>> org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:419)
>>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
>>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
>>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
>>at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1569)
>>at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
>>at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:285)
>>at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:144)
>>at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:102)
>>at
>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:220)
>>at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
>>at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
>>at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
>>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.core.launcher.Main.basicRun(Main.java:185)
>>at org.eclipse.core.launcher.Main.run(Main.java:710)
>>at org.eclipse.core.launcher.Main.main(Main.java:694)
>>Caused by: java.lang.ClassCastException:
>>StrutsConfig11.util.StrutsConfig11ResourceImpl
>>at
>> org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentDescriptorWithRoot
>>(WebEditModel.java:90)
>>at
>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation$1.execute
>>(WebModuleCreationOperation.java:77)
>>at
>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(WTPOperation.java:211)
>>at
>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation.createDeploymentDescriptor
>>(WebModuleCreationOperation.java:80)
>>at
>> org.eclipse.jst.j2ee.application.operations.J2EEModuleCreati onOperation.execute
>>(J2EEModuleCreationOperation.java:55)
>>at
>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation.execute
>>(WebModuleCreationOperation.java:84)
>>at
>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(WTPOperation.java:211)
>>at
>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration$1.run(WTPOperation.java:146)
>>at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1674)
>>at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1694)
>>at
>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.run(WTPOperation.java:164)
>>at
>> org.eclipse.wst.common.frameworks.internal.ui.RunnableWithPr ogressWrapper.run
>>(RunnableWithProgressWrapper.java:64)
>>at
>> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:322)
>>... 38 more
>>
>>I think the following part is the main reason:
>>
>>Caused by: java.lang.ClassCastException:
>>StrutsConfig11.util.StrutsConfig11ResourceImpl
>>at
>> org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentDescriptorWithRoot
>>(WebEditModel.java:90)
>>at
>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation$1.execute
>>(WebModuleCreationOperation.java:77)
>>
>>In WebEditModel at line 90 you cast the Resource to the your extended
>>XMLResource. But we currently use the normal EMF Resource.
>>
>>If possible could someone explain in more detail how the EMF integration
>>in the WTP works, so we can move our plugin over from plain EMF to the EMF
>>integration of WTP.
>>Currently I'm so far, that I understand the EMFWorkbench from the JEM
>>tool. But I don't know if I have to extend the EMFNature and/or must use
>>the extension point nature_registration. The second point is the EditModel
>>in the WTP. What purpose has it? How must I extend it. And the third point
>>is the usage of the TranslatorResource but that seems very clear.
>>
>>Thanks
>>Daniel
>>
>
>
>
Re: EMF integration [message #73495 is a reply to message #72970] Sun, 13 February 2005 04:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.rohe.stud.tu-ilmenau.de

Ok, so lets start with what I've understand from reading the code. For the
explanation I'm working with the SDK 1.0.2 and not with the newest source
from CVS because the code base stays the same. It is only renamed so far I
see.
The whole picture of JEM is an EMF model over Java source files. This means
it abstracts the Java source code to a model (good starting point for MDA
tools ;)). I have looked into the plugins com.ibm.wtp.emf.workbench and
org.eclipse.jem.workbench because the usage of a project wide ResourceSet
seems very interesting and could help us for our plugin.

The EMF workbench combines a single EMF ResourceSet with a project in the
Eclipse workspace and handles all what is needed for EMF models (create,
load, save, delete).
This plugin defines four extension points which are currently only used by
the plugins from the WTP tools. The names are self explaining.
The interesting part is the EMFNature. When a project is configured with a
nature that extends from the EMFNature it has an associated
EMFWorkbenchContextBase. The EMFWorkbenchContextBase manages the project
wide ResourceSet. The helper classes are the WorkbenchResourceHelperBase and
ProjectUtilities.

Greetings
Daniel


"Alexander Smirnoff" <alexsmr@NOJUNK.sympatico.ca> schrieb im Newsbeitrag
news:cugd8u$kvm$1@www.eclipse.org...
> Daniel,
>
> Can you share your knowledge on JEM. I'm trying to grasp the main
> architecture ideas, but the process goes very slowly as no documantation
> exists. Any information will help.
>
> Thanks,
> Alex
>
> Daniel Rohe wrote:
>> The problem is solved. In our plugin the generated EMF model plugin uses
>> the extension point org.eclipse.emf.ecore.extension_parser with the type
>> "xml". Changing that type to "struts-config.xml" solved our problem. But
>> could someone anyway explain how the EMF integration in WTP works.
>>
>> Greetings
>> Daniel
>>
>> "Daniel Rohe" <daniel.rohe@stud.tu-ilmenau.de> schrieb im Newsbeitrag
>> news:cu9rhn$b09$1@www.eclipse.org...
>>
>>>WE have a problem with our plugin and the WTP M4 on Eclipse 3.1M4. When a
>>>user creates a new J2EE project with the wizard he gets the following
>>>error log:
>>>
>>>java.lang.reflect.InvocationTargetException
>>>at
>>> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:333)
>>>at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:269)
>>>at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 824)
>>>at
>>> org.eclipse.wst.common.frameworks.internal.ui.WTPWizard.perf ormFinishWTPWizard.java:83)
>>>at
>>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:670)
>>>at
>>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:342)
>>>at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:543)
>>>at
>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
>>>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
>>>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
>>>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
>>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
>>>at org.eclipse.jface.window.Window.runEventLoop(Window.java:718 )
>>>at org.eclipse.jface.window.Window.open(Window.java:696)
>>>at
>>> org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardActi on.run(AbstractOpenWizardAction.java:129)
>>>at
>>> org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardWork benchAction.run(AbstractOpenWizardWorkbenchAction.java:49)
>>>at
>>> org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:244)
>>>at
>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:555)
>>>at
>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:505)
>>>at
>>> org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:419)
>>>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
>>>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
>>>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
>>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
>>>at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1569)
>>>at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
>>>at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:285)
>>>at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:144)
>>>at
>>> org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:102)
>>>at
>>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:220)
>>>at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
>>>at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
>>>at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
>>>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.core.launcher.Main.basicRun(Main.java:185)
>>>at org.eclipse.core.launcher.Main.run(Main.java:710)
>>>at org.eclipse.core.launcher.Main.main(Main.java:694)
>>>Caused by: java.lang.ClassCastException:
>>>StrutsConfig11.util.StrutsConfig11ResourceImpl
>>>at
>>> org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentDescriptorWithRoot
>>>(WebEditModel.java:90)
>>>at
>>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation$1.execute
>>>(WebModuleCreationOperation.java:77)
>>>at
>>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(WTPOperation.java:211)
>>>at
>>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation.createDeploymentDescriptor
>>>(WebModuleCreationOperation.java:80)
>>>at
>>> org.eclipse.jst.j2ee.application.operations.J2EEModuleCreati onOperation.execute
>>>(J2EEModuleCreationOperation.java:55)
>>>at
>>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation.execute
>>>(WebModuleCreationOperation.java:84)
>>>at
>>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(WTPOperation.java:211)
>>>at
>>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration$1.run(WTPOperation.java:146)
>>>at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1674)
>>>at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1694)
>>>at
>>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.run(WTPOperation.java:164)
>>>at
>>> org.eclipse.wst.common.frameworks.internal.ui.RunnableWithPr ogressWrapper.run
>>>(RunnableWithProgressWrapper.java:64)
>>>at
>>> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:322)
>>>... 38 more
>>>
>>>I think the following part is the main reason:
>>>
>>>Caused by: java.lang.ClassCastException:
>>>StrutsConfig11.util.StrutsConfig11ResourceImpl
>>>at
>>> org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentDescriptorWithRoot
>>>(WebEditModel.java:90)
>>>at
>>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOperation$1.execute
>>>(WebModuleCreationOperation.java:77)
>>>
>>>In WebEditModel at line 90 you cast the Resource to the your extended
>>>XMLResource. But we currently use the normal EMF Resource.
>>>
>>>If possible could someone explain in more detail how the EMF integration
>>>in the WTP works, so we can move our plugin over from plain EMF to the
>>>EMF integration of WTP.
>>>Currently I'm so far, that I understand the EMFWorkbench from the JEM
>>>tool. But I don't know if I have to extend the EMFNature and/or must use
>>>the extension point nature_registration. The second point is the
>>>EditModel in the WTP. What purpose has it? How must I extend it. And the
>>>third point is the usage of the TranslatorResource but that seems very
>>>clear.
>>>
>>>Thanks
>>>Daniel
>>>
>>
>>
Re: EMF integration [message #75108 is a reply to message #73495] Sat, 19 February 2005 12:18 Go to previous message
Eclipse UserFriend
Hi Daniel,

That explanation is correct.

Another valuable piece to point out is the use of custom URIConverters
that allow URIs to be resolved to actual resources. The initially requested
URI may or not be a fully-resolved platform: URI, so the URI converter is in
place to resolve it to a platform: URI.

Also, The ProjectResourceSet makes use of a ResourceSetSynchronizer, so
that EMF resources that change on disk are kept in sync with those loaded
(used for consistency checking).

With JEM in particular, the EMF model is built up from EMF Adapters that
handle Java reflection. There are two hierarchies for Java reflection, one
for intra-workbench usage and one for straight JDK usage (for use outside of
an Eclipse Workbench). These reflection adapters use a "reflect-on-demand"
kind of strategy to avoid doing alot of extra work up front that may or may
not be useful.

It's useful to also point out that the EMF integration doesn't stop with
the JEM model. We also use EMF extensively for the J2EE Core models
( http://www.eclipse.org/webtools/jst/components/j2ee/api/j2ee _models_overvie
w.html) and for the upcoming Flexible Project Support
( http://www.eclipse.org/webtools/wst/api/org/eclipse/wst/comm on/modulecore/p
ackage-summary.html). A short discussion of the relevant EMF concepts for
the Flexible Project Structure are available in the overview
( http://www.eclipse.org/webtools/jst/components/j2ee/j2ee_ind ex.html#proposa
ls).

For editable resources, consumers should look to use the Edit Model
framework, which provides a coherent unit of work for editing multiple EMF
resources simultaneously. That is, if you have three files that are all
related -- say an EJB Deployment Descriptor and Server specific bindings
files -- then you can load those resources, and edit them as a group -- if
you decide not to save your changes, then all of those files are reverted.
Edit Models also ensure that the EMF resources maintain the correct
reference counts (the ProjectResourceSet will load an EMF resource exactly
once, and then reference count it for multiple users). More information on
these frameworks will be available in the coming weeks as we seek to
formally define the API.

Kind Regards,

Michael D. Elder




"Daniel Rohe" <daniel.rohe@stud.tu-ilmenau.de> wrote in message
news:cun6sf$idu$1@www.eclipse.org...
> Ok, so lets start with what I've understand from reading the code. For the
> explanation I'm working with the SDK 1.0.2 and not with the newest source
> from CVS because the code base stays the same. It is only renamed so far I
> see.
> The whole picture of JEM is an EMF model over Java source files. This
means
> it abstracts the Java source code to a model (good starting point for MDA
> tools ;)). I have looked into the plugins com.ibm.wtp.emf.workbench and
> org.eclipse.jem.workbench because the usage of a project wide ResourceSet
> seems very interesting and could help us for our plugin.
>
> The EMF workbench combines a single EMF ResourceSet with a project in the
> Eclipse workspace and handles all what is needed for EMF models (create,
> load, save, delete).
> This plugin defines four extension points which are currently only used by
> the plugins from the WTP tools. The names are self explaining.
> The interesting part is the EMFNature. When a project is configured with a
> nature that extends from the EMFNature it has an associated
> EMFWorkbenchContextBase. The EMFWorkbenchContextBase manages the project
> wide ResourceSet. The helper classes are the WorkbenchResourceHelperBase
and
> ProjectUtilities.
>
> Greetings
> Daniel
>
>
> "Alexander Smirnoff" <alexsmr@NOJUNK.sympatico.ca> schrieb im Newsbeitrag
> news:cugd8u$kvm$1@www.eclipse.org...
> > Daniel,
> >
> > Can you share your knowledge on JEM. I'm trying to grasp the main
> > architecture ideas, but the process goes very slowly as no documantation
> > exists. Any information will help.
> >
> > Thanks,
> > Alex
> >
> > Daniel Rohe wrote:
> >> The problem is solved. In our plugin the generated EMF model plugin
uses
> >> the extension point org.eclipse.emf.ecore.extension_parser with the
type
> >> "xml". Changing that type to "struts-config.xml" solved our problem.
But
> >> could someone anyway explain how the EMF integration in WTP works.
> >>
> >> Greetings
> >> Daniel
> >>
> >> "Daniel Rohe" <daniel.rohe@stud.tu-ilmenau.de> schrieb im Newsbeitrag
> >> news:cu9rhn$b09$1@www.eclipse.org...
> >>
> >>>WE have a problem with our plugin and the WTP M4 on Eclipse 3.1M4. When
a
> >>>user creates a new J2EE project with the wizard he gets the following
> >>>error log:
> >>>
> >>>java.lang.reflect.InvocationTargetException
> >>>at
>
>>> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.
java:333)
> >>>at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:269)
> >>>at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 824)
> >>>at
>
>>> org.eclipse.wst.common.frameworks.internal.ui.WTPWizard.perf ormFinishWTPW
izard.java:83)
> >>>at
>
>>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:670
)
> >>>at
>
>>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:342
)
> >>>at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:543)
> >>>at
>
>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
> >>>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> >>>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
> >>>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
> >>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
> >>>at org.eclipse.jface.window.Window.runEventLoop(Window.java:718 )
> >>>at org.eclipse.jface.window.Window.open(Window.java:696)
> >>>at
>
>>> org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardActi on.run(Abstra
ctOpenWizardAction.java:129)
> >>>at
>
>>> org.eclipse.jst.j2ee.internal.actions.AbstractOpenWizardWork benchAction.r
un(AbstractOpenWizardWorkbenchAction.java:49)
> >>>at
>
>>> org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:244)
> >>>at
>
>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Act
ionContributionItem.java:555)
> >>>at
>
>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributi
onItem.java:505)
> >>>at
>
>>> org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContr
ibutionItem.java:419)
> >>>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
> >>>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
> >>>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2803)
> >>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2448)
> >>>at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1569)
> >>>at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
> >>>at
>
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:28
5)
> >>>at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:144)
> >>>at
> >>> org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:102)
> >>>at
>
>>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivat
or.java:220)
> >>>at
>
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:2
73)
> >>>at
>
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1
29)
> >>>at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
> >>>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.core.launcher.Main.basicRun(Main.java:185)
> >>>at org.eclipse.core.launcher.Main.run(Main.java:710)
> >>>at org.eclipse.core.launcher.Main.main(Main.java:694)
> >>>Caused by: java.lang.ClassCastException:
> >>>StrutsConfig11.util.StrutsConfig11ResourceImpl
> >>>at
>
>>> org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentD
escriptorWithRoot
> >>>(WebEditModel.java:90)
> >>>at
>
>>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOpe
ration$1.execute
> >>>(WebModuleCreationOperation.java:77)
> >>>at
>
>>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(
WTPOperation.java:211)
> >>>at
>
>>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOpe
ration.createDeploymentDescriptor
> >>>(WebModuleCreationOperation.java:80)
> >>>at
>
>>> org.eclipse.jst.j2ee.application.operations.J2EEModuleCreati onOperation.e
xecute
> >>>(J2EEModuleCreationOperation.java:55)
> >>>at
>
>>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOpe
ration.execute
> >>>(WebModuleCreationOperation.java:84)
> >>>at
>
>>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.doRun(
WTPOperation.java:211)
> >>>at
>
>>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration$1.run(
WTPOperation.java:146)
> >>>at
org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1674)
> >>>at
org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1694)
> >>>at
>
>>> org.eclipse.wst.common.frameworks.internal.operations.WTPOpe ration.run(WT
POperation.java:164)
> >>>at
>
>>> org.eclipse.wst.common.frameworks.internal.ui.RunnableWithPr ogressWrapper
..run
> >>>(RunnableWithProgressWrapper.java:64)
> >>>at
>
>>> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.
java:322)
> >>>... 38 more
> >>>
> >>>I think the following part is the main reason:
> >>>
> >>>Caused by: java.lang.ClassCastException:
> >>>StrutsConfig11.util.StrutsConfig11ResourceImpl
> >>>at
>
>>> org.eclipse.jst.j2ee.internal.web.operations.WebEditModel.ma keDeploymentD
escriptorWithRoot
> >>>(WebEditModel.java:90)
> >>>at
>
>>> org.eclipse.jst.j2ee.internal.web.archive.operations.WebModu leCreationOpe
ration$1.execute
> >>>(WebModuleCreationOperation.java:77)
> >>>
> >>>In WebEditModel at line 90 you cast the Resource to the your extended
> >>>XMLResource. But we currently use the normal EMF Resource.
> >>>
> >>>If possible could someone explain in more detail how the EMF
integration
> >>>in the WTP works, so we can move our plugin over from plain EMF to the
> >>>EMF integration of WTP.
> >>>Currently I'm so far, that I understand the EMFWorkbench from the JEM
> >>>tool. But I don't know if I have to extend the EMFNature and/or must
use
> >>>the extension point nature_registration. The second point is the
> >>>EditModel in the WTP. What purpose has it? How must I extend it. And
the
> >>>third point is the usage of the TranslatorResource but that seems very
> >>>clear.
> >>>
> >>>Thanks
> >>>Daniel
> >>>
> >>
> >>
>
Previous Topic:Running a web project with project dependencies
Next Topic:EMF vs WTP for an editor
Goto Forum:
  


Current Time: Wed Apr 30 08:35:03 EDT 2025

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

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

Back to the top