Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Papyrus Java Code Generation(I'm unable to generate Java code from Papyrus model)
Papyrus Java Code Generation [message #1777756] Mon, 04 December 2017 10:18 Go to next message
Jan Celmer is currently offline Jan CelmerFriend
Messages: 7
Registered: November 2017
Junior Member
Hi all,

for the papyrus java code generation I've followed :
(from youtube but it was not possible to paste the link: You can only use links to eclipse.org sites while you have fewer than 1 message.) watch?v=AXPDvAjv_NY
(idem) watch?v=mBzNww_3qtM]
and finally https://wiki.eclipse.org/java_code_generation

but in any case I'm unable to see the code. I'm on eclispe neon.3, with the latest version plugins from the tutorials (no other explicitly installed) and even if the java project is created, there is no source code. Do you have any advice what might be missing in the configuration? Thank you!
Re: Papyrus Java Code Generation [message #1777858 is a reply to message #1777756] Tue, 05 December 2017 12:17 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

could you please have a look at the "Error Log" and tell us, if there are any exceptions? Can you also tell us, which version of Papyrus and software designer you use?

When you say, that "even if the java project is created ...", does it mean that the project gets created, but you don't see generated source code files inside?
Re: Papyrus Java Code Generation [message #1777936 is a reply to message #1777858] Wed, 06 December 2017 12:04 Go to previous messageGo to next message
Jan Celmer is currently offline Jan CelmerFriend
Messages: 7
Registered: November 2017
Junior Member
Hi Ansgar,

The plug-ins are in the attached file. I've Papyrus UML 2.0.3 and I use Papyrus Java Code generation for Papyrus 1.0.5.

If you have any other questions, please write. Thanks a lot!

Jna

P.S. And yes, it means that Java project file with Java library was created but src folder was empty.

That's the log:
The following will be send to: Eclipse


REPORT

name
email
comment
eclipseBuildId 4.6.3.M20170301-0400
eclipseProduct org.eclipse.epp.package.java.product
javaRuntimeVersion 1.8.0_152-b16
osgiWs win32
osgiOs Windows7
osgiOsVersion 6.1.0
osgiArch x86_64
severity UNKNOWN


STATUS

pluginId org.eclipse.ui
pluginVersion 3.108.1.v20160929-1045
code 0
severity 4
message Unhandled event loop exception
fingerprint 35de241c7baa08d8d57d5c961a2dd726

Exception:java.lang.NoSuchMethodError: org.eclipse.xtend2.lib.StringConcatenation.append(Ljava/lang/String;Ljava/lang/String;)V
at org.eclipse.papyrus.designer.languages.java.codegen.xtend.JavaClassifierGenerator.generateClassCode(JavaClassifierGenerator.java:48)
at org.eclipse.papyrus.designer.languages.java.codegen.transformation.JavaModelElementsCreator.generateClassifier(JavaModelElementsCreator.java:185)
at org.eclipse.papyrus.designer.languages.java.codegen.transformation.JavaModelElementsCreator.createPackageableElementFile(JavaModelElementsCreator.java:157)
at org.eclipse.papyrus.designer.languages.common.base.ModelElementsCreator.createPackageableElement(ModelElementsCreator.java:156)
at org.eclipse.papyrus.designer.languages.java.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:82)
at org.eclipse.papyrus.designer.languages.java.codegen.ui.handlers.GenerateCodeHandler.generate(GenerateCodeHandler.java:89)
at org.eclipse.papyrus.designer.languages.java.codegen.ui.handlers.GenerateCodeHandler.execute(GenerateCodeHandler.java:121)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(null:-2)
at sun.reflect.NativeMethodAccessorImpl.invoke(null:-1)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
at java.lang.reflect.Method.invoke(null:-1)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:282)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:433)
at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:454)
at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem$3.handleEvent(AbstractContributionItem.java:482)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(null:-2)
at sun.reflect.NativeMethodAccessorImpl.invoke(null:-1)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
at java.lang.reflect.Method.invoke(null:-1)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)


BUNDLES

name org.eclipse.core.commands
version 3.8.1.v20161221-1651

name org.eclipse.core.databinding.observable
version 1.6.0.v20160511-1747

name org.eclipse.core.databinding
version 1.6.0.v20160412-0910

name org.eclipse.core.runtime
version 3.12.0.v20160606-1342

name org.eclipse.e4.core.commands
version 0.11.100.v20160506-0804

name org.eclipse.e4.core.contexts
version 1.5.1.v20170203-1100

name org.eclipse.e4.core.di
version 1.6.1.v20160712-0927

name org.eclipse.e4.ui.workbench
version 1.4.0.v20160517-1624

name org.eclipse.e4.ui.workbench.renderers.swt
version 0.14.1.v20170117-1415

name org.eclipse.e4.ui.workbench.swt
version 0.14.1.v20160829-0832

