Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Xcore 100 EClassifier limit?(Xcore file with over 100 EClassifiers doesn't generate MyFactory.java, MyPackage.java, impls, and mystuff.util)
Xcore 100 EClassifier limit? [message #1455743] Wed, 29 October 2014 18:08 Go to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
I have a .xcore file with 113 entries (class + enum + interface). When I save it (after making changes) or clean and rebuild, I get nothing in the mypkg.util package (i.e. the AdapterFactory and Switch don't get generated), and MyFactory.java, MyPackage.java, MyFactoryImpl.java and MyPackageImpl.java don't get generated.

Turns out that if I get rid of 13 of those entries everything generates ok. And then if I add just one back, the files mentioned above disappear and I get compile errors all over the place.

Is this a known problem? Is there a workaround (like using multiple .xcore files or splitting into subpackages or something)?

Thanks for the help.
Re: Xcore 100 EClassifier limit? [message #1455754 is a reply to message #1455743] Wed, 29 October 2014 18:21 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
Something else is going on. I just created a toy .xcore file with 101 empty classes. Everything gens correctly. I'll get back with an update when I know more.
Re: Xcore 100 EClassifier limit? [message #1455787 is a reply to message #1455754] Wed, 29 October 2014 19:08 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
Ok, there doesn't seem to be a 100 EClassifier limit. It's a 500 ENamedElement limit.

I just created several test .xcore files. One, with 500 class entries. All generates well. Add the 501st class and generation of Factory, Package, and .util fails. But don't add the 501st class. Stick with 500 classes and add a single attribute to any one of them. Gen fails again.

Another, with 100 class entries, each of which has 4 attributes. All generates well. Add the 101st class (an empty one) and gen fails. Leave it in and comment out one of the attributes on one of the other classes and gen works again.

So are there any suggestions on how I can proceed with my excessively large .xcore file for my doesn't-seem-so-large project?

Thanks
Re: Xcore 100 EClassifier limit? [message #1456565 is a reply to message #1455787] Thu, 30 October 2014 13:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Erick,

Please open a bugzilla with an Xcore instance that reproduces the
problem so I can have a look. Also have a look in the Error Log; likely
there's a clue there about what's gone wrong. I suspect it's a bug
that's been fixed in the in the pre-SR2 maintenance stream, so please
first try updating from
http://download.eclipse.org/modeling/emf/emf/updates/2.10.x to pick up
that fix. Alternatively, try setting "Initialize by Loading" to fast in
the properties view when you have the package declaration of the *.xcore
selected; hopefully that doesn't generate class files that have too much
byte code, but also should avoid this problem, if my theory is correct.


On 29/10/2014 8:08 PM, Erick Hagstrom wrote:
> Ok, there doesn't seem to be a 100 EClassifier limit. It's a 500
> ENamedElement limit.
>
> I just created several test .xcore files. One, with 500 class entries.
> All generates well. Add the 501st class and generation of Factory,
> Package, and .util fails. But don't add the 501st class. Stick with
> 500 classes and add a single attribute to any one of them. Gen fails
> again.
>
> Another, with 100 class entries, each of which has 4 attributes. All
> generates well. Add the 101st class (an empty one) and gen fails.
> Leave it in and comment out one of the attributes on one of the other
> classes and gen works again.
>
> So are there any suggestions on how I can proceed with my excessively
> large .xcore file for my doesn't-seem-so-large project?
>
> Thanks


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Xcore 100 EClassifier limit? [message #1456648 is a reply to message #1456565] Thu, 30 October 2014 15:25 Go to previous message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
Thanks Ed, always a pleasure to hear from you.

I opened bugzilla #449370 for this.

You are correct, the update fixes the problem.

Prior to updating, Initialize by Loading -> false also fixed the problem.

The error log reveals a NPE in GenPackageGeneratorAdapter.java. More specifically,

*** Begin Error Log ***
!ENTRY org.eclipse.emf.codegen.ecore 2 0 2014-10-30 10:54:06.609
!MESSAGE
!STACK 0
java.lang.NullPointerException
at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter$3.redirect(GenPackageGeneratorAdapter.java:483)
at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter$3.setBaseURI(GenPackageGeneratorAdapter.java:534)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:401)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(ResourceImpl.java:1144)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:985)
at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generatePackageSerialization(GenPackageGeneratorAdapter.java:544)
at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generateModel(GenPackageGeneratorAdapter.java:213)
at org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:215)
at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generate(AbstractGeneratorAdapter.java:317)
at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:708)
at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:619)
at org.eclipse.emf.ecore.xcore.generator.XcoreGenerator.generateGenModel(XcoreGenerator.java:279)
at org.eclipse.emf.ecore.xcore.generator.XcoreGenerator.doGenerate(XcoreGenerator.java:227)
at org.eclipse.xtext.builder.BuilderParticipant.handleChangedContents(BuilderParticipant.java:515)
at org.eclipse.emf.ecore.xcore.ui.builder.XcoreBuildParticipant.handleChangedContents(XcoreBuildParticipant.java:135)
at org.eclipse.xtext.builder.BuilderParticipant.handleChangedContents(BuilderParticipant.java:505)
at org.eclipse.xtext.builder.BuilderParticipant.doGenerate(BuilderParticipant.java:490)
at org.eclipse.xtext.builder.BuilderParticipant.doBuild(BuilderParticipant.java:259)
at org.eclipse.xtext.builder.BuilderParticipant.build(BuilderParticipant.java:217)
at org.eclipse.emf.ecore.xcore.ui.builder.XcoreBuildParticipant.build(XcoreBuildParticipant.java:48)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant$DeferredBuilderParticipant.build(RegistryBuilderParticipant.java:158)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:68)
at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:196)
at org.eclipse.xtext.builder.impl.XtextBuilder.incrementalBuild(XtextBuilder.java:171)
at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:99)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
*** End Error Log ***

Sounds like you have a good handle on this issue, so I'll consider it closed. Thanks!
Previous Topic:[CDO] uri of repository resource
Next Topic:[CDO] [EMF] undo redo issue with CDOObject modification
Goto Forum:
  


Current Time: Thu Mar 28 21:28:47 GMT 2024

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

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

Back to the top