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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

create a changeissue with a jsp

MartinKaistra
1-Visitor

create a changeissue with a jsp

Hello,

I am trying to create a change issue with the following code and then create a link to an Object. The creation of the change issue itself works and it gets stored in the database. But when I add the code for the link I get an error

wt.util.WTRuntimeException: ERROR: Can't initialize an ObjectReference to null

The code is:

ReferenceFactory rf = new ReferenceFactory();
WTChangeIssue issue1 = WTChangeIssue.newWTChangeIssue(name);
WTReference ref = rf.getReference(obid);
ChangeIssue ci = (ChangeIssue)ChangeHelper2.service.saveChangeIssue(issue1);
ReportedAgainst ra = ReportedAgainst.newReportedAgainst((Changeable2) ref.getObject(), ci);
wt.fc.collections.WTArrayList al = new wt.fc.collections.WTArrayList();
al.add(ra);
ChangeHelper2.service.storeAssociations(issue1, al);

If you need to know aditional things, let me know. The last line of code is the one, that is giving me the error (at least the error is not there without this line).

1 REPLY 1

My question got answered on ptcuser.org

It works when I insert this line:

PersistenceServerHelper.manager.insert(ra);

before calling storeAssociations.

Announcements


Top Tags