name org.eclipse.equinox.app
version 1.3.400.v20150715-1528

name org.eclipse.equinox.launcher
version 1.3.201.v20161025-1711

name org.eclipse.papyrus.designer.languages.common.base
version 1.0.5

name org.eclipse.papyrus.designer.languages.java.codegen
version 1.0.5

name org.eclipse.papyrus.designer.languages.java.codegen.ui
version 1.0.5

name org.eclipse.swt
version 3.105.3.v20170228-0512

name org.eclipse.ui
version 3.108.1.v20160929-1045

name org.eclipse.ui.ide.application
version 1.1.101.v20160829-0827

name org.eclipse.ui.ide
version 3.12.3.v20170119-0935


Extended Classpath Analysis

The problematic package 'org.eclipse.xtend2.lib' may originate in the following bundles:
org.eclipse.xtext.xbase.lib 2.10.0.v201605250459, imported by:
org.eclipse.papyrus.designer.languages.java.codegen 1.0.5
Re: Papyrus Java Code Generation [message #1778149 is a reply to message #1777936] Mon, 11 December 2017 10:11 Go to previous messageGo to next message
Shuai Li is currently offline Shuai LiFriend
Messages: 20
Registered: March 2016
Location: Paris Saclay, France
Junior Member
Hi,

Can you try installing Xtend 2.12?
Re: Papyrus Java Code Generation [message #1778339 is a reply to message #1778149] Wed, 13 December 2017 09:36 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Please note that version 1.0.5 targets the oxygen version of Papyrus, , but it's possible to install it on neon. This is is a bug, since for instance the example install from Papyrus 3.x is required.
So, can you please either try to upgrade to oxygen or install version 1.0.4 of designer. You can do the latter by adding a "/neon" to the designer update site, i.e. use http://download.eclipse.org/modeling/mdt/papyrus/components/designer/neon
Re: Papyrus Java Code Generation [message #1778443 is a reply to message #1778339] Thu, 14 December 2017 10:02 Go to previous messageGo to next message
Jan Celmer is currently offline Jan CelmerFriend
Messages: 7
Registered: November 2017
Junior Member
Thanks a lot Ansgar! After upgrading to Oxygen it worked.
I have one more Papyrus question not related to the head topic. I try to play a bit with MDA paradigm and I'm looking for some open-source projects or plug-ins that would help me to generate at once Java code and Hibernate/Spring interface for DB communication. Can Papyrus support both? If yes, which plug-in to use (after some google research I still haven't found a satisfying answer). Otherwise, do you know any tool which supports both? Thanks once again for your help.
Re: Papyrus Java Code Generation [message #1778512 is a reply to message #1778443] Fri, 15 December 2017 13:24 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
There is currently no support for generating Hibernate/Spring in Papyrus SW designer - unless you volunteer doing it, it is extensible ;-). I'm not aware of a tool supporting this, but haven't really done an in-depth search.
Re: Papyrus Java Code Generation [message #1778556 is a reply to message #1778443] Sun, 17 December 2017 14:22 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 137
Registered: May 2015
Location: Germany
Senior Member
Hi Jan,

to experiment with MDA I would rather suggest building your own model to text transformer using Obeo Eclipse Acceleo (https://www.eclipse.org/acceleo/). While being not as powerful as XPand/XTend Obeo Eclipse Acceleo as an OMG M2T (http://www.omg.org/spec/MOFM2T/About-MOFM2T/) processor is IMHO easier to learn. If you experience serious limitations, you can either extend the Papyrus Java code generator or build your own custom generators with XPand/Xtext. Acceleo scripts tend to require more compute time to execute than XPand/Xtend generators. If the generator performance becomes an serious issue, then you can switch and reuse the transformation rules. In this case Acceleo has done a good job as a RAD (Rapid Application Development) tool ;-)

/pica

[Updated on: Sun, 17 December 2017 14:26]

Report message to a moderator

Re: Papyrus Java Code Generation [message #1778557 is a reply to message #1778512] Sun, 17 December 2017 14:31 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 137
Registered: May 2015
Location: Germany
Senior Member
Compuware OptimalJ was a MDA tool that also generated OR-Mapper artifacts. But this tools was discontinued in 2008.

/pica
Re: Papyrus Java Code Generation [message #1779240 is a reply to message #1777756] Thu, 04 January 2018 09:54 Go to previous message
Jan Celmer is currently offline Jan CelmerFriend
Messages: 7
Registered: November 2017
Junior Member
Thanks a lot for your help Ansgar and Carsten!
Sorry for the delay in answering but it seems I haven't received any notification or I've missed it.
I'll try to play a bit more with the technologies.
Happy New Year 2018 :)
Previous Topic:Extension point in UseCase node
Next Topic:Java Code to UML Class Diagram
Goto Forum:
  


Current Time: Mon Sep 24 13:02:20 GMT 2018

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

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

Back to the top