Hi, I have developed servlets in JSDK2.1 and are well tested by JSDK2.1 WebServer. Now I am transferring the servlets to JSWDK2.0. When I invoke a servlet, it is giving me problem in the call , HttpSession = req.getSession(true); Error is The servlet named log at the requested URL http://localhost:9090/servlet/log reported this exception: java.lang.NullPointerException. Please report this to the administrator of the web server. java.lang.NullPointerException at com.sun.server.http.HttpServiceRequest.getRequestedSessionId(Compiled Code) at com.sun.server.http.HttpServiceRequest.isRequestedSessionIdFromCookie(HttpServiceRequest.java:388) at com.sun.server.http.HttpServiceRequest.isRequestedSessionIdValid(HttpServiceRequest.java:413) at com.sun.server.http.HttpServiceRequest.getSession(HttpServiceRequest.java:233) at com.sun.server.http.FilterHttpServletRequest.getSession(FilterHttpServletRequest.java:379) at log.doPost(Compiled Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java:747) at javax.servlet.http.HttpServlet.service(HttpServlet.java:840) at com.sun.server.ServletState.callService(ServletState.java:226) at com.sun.server.ServletManager.callServletService(ServletManager.java:936) at com.sun.server.http.servlet.InvokerServlet.service(InvokerServlet.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:840) at com.sun.server.ServletState.callService(ServletState.java:226) at com.sun.server.ServletManager.callServletService(ServletManager.java:936) at com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java:423) at com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java:79) at com.sun.server.http.stages.Runner.process(Runner.java:79) at com.sun.server.ProcessingSupport.process(Compiled Code) at com.sun.server.Service.process(Service.java:204) at com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java:374) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.HandlerThread.run(Compiled Code) Would anyone please tell me why the error is coming. Should I do anything with configuration. I am sending U part of my code import javax.servlet.*; import javax.servlet.http.*; import java.net.*; import java.io.*; import java.sql.*; import java.util.*; import java.lang.*; public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String ToServer; StringBuffer FromServer = new StringBuffer(2048); String rtype; String rt; String scr_name; String comment; String seq; StringBuffer rtypebuf; int i = 0; int index; String ssn; String ses_string; int ses_int; int len = 0; StringBuffer ses_buf = new StringBuffer(20); StringBuffer tmpstr_buf; FinShoppingCart cart; System.out.println("Calling log"); System.out.println("Getting default year"); String year = getdefaultyear(); System.out.println("After getting default year"); // set the content being written as HTML form HttpSession session = req.getSession(true); System.out.println("After getting session"); //Get the output stream ServletOutputStream out = res.getOutputStream(); System.out.println("After out"); res.setContentType("text/html"); System.out.println("After res"); } LYCOShop. Thousands of products! One location! http://shop.lycos.com/ ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
