Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » No packages listed when importing from annotated java
No packages listed when importing from annotated java [message #431547] Wed, 15 July 2009 20:07 Go to next message
Ashley Williams is currently offline Ashley WilliamsFriend
Messages: 5
Registered: July 2009
Junior Member
Hi All,

I am having trouble generating an emf model from annotated java. I was
able to follow the tutorial on generating an emf model from existing java
code with no problems.

Excited, and perhaps overly optimistic, I went through my existing code
base adding @model tags to everything that looked relevant. Afterward, I
followed the steps again, but this time no dice. Everything went exactly
as in the tutorial, but when I got to the "Package Selection" screen,
there was just an empty box.

I have tried all kinds of things, but nothing seems to work. Just for
grins, I tried importing a very simple java model and, again, it worked
fine. So, I'm thinking there is something simple I'm missing on the big
model. Any ideas?

Unfortunately, my company is pretty paranoid about its intellectual
property, so I can't attach any actual code. I know that's severely
limiting, but I was hoping someone has seen this already and knows "all
you have to do put the whatchamacallit on the whozit, click your heels
three times and sacrifice a free-range chicken." If this doesn't go
anywhere, I can try to fabricate an example that also doesn't work. It
occurs to me, though, that if I can successfully pull that off, I will
probably have figured out the solution.

Thanks,
Ashley

PS - I have searched the web and this newsgroup extensively and none of
those threads have helped.

PPS - I have a fresh installation as of about three days ago, so I'm
pretty sure it's not a stale software problem.

PPPS - Installations on both Windows XP and Mac OS X have resulted in the
exact same results (both successful and unsuccessful).
Re: No packages listed when importing from annotated java [message #431548 is a reply to message #431547] Wed, 15 July 2009 20:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ashley,

Comments below.

Ashley Williams wrote:
> Hi All,
>
> I am having trouble generating an emf model from annotated java. I was
> able to follow the tutorial on generating an emf model from existing
> java code with no problems.
> Excited, and perhaps overly optimistic, I went through my existing
> code base adding @model tags to everything that looked relevant.
> Afterward, I followed the steps again, but this time no dice.
> Everything went exactly as in the tutorial, but when I got to the
> "Package Selection" screen, there was just an empty box.
> I have tried all kinds of things, but nothing seems to work. Just for
> grins, I tried importing a very simple java model and, again, it
> worked fine. So, I'm thinking there is something simple I'm missing on
> the big model. Any ideas?
Perhaps there was some unexpected problem encountered. Did you check
the Error log?
>
> Unfortunately, my company is pretty paranoid about its intellectual
> property, so I can't attach any actual code. I know that's severely
> limiting, but I was hoping someone has seen this already and knows
> "all you have to do put the whatchamacallit on the whozit, click your
> heels three times and sacrifice a free-range chicken."
If you care to set it privately I can look at it but otherwise I need
something to go on to fix any lurking bugs.
> If this doesn't go anywhere, I can try to fabricate an example that
> also doesn't work. It occurs to me, though, that if I can successfully
> pull that off, I will probably have figured out the solution.
Yes, you might want do start with one file at a time...
>
> Thanks,
> Ashley
>
> PS - I have searched the web and this newsgroup extensively and none
> of those threads have helped.
>
> PPS - I have a fresh installation as of about three days ago, so I'm
> pretty sure it's not a stale software problem.
>
> PPPS - Installations on both Windows XP and Mac OS X have resulted in
> the exact same results (both successful and unsuccessful).
I'm happy to help if I can reproduce. At least if you can track down a
stack trace in the error log, I'd have some tea leaves to read.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: No packages listed when importing from annotated java [message #431565 is a reply to message #431548] Thu, 16 July 2009 19:40 Go to previous messageGo to next message
Ashley Williams is currently offline Ashley WilliamsFriend
Messages: 5
Registered: July 2009
Junior Member
Thanks for your offer. I have created the attached calculator which is
exhibiting the same behavior. The error log is included in the zip file
and listed below as well.
Thanks!
Ashley

PS - Can't seem to figure out how to attach a file. I'll post again when I
figure it out. Thanks!


java.lang.NullPointerException
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analy zeEnumLiteral(JavaEcoreBuilder.java:2087)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analy zeType(JavaEcoreBuilder.java:1145)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analy zeCompilationUnit(JavaEcoreBuilder.java:906)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:883)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:848)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:852)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:852)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:852)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analy zeProject(JavaEcoreBuilder.java:310)
at
org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.compu teEPackages(JavaEcoreBuilder.java:669)
at
org.eclipse.emf.importer.java.JavaImporter.doComputeEPackage s(JavaImporter.java:103)
at
org.eclipse.emf.importer.ModelImporter.computeEPackages(Mode lImporter.java:529)
at
org.eclipse.emf.importer.java.ui.JavaPackagePage.computeEPac kages(JavaPackagePage.java:108)
at
org.eclipse.emf.importer.java.ui.JavaPackagePage$2.execute(J avaPackagePage.java:83)
at
org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1800)
at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:118)
at
org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 944)
at
org.eclipse.emf.importer.java.ui.JavaPackagePage.computeEPac kages(JavaPackagePage.java:98)
at
org.eclipse.emf.importer.java.ui.JavaPackagePage$1.run(JavaP ackagePage.java:60)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3855)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3476)
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.executeHa ndler(WizardHandler.java:253)
at
org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
at
org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at
org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at
org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:241)
at
org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(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.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
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:194)
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:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.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: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Re: No packages listed when importing from annotated java [message #431566 is a reply to message #431565] Thu, 16 July 2009 19:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ashley,

If possible, please open a bugzilla. I'll also try to find out a
workaround for you so you can make progress without a fix. My guess
would be that you put @model in a class rather than an interface and
that the class isn't really going to map well to an EEnum...


Ashley Williams wrote:
> Thanks for your offer. I have created the attached calculator which is
> exhibiting the same behavior. The error log is included in the zip
> file and listed below as well.
> Thanks!
> Ashley
>
> PS - Can't seem to figure out how to attach a file. I'll post again
> when I figure it out. Thanks!
>
>
> java.lang.NullPointerException
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analy zeEnumLiteral(JavaEcoreBuilder.java:2087)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analy zeType(JavaEcoreBuilder.java:1145)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analy zeCompilationUnit(JavaEcoreBuilder.java:906)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:883)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:848)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:852)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:852)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.trave rse(JavaEcoreBuilder.java:852)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.analy zeProject(JavaEcoreBuilder.java:310)
>
> at
> org.eclipse.emf.importer.java.builder.JavaEcoreBuilder.compu teEPackages(JavaEcoreBuilder.java:669)
>
> at
> org.eclipse.emf.importer.java.JavaImporter.doComputeEPackage s(JavaImporter.java:103)
>
> at
> org.eclipse.emf.importer.ModelImporter.computeEPackages(Mode lImporter.java:529)
>
> at
> org.eclipse.emf.importer.java.ui.JavaPackagePage.computeEPac kages(JavaPackagePage.java:108)
>
> at
> org.eclipse.emf.importer.java.ui.JavaPackagePage$2.execute(J avaPackagePage.java:83)
>
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:106)
>
> at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1800)
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:118)
>
> at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:464)
>
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:372)
> at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 944)
> at
> org.eclipse.emf.importer.java.ui.JavaPackagePage.computeEPac kages(JavaPackagePage.java:98)
>
> at
> org.eclipse.emf.importer.java.ui.JavaPackagePage$1.run(JavaP ackagePage.java:60)
>
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)
>
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3855)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3476)
> 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.executeHa ndler(WizardHandler.java:253)
>
> at
> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>
> at
> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>
> at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
> at
> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
>
> at
> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
>
> at
> org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:241)
>
> at
> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>
> at
> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(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.ja va:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>
> 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:194)
>
> 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:368)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.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: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: No packages listed when importing from annotated java [message #431567 is a reply to message #431566] Thu, 16 July 2009 20:18 Go to previous messageGo to next message
Ashley Williams is currently offline Ashley WilliamsFriend
Messages: 5
Registered: July 2009
Junior Member
Curiously, there aren't any enums in my example model. BTW, I don't know
that this is necessarily a bug. It could just be user error. Should I open
a bugzilla case anyway?
Thanks,
Ashley
Re: No packages listed when importing from annotated java [message #431568 is a reply to message #431567] Thu, 16 July 2009 20:39 Go to previous messageGo to next message
Ashley Williams is currently offline Ashley WilliamsFriend
Messages: 5
Registered: July 2009
Junior Member
I created a bugzilla (283758) and attached the EMF model for your review.
Thanks,
Ashley
Re: No packages listed when importing from annotated java [message #431570 is a reply to message #431568] Fri, 17 July 2009 06:08 Go to previous messageGo to next message
Ashley Williams is currently offline Ashley WilliamsFriend
Messages: 5
Registered: July 2009
Junior Member
I got the basic (non-working) example to work. Going on the hint you
provided in your last post, I removed all the @model tags from all the
classes, leaving only the interfaces with tags. Running through the steps
again, everything worked fine.

I gather the reverse engineering only works on interfaces and enums. I
wonder if there is another tool that can do the same for classes too
(MoDisco?).

Cheers,
Ashley
Re: No packages listed when importing from annotated java [message #431583 is a reply to message #431570] Fri, 17 July 2009 15:04 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ashley,

I think MoDisco can create UML which you can map to Ecore, but
ultimately for any EClass, EMF will want to generate an interface and an
implementation class... I think that specifying @model kind="class"
will help convince it to map to an EClass, but as I said, it won't
generate a class in the end...


Ashley Williams wrote:
> I got the basic (non-working) example to work. Going on the hint you
> provided in your last post, I removed all the @model tags from all the
> classes, leaving only the interfaces with tags. Running through the
> steps again, everything worked fine.
>
> I gather the reverse engineering only works on interfaces and enums. I
> wonder if there is another tool that can do the same for classes too
> (MoDisco?).
>
> Cheers,
> Ashley
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] query server for existing repository
Next Topic:Distinguishing between XMIException
Goto Forum:
  


Current Time: Fri Apr 19 18:35:00 GMT 2024

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

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

Back to the top