Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I get an error (java.lang.NullPointerException) when executing the following lines at :
This is the code :
PromotionNotice notice = (wt.maturity.PromotionNotice)pr;
StandardMaturityService service = StandardMaturityService.newStandardMaturityService();
QueryResult results = service.getPromotionTargets(notice);
if (results != null)
{
while (results.hasMoreElements())
{
MyObject = (Versioned)results.nextElement();
if (MyObject instanceof EPMDocument)
{
CurrEPM = (EPMDocument) MyObject;
if (CurrEPM.getDocType().getStringValue().equals("wt.epm.EPMDocumentType.CADDRAWING"))
{
// Get the time = now - x hours (x is comming from xml file)
long modTime = 0;
TracePath = TracePath + "\n" + "- docmodtime: " + docmodtime;
long modifiedTime = Long.parseLong(docmodtime);
modTime = currentTime - modifiedTime * 60L * 60L * 1000L;
Timestamp modstamp = new Timestamp(modTime);
// Check if the drawing last change is older than x hours
PersistInfo PerInfo = CurrEPM.getPersistInfo();
// If last modification timestamp of drawing is before the date limit (e.g. now - 3000 hours) then the drawing has not been copyed yet
if (PerInfo.getModifyStamp().before(modstamp))
{
// The modification time of the drawings is before that time, the plot file must be copied
TracePath = TracePath + "\n" + "+2.2 " + "Number: " + CurrEPM.getNumber() + " Name: " + CurrEPM.getName() + " Status: " + CurrEPM.getLifeCycleState().toString() + " Version: " + CurrEPM.getVersionIdentifier().getValue() + " Iteration: " + CurrEPM.getIterationIdentifier().getValue();
<-------
........
TrcaPath =
Simon,
The same error occurs, could this be due to the fact that there is no representation yet ?
Regards,
Bernard
The problem occurs when there is no representation, as soon there is one the function executes and returns result.
One would suppose that when there is no representation that it returns NULL, but apparently this one not.