cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Java NullpointerException when getting the representation

BernardWielfaer
12-Amethyst

Java NullpointerException when getting the representation

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

ACCEPTED SOLUTION

Accepted Solutions

Found it, there was no representation...

Should really give no exeption just a null result.

View solution in original post

3 REPLIES 3
LoriSood
22-Sapphire III
(To:BernardWielfaer)

Has the RepresentationHelper object been initialized?

Found it, there was no representation...

Should really give no exeption just a null result.

KD
12-Amethyst
12-Amethyst
(To:BernardWielfaer)

Hi Bernard,

You can try the following method.

VisualizationHelper vzh = VisualizationHelper.newVisualizationHelper();

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

Thanks and Regards,

Kaushik

Announcements


Top Tags