[Building Sakai] NPE when createSubmission
cn19998
cn19998 at qq.com
Fri May 23 20:31:17 PDT 2014
Hello everyone,
I tired to create new submission to an assignment using SOAP "Assignments.jws". However, every time I got NullPointerException from the server.
The method in Assignments.jws is as follows:
public String createSubmission(String sessionId, String context, String assignmentId, String userId, long time)
I have identified different Excptions throw by illegal arguments, like IdUnusedException for wrong sessionId and etc. I am sure that all arguments are correct (except String context, I think it to be the content of my submission since it's the only param where I can pass the content of submission) . But it still thorws NullPointerException from the server. Here's the log:
2014-05-24 11:12:16,573 INFO http-bio-8080-exec-10 org.sakaiproject.util.RemoteHostFilter - Access granted (.*): 127.0.0.1/127.0.0.1 2014-05-24 11:12:16,635 INFO http-bio-8080-exec-8 org.sakaiproject.util.RemoteHostFilter - Access granted (.*): 127.0.0.1/127.0.0.1 2014-05-24 11:12:16,641 WARN http-bio-8080-exec-8 org.sakaiproject.assignment.impl.BaseAssignmentService - org.sakaiproject.assignment.impl.DbAssignmentService at 5b33a4b0 ADD SUBMISSION: cannot add submission object with submission id=70976923-797c-431c-a7af-4e0a80b82849, assignment id=142c8ef4-2c0d-4119-9890-c08a5c2fedff, and submitter id=admin 2014-05-24 11:12:16,642 ERROR http-bio-8080-exec-8 Assignments - WS createSubmission(): java.lang.NullPointerException : null 2014-05-24 11:12:16,652 INFO http-bio-8080-exec-10 org.sakaiproject.util.RemoteHostFilter - Access granted (.*): 127.0.0.1/127.0.0.1
In the Assignments.jws, I identified (using LOG.error("message") to set breakpoints) that the error come since this few lines :
AssignmentSubmissionEdit ase = assignmentService.addSubmission(context,assignmentId, userDirectoryService.getUserId(userId)); ase.clearSubmitters(); // Here's throws NullPointerException ase.addSubmitter(user); ase.setSubmitted(true); Time subTime = timeService.newTime(time); LOG.info("Setting time to " + time); ase.setTimeSubmitted(subTime); assignmentService.commitEdit(ase); return ase.getId();
As a green hand, I don't understand how things are going on here. I am trying to develop a local client for Sakai. Could someone suggests something? Am I misunderstanding something here?
BTW, are there any EntityProvider for posting a submission? There's assignment entity, but I can not find anyone for submissions.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140524/9aae062e/attachment.html
More information about the sakai-dev
mailing list