You are trying to create a session after the response had been committed. Have you placed a call to flush() or close() method on the response writer before you create the session?
Once you call these, the response is sent to the client and the request is essentially considered to have been served. Also, check out if you have forwarded the request before you create the session in the servlet. One of these must be the reason.