Hello all,
I have the following stack trace during updating my appointment in Java:
java.lang.NullPointerException
at lotus.domino.cso.Document.putUpdates(Unknown Source)
at lotus.domino.cso.Document.sendUpdates(Unknown Source)
at lotus.domino.cso.Document.send(Unknown Source)
at lotus.domino.cso.Document.send(Unknown Source)
at FTSEARCH.synchro.domino.DominoAppointment.sendUpdateNotice(DominoAppointment.java:1004)
at FTSEARCH.synchro.domino.DominoAppointment.save(DominoAppointment.java:645)
at com.edeal.frontline.synchro.SyncManagerWorker.run(SyncManagerWorker.java:330)
at com.edeal.frontline.synchro.SyncManagerWorker.run(SyncManagerWorker.java:297)
It’s very strange, I have read in internet the problem can come from http://www-10.lotus.com/ldd/46dom.nsf/CategoryAllThreadedweb/bfb1239aff6e114885256e1c005cdced?OpenDocument
I’m not sure, but any one have an idea ? My code below:
DominoAppointment appt = (DominoAppointment) session.getFactory().createAppointment();
String canocalValue = getCanonicalNameByEmailAddress(session.getUser().getActor().getActMail());
String organizer = getOrganizer();
// Set meeting info
appt.setStartDate(getStartDate());
appt.setEndDate(getEndDate());
appt.setNotes(getNotes());
appt.setLocation(getLocation());
appt.setOrganizer(organizer);
appt.setContacts(getContacts());
Vector newParticipants = getParticipants();
if (newParticipants == null) {
newParticipants = new Vector();
}
newParticipants.removeAll(participsToUninvite);
appt.setParticipants(newParticipants);
appt.setPrivate(isPrivate());
appt.setSubject(getSubject());
Document docUpdate = appt.doc;
// TODO - Implement uninvite of Optional Attendees
appt.setDominoParticipants(newParticipants, new Vector());
appt.setDominoContactsWithParticipants();
// C&S information
int seqNum = doc.getItemValueInteger(DominoConstants.APPOINTMENT_SEQUENCE_NUM_FIELD);
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_SEQUENCE_NUM_FIELD, new Integer(seqNum));
docUpdate.replaceItemValue("UpdateSeq", new Integer(seqNum));
// Document backend/mailing values
docUpdate.replaceItemValue(DominoConstants.FORM_FIELD, DominoConstants.NOTICE_FORM_NAME);
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_UNID_FIELD, doc.getUniversalID());
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_TYPE_FIELD, "3");
docUpdate.replaceItemValue("From", canocalValue);
// Sequence numbers for the subject, location and notes
docUpdate.replaceItemValue("$CSWISL", doc.getItemValue("$CSWISL"));
docUpdate.replaceItemValue("$WatchedItems", doc.getItemValue("$WatchedItems"));
// Remove the organizer from the update list, just to be sure
updateList.remove(organizer);
// Set the sendTo field to be the list we calculdated in save()
Vector vEpureMail = new Vector();
for (int i = 0; i < updateList.size(); i++) {
String email = (String) updateList.elementAt(i);
if (email != null) {
String domain = getDomainNameByEmailAddress(email);
String canonical = getCanonicalNameByEmailAddress(email);
if (canonical != null) {
String epure = epureCanonicalName(canonical);
if (epure != null) {
vEpureMail.addElement(epure + "@" + domain);
}
}
}
}
Object epureValue=null;
if (vEpureMail.size()>0) {
if (vEpureMail.size() > 1) {
epureValue = vEpureMail;
} else {
epureValue = vEpureMail.elementAt(0).toString();
}
}
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_SEND_TO_FIELD, epureValue);
String subject = getSubject();
/*
* The notification is different based on what information has changed.
* If the date or time has changed, all participants must re-accept or decline.
* If the subject, body or location has changed, this notice is just a FYI.
*/
if (hasDateTimeChanged) {
String location = getLocation();
SimpleDateFormat sdf = new SimpleDateFormat("d MMM HH:mm z");
StringBuffer subjectBuf = new StringBuffer(Utils.getMessage(session.getEdealContext(), actLang, "L6613", false, true, "Rescheduled:") + " ");
subjectBuf.append(subject);
subjectBuf.append(" (");
subjectBuf.append(sdf.format(getStartDate()));
if (location != null && !"".equals(location)) {
subjectBuf.append(" in ");
subjectBuf.append(location);
}
subjectBuf.append(")");
docUpdate.replaceItemValue("_ViewIcon", new Integer(33));
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_NOTICE_TYPE, "U");
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_SUBJECT_FIELD, subjectBuf.toString());
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_TOPIC_FIELD, subject);
} else {
FlContext context = session.getEdealContext();
int changeCount = 0;
String prefix = Utils.getMessage(context, actLang, "L6614", false, true, "Information Update -") + " ";
String addon = "";
if (hasSubjectChanged) {
++changeCount;
addon = prefix + Utils.getMessage(context, actLang, "L6615", false, true, "Subject has changed:");
}
if (hasLocationChanged) {
++changeCount;
addon = prefix + Utils.getMessage(context, actLang, "L6616", false, true, "Location has changed:");
}
if (hasNotesChanged) {
++changeCount;
addon = prefix + Utils.getMessage(context, actLang, "L6617", false, true, "Description has changed:");
}
if (changeCount > 1) {
addon = prefix + Utils.getMessage(context, actLang, "L6618", false, true, "There are multiple changes:");
}
docUpdate.replaceItemValue("_ViewIcon", new Integer(11));
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_NOTICE_TYPE, "E");
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_SUBJECT_FIELD, addon + " " + subject);
docUpdate.replaceItemValue(DominoConstants.APPOINTMENT_TOPIC_FIELD, subject);
}
// The meeting type must be changed if there we add/remove participants
AppointmentType meetingType = setNewMeetingType();
setFieldValue(DominoConstants.APPOINTMENT_VIEW_ICON_FIELD, meetingType.getDominoIconNum());
// Remove this field, otherwise the notification shows up in the calendar
docUpdate.removeItem(DominoConstants.APPOINTMENT_START_DATE_FIELD_1);
if (isRecurring()) {
docUpdate.replaceItemValue("ApptUNID", doc.getParentDocumentUNID());
}
//docUpdate.makeResponse(doc);
docUpdate.setSaveMessageOnSend(false);
docUpdate.send(false);
Great thank and best regards
Adrien