Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Code generation not enabled(Unable to generate java code from UML class diagram even after installation of java code generation component )
Code generation not enabled [message #1796338] Thu, 11 October 2018 08:08 Go to next message
Miss Aleena is currently offline Miss AleenaFriend
Messages: 2
Registered: October 2018
Junior Member

I cannot generate java code from UML class diagram even after installation of java code generation component .

I am having Eclipse Committers-photon on window 10 pro. I installed Papyrus Photon(4.0.0): I also installed java feature: from
and was also able to import profile and primitives and followed all steps on that page. But after right clicking the diagram and selecting ( designer-> generate code ) it showed that

"This operation is not enabled"

And just after doing this when i am again right clicking the diagram and searching the option ( designer-> generate code ) so it is not there in drop-down.

Also when i was adding stereotypes on class name, its property, and its operation, it was showing multiple stereotypes for each of them.

I created a UML class diagram on eclipse-luna installed on my university's pc and its code generated perfectly but when i opened that file on committers-photon on my laptop it showed window named Repair Stereotypes*. On that window it was written "For each missing profile definition, select an action to correct the problem". It showed problems in 2 resources:

- first resource was having issue with profile:
"(java) - unknown schema"

- second resource was having issue with Count:
"2 dangling stereotypes"

After applying recommended actions it showed "Problem in Repairing stereotypes". It was written that "actions could not be completed". Details were:

Definition for class '{EPackage}::JavaClass' not found
Definition for class '{EPackage}::JavaProperty' not found
Definition for class '{EPackage}::javaMethod' not found

I have attached the zip folder containing screenshots of the windows.

Any advice would be very helpful.

Re: Code generation not enabled [message #1796530 is a reply to message #1796338] Mon, 15 October 2018 19:12 Go to previous message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 229
Registered: March 2011
Location: Paris Saclay, France
Senior Member

the first issue (command not enabled) is caused by the lazy class loading of the Eclipse environment. The "generate code" menu entry depends on a condition defined in a Java class, but as long as the class in not loaded, the menu entry is always visible. But it might fail with the mentioned error message, if you click on it. In this concrete case, the condition is that either a package or a classifier is selected (i.e. not the diagram itself, but one of the two elements either in the diagram or model explorer).

Concerning the 2nd issue: the luna version is very old and the Java profile is quite different today. In particular, the stereotypes JavaClass, JavaProperty and JavaMethod do not exist any more (as they are not required).
Previous Topic:Code generation from a transformed model
Next Topic:Papyrus Oxygen Alf Editor
Goto Forum:

Current Time: Wed Jan 29 12:27:48 GMT 2020

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

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

Back to the top