Skip to main content
1-Visitor
September 6, 2013
Solved

Java NullpointerException when getting the representation

  • September 6, 2013
  • 2 replies
  • 2588 views

Hi,

I get an error (java.lang.NullPointerException) when executing the following lines at :

Representation rep = RepresentationHelper.Service.getDefaultRepresentation(CurrEPM)

This is the code :

Snap3.png

When I request info from the EPMDocument (CurrEPM) like this :

TracePath = TracePath + "\n" + "+2.2 " + "Number: " + CurrEPM.getNumber() + " Name: " + CurrEPM.getName() + " Status: " + CurrEPM.getLifeCycleState.toString() + " Version: " + CurrEPM.getVersionIdentifier().getValue() + " Iteration: " + CurrEPM.getIterationIdentifier().getValue();

I get :

+2.2 Number: M000056923.DRW Name: FOLDER PLATE Status: DESIGN Version: B Iteration: 1

Best answer by BernardWielfaer

Found it, there was no representation...

Should really give no exeption just a null result.

2 replies

23-Emerald II
September 6, 2013

Has the RepresentationHelper object been initialized?

BernardWielfaer1-VisitorAuthorAnswer
1-Visitor
November 15, 2013

Found it, there was no representation...

Should really give no exeption just a null result.

12-Amethyst
September 9, 2013

Hi Bernard,

You can try the following method.

VisualizationHelper vzh = VisualizationHelper.newVisualizationHelper();

Representation rep = vzh.getRepresentation((Persistable) epmDoc);

Thanks and Regards,

Kaushik