PX Failure
Sometimes PX Fails and below is the message that can be seen in Monitor.
When the PX is re run again manually, it is successful.
(There are Update Title Block PX’s for Items)
This error occurs rarely. Can you please help me with the reasons for the 2 errors
Hi Raju,
This is pretty much normal scenario in Agile. It happens due to object lock which is created when code takes longer time to execute or multiple clicks performed to execute the code.
One way i handle this thing is to introduce a counter on number of re-tries you wanna do.
Something like this i tried in my code and it helped :
Sample
——————
catch (APIException e)
{
message = e.getMessage();
if (message.contains(“This object has been modified”)
|| message.contains(“Someone is working on this object”)) {
if (trynumber < 3) {
trynumber++;
Thread.sleep(THREAD_SLEEP_TIME);
//Call your code once again.
} else {
//verify the number of tries e.g. u can print try number.
// Call your code once again
}
} else {
//Send final failure message
}
Regards,
Arif
catch (APIException e)
{
obj.logMonitor(e.printStackTrace())
}
Used to throw null pointer sometimes and when px is re run it is successful.
I have changed it to
catch (APIException e)
{
obj.logMonitor(e.getMessage())
}
And i have observed 2 messages
1. object has been modified.
2.someone is working on this object.
Can this issue cause Nullpointer Exception?
please help me
I have only one catch block currently
Catch(APIException e )
{
obj.logMonitor(e.getMessage());
}
What could be the possible cases of Null pointer exception as the PX is successful when it is re run on same object.
Earlier in the catch block
It was obj.logMonitor(e.printStackTrace()) instead of obj.logMonior(e.getMessage())
Slightly off topic, but use of logging is recommended to actually capture the error as well as where in the source code line the error occurred ( %L in log4j ).
Since it’s hard to generate PX specific log file, a quick hack I used to generate a log for one specific PX was to setup log4j parameters dynamically within the PX code by
1) had a env or hardcoded location where the PX will first read a properties file that contain directives tied to log4j parmaters
2) programatically call the same log4j method
Example:
If log4j.properties are like this:
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=javalog.log
log4j.appender.file.MaxFileSize=100MB
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L – %m%n
You should have something in code to mimic it…. Note: make sure that you DO NOT create multiple loggers writing same log to the same file… create logger only once.
RollingFileAppender rfa = new RollingFileAppender();
rfa.setFile(“javalog.log”);
rfa.setThreshold(Level.DEBUG);
rfa.setMaxFileSize(“100MB”);
rfa.setLayout(new PatternLayout(“%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L – %m%n”));
I am facing the same issue and planning to implement counter method as suggested by Arif to handle it. But while investigating this error found metalink which suggest this issue has been taken care in version 9.3.6 URL:Someone is working on this object. Please try again later .
I am getting the same error and I know why its causing. In my case I have Event Px which works on Update Of Cover Page for Change Order and I have another PX which create ECO update descriptipn, updatede reason, add items, redlines etc… So whenver there is update for ECO cover page other px runs simultaneously and resulting in the error.
I was just curious if this issue is really fixed in 9.3.6. Please let me know whoever is working on 9.3.6
CAUSE
CMSessionBean.logUserDefinedActionWOVersionChange(…) was locking the object and the event was not recorded correctly.
This is explained on the following bug:
BUG:24293677 – EVENT:UPDATE TABLE BOM/MANUFACTURERS/ATTACHMENT NOT WORKING ON IEVENTDIRTYROW
SOLUTION
This issue is resolved in Agile PLM 9.3.6. Upgrade to Agile PLM 9.3.6 or above.