sakaicontrib / mneme-project

Etudes Mneme Tool and additional projects.
0 stars 6 forks source link

mneme maintenance job error getTimedOutSubmissions #25

Open austin48 opened 6 years ago

austin48 commented 6 years ago

I see this error thousands of times when the menme maintenance runs. I believe it started happening due to adding the SendEmailOnSubmission stuff in the oxford changes.

13-Sep-2018 12:25:25.874 WARN [org.etudes.mneme.impl.SubmissionServiceImpl] org.etudes.mneme.impl.SubmissionServiceImpl.getTimedOutSubmissions Error getTimedOutSubmissions: java.lang.IllegalArgumentException Continue... getTimedOutSubmissions

java.lang.IllegalArgumentException at org.etudes.mneme.impl.AssessmentImpl.setSendEmailOnSubmission(AssessmentImpl.java:1866) at org.etudes.mneme.impl.AssessmentStorageSql$9.readSqlResultRecord(AssessmentStorageSql.java:1103) at org.sakaiproject.db.impl.BasicSqlService.dbRead(BasicSqlService.java:583) at org.sakaiproject.db.impl.BasicSqlService.dbRead(BasicSqlService.java:471) at org.etudes.mneme.impl.AssessmentStorageSql.readAssessments(AssessmentStorageSql.java:1052) at org.etudes.mneme.impl.AssessmentStorageSql.readAssessment(AssessmentStorageSql.java:1014) at org.etudes.mneme.impl.AssessmentStorageSql.getAssessment(AssessmentStorageSql.java:221) at org.etudes.mneme.impl.AssessmentServiceImpl.getAssessment(AssessmentServiceImpl.java:452) at org.etudes.mneme.impl.SubmissionAssessmentImpl.getAssessment(SubmissionAssessmentImpl.java:945) at org.etudes.mneme.impl.SubmissionAssessmentImpl.getTimeLimit(SubmissionAssessmentImpl.java:647) at org.etudes.mneme.impl.SubmissionServiceImpl.getTimedOutSubmissions(SubmissionServiceImpl.java:3519) at org.etudes.mneme.impl.SubmissionServiceImpl.run(SubmissionServiceImpl.java:2205) at java.lang.Thread.run(Thread.java:748)

austin48 commented 6 years ago

The exception occurs in

` public void setSendEmailOnSubmission(Boolean send) { if (send == null) throw new IllegalArgumentException();

    if (this.sendEmailOnSubmission.equals(send))
        return;
    this.sendEmailOnSubmission = send;
    this.changed.setChanged();
}`

where the throw new IllegalArgumentException(); pattern is seen in other mneme functions, it's not consistent. there are other functions that check for null and set it to false. e.g.

` public void setShowSummary(Boolean setting) { if (setting == null) { this.showSummary = Boolean.FALSE; return; } if (this.showSummary.equals(setting)) return;

    this.showSummary = setting;

    this.owner.setChanged();
}`

on my test server, I've tried changing the null check and setting the property to False and that seems to fix the exception. Hopefully, it won't affect anything else