Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Error while generating model
Error while generating model [message #636233] Fri, 29 October 2010 19:21 Go to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Hi All,

I had an existing model which was working fine.
I made some changes to the ecore, now when i try to generate the model code.
I get 'Problem encountered while generating model code'.

This is what i get in the stack trace


!ENTRY org.eclipse.emf.codegen.ecore 2 0 2010-10-30 00:39:51.564
!MESSAGE org.eclipse.emf.common.util.DiagnosticException: A problem was detected while parsing a Java file
!STACK 0
org.eclipse.emf.common.util.WrappedException: org.eclipse.emf.common.util.DiagnosticException: A problem was detected while parsing a Java file
	at org.eclipse.emf.codegen.merge.java.facade.ast.ASTFacadeHelper.createCompilationUnit(ASTFacadeHelper.java:285)
	at org.eclipse.emf.codegen.merge.java.facade.ast.ASTFacadeHelper.createCompilationUnit(ASTFacadeHelper.java:1)
	at org.eclipse.emf.codegen.merge.java.JMerger.createCompilationUnitForContents(JMerger.java:381)
	at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:998)
	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter.generateInterface(GenClassGeneratorAdapter.java:123)
	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter.generateModel(GenClassGeneratorAdapter.java:106)
	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:221)
	at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generate(AbstractGeneratorAdapter.java:290)
	at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:617)
	at org.eclipse.emf.codegen.ecore.genmodel.presentation.GeneratorUIUtil$GeneratorOperation.execute(GeneratorUIUtil.java:167)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)



I reverted the changes made to the model, but still getting the same error.I ran the validation check on the model its not reporting any errors.I am clueless as what is happening

Thanks and Regards,
Saurav


Re: Error while generating model [message #636237 is a reply to message #636233] Fri, 29 October 2010 19:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Saurav,

It sounds like it's generating something with a syntax error or what
it's merging has a syntax error. Not clear why though. In the former
case, you could delete all the files and see which one ends up having a
syntax error...


saurav wrote:
> Hi All,
>
> I had an existing model which was working fine.
> I made some changes to the ecore, now when i try to generate the model
> code.
> I get 'Problem encountered while generating model code'.
>
> This is what i get in the stack trace
>
>
>
> !ENTRY org.eclipse.emf.codegen.ecore 2 0 2010-10-30 00:39:51.564
> !MESSAGE org.eclipse.emf.common.util.DiagnosticException: A problem
> was detected while parsing a Java file
> !STACK 0
> org.eclipse.emf.common.util.WrappedException:
> org.eclipse.emf.common.util.DiagnosticException: A problem was
> detected while parsing a Java file
> at
> org.eclipse.emf.codegen.merge.java.facade.ast.ASTFacadeHelpe r.createCompilationUnit(ASTFacadeHelper.java:285)
>
> at
> org.eclipse.emf.codegen.merge.java.facade.ast.ASTFacadeHelpe r.createCompilationUnit(ASTFacadeHelper.java:1)
>
> at
> org.eclipse.emf.codegen.merge.java.JMerger.createCompilation UnitForContents(JMerger.java:381)
>
> at
> org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAda pter.generateJava(AbstractGeneratorAdapter.java:998)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter.generateInterface(GenClassGeneratorAdapter.jav a:123)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGen eratorAdapter.generateModel(GenClassGeneratorAdapter.java:10 6)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGene ratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:221)
>
> at
> org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAda pter.generate(AbstractGeneratorAdapter.java:290)
>
> at
> org.eclipse.emf.codegen.ecore.generator.Generator.generate(G enerator.java:617)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.presentation.Generato rUIUtil$GeneratorOperation.execute(GeneratorUIUtil.java:167)
>
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:106)
>
> at
> org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1975)
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:118)
>
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>
>
>
>
> I reverted the changes made to the model, but still getting the same
> error.I ran the validation check on the model its not reporting any
> errors.I am clueless as what is happening
>
> Thanks and Regards,
> Saurav


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Error while generating model [message #636238 is a reply to message #636233] Fri, 29 October 2010 19:44 Go to previous messageGo to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Thanks Ed for the reply.

I was reluctant to delete the model classes since i was depending on them heavily Razz

anyways i took a backup and deleted the files and generated them again ...very strangely the class comment section is generating with an extra '*/', that makes the syntax error.
I am sure i did not touch any templates Razz

Now i removed the syntaxes and the test cases work fine.But i am circumspect that this problem remains.

cheers,
Saurav


Re: Error while generating model [message #636258 is a reply to message #636238] Fri, 29 October 2010 21:58 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Saurav,

That's very strange. I can't imagine how that would happen, except
maybe if you have a model documentation annotation that has such an
extra pair of characters...


saurav wrote:
> Thanks Ed for the reply.
>
> I was reluctant to delete the model classes since i was depending on
> them heavily :p
> anyways i took a backup and deleted the files and generated them again
> ...very strangely the class comment section is generating with an
> extra '*/', that makes the syntax error.
> I am sure i did not touch any templates :p
>
> Now i removed the syntaxes and the test cases work fine.But i am
> circumspect that this problem remains.
>
> cheers,
> Saurav
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] cdoPrefetch() Timeout
Next Topic:itemProviderAdapterFactories
Goto Forum:
  


Current Time: Tue Apr 23 17:16:12 GMT 2024

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

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

Back to the top