Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » NullPointerException during code-generation from UML Profile
NullPointerException during code-generation from UML Profile [message #1438301] Sun, 05 October 2014 21:47 Go to next message
Max Bureck is currently offline Max BureckFriend
Messages: 19
Registered: April 2013
Junior Member
Hi,

In Eclipse UPR we are trying to create static profile implementations of standardized UML profiles. When working on the BPMN profile a NullPointerException occurred during generation of EMF classes from the Profile. I will post a stack trace (using Luna SR 1) below. When debugging the problem I didn't immediately understand the root cause of the exception. But I can make the generation work when changing the variable "handlerURI" class XMLResourceImpl after line 302 to a non-null URI by using debugging tools. The actual class during runtime is EcoreResourceFactoryImpl$1. I will add an attachment with the profile in question. I would like to know if there is something fundamentally wrong with the model or if this is a bug in EMF. If something is wrong with the model, a different error message may be helpful.

Thank you very much,
Max

Here is the stack trace:

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.genmodel.presentation.GeneratorUIUtil$GeneratorOperation.execute(GeneratorUIUtil.java:178)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Re: NullPointerException during code-generation from UML Profile [message #1438482 is a reply to message #1438301] Mon, 06 October 2014 04:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Max,

Unfortunately it's a bug.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=445659

I'll get it fixed this week and it will be available as an update.

On 05/10/2014 11:47 PM, Max Bureck wrote:
> Hi,
>
> In Eclipse UPR we are trying to create static profile implementations of standardized UML profiles. When working on the BPMN profile a NullPointerException occurred during generation of EMF classes from the Profile. I will post a stack trace (using Luna SR 1) below. When debugging the problem I didn't immediately understand the root cause of the exception. But I can make the generation work when changing the variable "handlerURI" class XMLResourceImpl after line 302 to a non-null URI by using debugging tools. The actual class during runtime is EcoreResourceFactoryImpl$1. I will add an attachment with the profile in question. I would like to know if there is something fundamentally wrong with the model or if this is a bug in EMF. If something is wrong with the model, a different error message may be helpful.
>
> Thank you very much,
> Max
>
> Here is the stack trace:
>
> 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.genmodel.presentation.GeneratorUIUtil$GeneratorOperation.execute(GeneratorUIUtil.java:178)
> at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
> at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
> at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: NullPointerException during code-generation from UML Profile [message #1438561 is a reply to message #1438482] Mon, 06 October 2014 07:55 Go to previous message
Max Bureck is currently offline Max BureckFriend
Messages: 19
Registered: April 2013
Junior Member
Hi Ed,
Thanks for taking care of this! I didn't see this bug entry.

Cheers,
Max
Previous Topic:Detecting problem marker update completion
Next Topic:Load ecore metamodel in eclipse runtime
Goto Forum:
  


Current Time: Thu Apr 25 23:07:41 GMT 2024

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

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

Back to the top