Getting Error 500 when pressing the backbutton of the browser after log out

I am working on a web project , and am using AJAX in my application. I need to get list of templates and events stored in the database when my page is being loaded so im using AJAX. the problem is, when i press the logout in my page and after logging out if i press the browsers back button then im getting the Http Error 500.
Regarding this issue i previously also posted but i havent get solved my problem. (may be i havent posted my source code , rather i just posted error message.).
Here is the error message of the browser,
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
     com.koffee.eon.subscriber.action.TemplateNames.doPost(TemplateNames.java:66)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)
Here is my source code of the TemplateNames class,
package com.koffee.eon.subscriber.action;
import com.koffee.eon.subscriber.persistence.*;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.text.SimpleDateFormat;
import java.util.*;
public class TemplateNames extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
     response.setContentType("text/html");
     PrintWriter out = response.getWriter();
     String html="",html1="";
     HttpSession session=request.getSession();
     UserCompleteDetails sessionDetails=(UserCompleteDetails)session.getAttribute("userdetails");
     System.out.println("checking session after logout"+sessionDetails);
     if(sessionDetails==null)
     System.out.println("session details in if condition is:"+sessionDetails);
     response.sendRedirect("/login.jsp");
     System.out.println("after checking "+sessionDetails);
     String type=null;
     type=request.getParameter("type");
String subscriberUserEONId=sessionDetails.getUserEonId();
System.out.println("subscriberUserEONId from session is: "+subscriberUserEONId);
     SimpleDateFormat sdfDate=new SimpleDateFormat("yyyy-MM-dd");
     SimpleDateFormat sdfTime=new SimpleDateFormat("HH:mm:ss");
     TemplateManagement dbObj=new TemplateManagement();          
EventManager dbObj1=new EventManager(); // for events
     List templateNames=dbObj.getTemplates(subscriberUserEONId);
     List eventIds=dbObj1.getEventsCompleteList(subscriberUserEONId); // for events
     System.out.println("size of list of templates is:" + templateNames.size());
     System.out.println("size of list of events is: "+eventIds.size()); // for events
     if(type==null)
     html+="<table><tr><td>Select Your Invitation Card: ";
     html+="<select name=\"templateName\" class=\"cell\" onchange=getImage(this.value) onblur=checkTemplate() tabindex=\"1\">";
     html+= "<option value=\"0\">Select</option>";
     HashMap hmap=new HashMap();
     try {
     for(int i=0;i<templateNames.size();i++) {
     TemplateMaster bean=(TemplateMaster)templateNames.get(i);
     Integer templateid=bean.getTemplateId();
     String templatepath=bean.getTemplateRelevantpath();
     hmap.put(templateid,templatepath);
     System.out.println("path recevied from db for template is: "+templatepath);
System.out.println("template id received from db is : "+templateid);
     html+= "<option value=\"" + templateid + "\">" + templateid + "</option>";
     } catch(Exception ee) {ee.printStackTrace();}
     session.setAttribute("hmap", hmap);
     html+="</select></td></tr><tr><td>";
     System.out.println("path new is : "+html);
     html+="</td>";
     System.out.println(html);
html+="</td></tr><tr><td>Select an Event: ";
          html+="<select name=\"eventId\" class=\"cell\">";
          try {
     for(int j=0;j<eventIds.size();j++) {
     EventMaster bean=(EventMaster)eventIds.get(j);
     String eventName=bean.getEventName();
     Integer eventId1=bean.getEventId();
     String eventStartDate=sdfDate.format(bean.getEventStartdate());
     String eventStartTime=sdfTime.format(bean.getEventStarttime());
     String eventId=eventName+" on "+eventStartDate+" at "+eventStartTime;
     System.out.println("event id from database is : "+eventId1);
     System.out.println("event list from database is : "+eventId);
     html+= "<option value=\"" + eventId1 + "\">" + eventId + "</option>";
     } catch(Exception eee) {eee.printStackTrace();}
     html+="</select></td></tr></table>";
     System.out.println(html);
     out.println(html);
     out.flush();
     out.close();     
     if(type!=null)
     html1+="</td></tr><tr><td>Select an Event: ";
     html1+="<select name=\"eventId\" class=\"cell\">";
     try {
     for(int j=0;j<eventIds.size();j++) {
     EventMaster bean=(EventMaster)eventIds.get(j);
     Integer eventId1=bean.getEventId();
String eventId2=eventId1.toString();
     String eventName=bean.getEventName();
     String eventStartDate=sdfDate.format(bean.getEventStartdate());
     String eventStartTime=sdfTime.format(bean.getEventStarttime());
     String eventId=eventName+" on "+eventStartDate+" at "+eventStartTime;
     System.out.println(eventId);
     html1+= "<option value=\""
+ eventId2 + "\">" + eventId + "</option>";
     } catch(Exception eee) {eee.printStackTrace();}
     html1+="</select></td></tr></table>";
     out.println(html1);
     out.flush();
     out.close();     
}

chinni wrote:
java.lang.NullPointerException
     com.koffee.eon.subscriber.action.TemplateNames.doPost(TemplateNames.java:66)Do you understand when a NPE will be thrown? Some object reference at line 66 of TemplateNames.java is null while you didn't expect and you still invoke/access it. To fix this, add a nullcheck or just instantiate the reference.

Similar Messages

  • Just recently getting error message when downloading podcasts.  Says "The iTunes Library file cannot be save.  You do not have enough access privileges for this operation."  Doesn't happen every time.  Using Windows 7.  What can I do?

    Just recently getting error message when downloading podcasts.  Says "The iTunes Library file cannot be save.  You do not have enough access privileges for this operation."  Doesn't happen every time.  Using Windows 7.  What can I do?  The files seem to be there but I don't know if they are being backed up to cloud.

    Hi, DickmoAZ.  
    Thank you for visiting Apple Support Communities.
    This sounds like a permission issue most likely with the iTunes Media folder.  Here is an article that will help you troubleshoot this issue.
    iTunes: Missing folder or incorrect permissions may prevent authorization
    http://support.apple.com/kb/ts1277
    Cheers,
    Jason H.

  • Get error 101 when I try and download the trial

    Hi
    Get error 101 when I try and download the trial
    thanks kris

    Troubleshoot Adobe Download Assistant
    Direct Download Links for Adobe Software
    Mylenium

  • How to stop the gray wheel from spinning after logging out

    how to stop the gray wheel from spinning after logging out?

    Frank ...
    Make sure to quit all open applications before logging out.
    Your proflie indicates your Mac has v10.7.1 installed.
    If that is the case, updating your system software will help as far as functionaly as well as security.
    Install the OS X Lion Update 10.7.5 (Client Combo)
    Then restart your Mac.
    message edited by:  cs

  • Getting error (-50) when either purchasing or authoring the mac

    I'm getting we could not complete your itunes request a unknown error has occurred error (-50) when either purchasing or authorize the mac, which hasn't been done yet
    What can I do, Thanks

    see _*Troubleshooting iTunes Store on your computer, iPhone, iPad, or iPod*_, expand all sections and scroll down until you find your error message.
    follow the troubleshooting instructions.
    JGG

  • Getting Error:500 when trying to "Reset Client" Under setting tab in Mobile

    Hi All,
    We are getting following error when we are trying to Reset Client Under settings tab in the Mobile Device.
    Anyhelp would be highly appreciated.
    Client Details: MI70 SP15 0
    Application: MAM LAPTOP3.0 with SR04.
    DB2e: 9.1.2.
    Error: 500
    Location: /me/servlet/com.sap.ip.me.apps.jsp.ControllerServlet
    Internal Servlet Error:
    java.lang.RuntimeException: nested transaction not supported by TransactionManager
         at com.sap.ip.me.persist.core.IPersistenceManagerTXWrapper.beginTransaction(IPersistenceManagerTXWrapper.java:183)
         at com.sap.ip.me.smartsync.persadp.Transaction.beginTransaction(Transaction.java:69)
         at com.sap.ip.me.smartsync.persadp.PersistenceAdapterImpl.beginTransaction(PersistenceAdapterImpl.java:197)
         at com.sap.ip.me.smartsync.persadp.PersistenceAdapterImpl.beginTransaction(PersistenceAdapterImpl.java:130)
         at com.sap.ip.me.core.ResetClientData.performReset(ResetClientData.java:119)
         at com.sap.ip.me.apps.jsp.ControllerServlet.doHandleEvent(ControllerServlet.java:128)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGetNotThreadSafe(AbstractMEHttpServlet.java:347)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGet(AbstractMEHttpServlet.java:689)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doPost(AbstractMEHttpServlet.java:706)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.service(AbstractMEHttpServlet.java:313)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:534)
    Regards,
    Ameer.

    Hi Alberto,
    I have thought that you are also in NW70.Thats why I have mentioned that note.
    Now correct SAP note for you is 1163707.
    Regards,
    Ameer Baba.

  • Hate iTunes 11. Reverted to old version. Now I get error msg when I open that says The file "iTunes Library.itl" cannot be read because it was created by a newer version of iTunes but won't open or play songs.  HELP!!!!

    Hate iTunes 11. Reverted to the old version. Now I get a msg when I click to open iTunes stating, "The file "iTunes Library.itl" cannot be read because it was created in a newer version of iTunes" and it will not open.  HELP!!  How can I revert the library as well?

    I hate iTunes 11 too... and I also want to revert to previous version. But Apple seems to be so incredibly customer-friendly these days that is quite deliberately not publishing clear/simple revert instructions. I think it's a disgrace that Apple removed Cover Flow without warning people who are tempted to upgrade. Absolute disgrace. And now we're stuck with this piece of ..

  • TS3694 I get error 3014 when i try to update the OS... your help please

    hI,
    I am trying to update the IOS from itunes. I get error code 3014.
    thanks for your help.
    cheers,

    http://support.apple.com/kb/TS3694#error3002

  • I always get error -23001 when I try to use the levenberg marquardt VI ?

    I want to make a fit using Planck equation of blackbody on data taken from a spectrometer. I can't make the fit due to error -23001. How can I solve this error ? And by the way, what is a parser in LabView ?

    The parser interprets your formula.
    If there is a parser error, it means that the syntax of your formula (model equation) is incorrect. Can you post your equation here?
    LabVIEW Champion . Do more with less code and in less time .

  • I'm getting error messages when I try to update my CS5 after I had to do a clean install of Maverick to replace biggie Yosemite on my Mac computer.

    Spell check changed buggie to biggie!

    It would have useful if you had transcribed the error messages verbatim or provided a screen shot.
    The Adobe auto updater was useless before CS6.  Did you download the update you wanted and tried applying it manually?
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Why does FF open old website windows from my last on line session, when i start a brand new session after logging out?

    1) I went on firefox (ff) this morning and visited a few web sites
    2) I logged off (ff) and quit using the I-net
    3) later in the morning I logged back on to the I-net using (ff) and it opened the last web site I was looking at in my previous session instead of the regular "home page" I usually get when I open (ff).
    4) it is as if (ff) is making the last web site I visited from a prior session, my new home page each subsequent time I log on to the I-net.

    Make sure that Firefox is closed properly to avoid opening a possibly crashed session the next time.
    Use "Firefox/File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit") to close Firefox if you are currently doing that by clicking the close X on the title bar.
    See "Hang at exit":
    *http://kb.mozillazine.org/Firefox_hangs
    See "Firefox hangs when you quit it":
    *https://support.mozilla.org/kb/Firefox+hangs

  • Preventing the User from going back to the main page after logging out.

    Hi all,
    In my project I want to prevent the User from going back to the Main page, by clicking the back button of the browser, after the user has loggged out.I had invalidated the session so the user will not be able to do any operations, but he can vew the infos. I want to redirect to the login page if the user tries to go back using the back button after he has logged out.
    I tried the same in this forum after loging out. Surprisingly it is the same. I can browse through all the operations i did even after logging out from here.
    Is it not possible to do that in Servlets?Could somebody help?
    Thanks,
    Zach.

    Hi,
    You can use a servlet filter to do this , as it can interceptany request to your application you can decide to allow user access or not to any page/servlet.
    public class Test implements Filter{
         public void destroy() {
         public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException,
                   ServletException {
              System.out.println("filter");
              HttpServletRequest request = (HttpServletRequest) arg0;
              if(!request.getRequestURI().contains("index")){ // set condition that will be checked to verify if the user is logged in
                   System.out.println("redirecting ... ");
                   RequestDispatcher d = arg0.getRequestDispatcher("/index.jsp");
                   d.forward(arg0, arg1);
              arg2.doFilter(arg0, arg1);
         public void init(FilterConfig arg0) throws ServletException {
    }in you web.xml add :
    <filter>
              <filter-name>test</filter-name>
              <filter-class>test.Test</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>test</filter-name>
              <url-pattern>/*</url-pattern>
         </filter-mapping>

  • Getting Error 500 Internat Server Error when trying to access Mobile App from OBIEE 11.1.1.7.1

    Hi Everyone
    I am getting this error message when I try to open the Mobile App from OBIEE.
    After I log in to OBIEE, I navigate to New >> click on Mobile App and get this error message:
    Error 500--Internal Server Error
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.5.1 500 Internal Server Error
    The server encountered an unexpected condition which prevented it from fulfilling the request.
    I have installed OBIEE 11.1.1.7 and applied the following patches:
    16556157 (OBIEE 11.1.1.7.1 patchset, which also requires you to download another patch, 16569379)
    17004920, which enables support for BI Mobile App Designer in the catalog, and the Presentation Services UI
    17220944, the actual BI Mobile App Designer app, enabled through extending the OBIEE WebLogic domain
    Rest everything under OBIEE works fine.
    Kindly advise and help.

    Please try this
    open a command prompt
    cd C:\app\oracle\product\11.1.1.7.0\fmwhome1\Oracle_BI1\bifoundation\installs
    run the script now
    using
    C:\app\oracle\product\11.1.1.7.0\fmwhome1\Oracle_BI1\common\bin\wlst.cmd addMADCodeGrants.py t3://localhost:7001 weblogic
    This should defnetly work now
    Thanks

  • TS1424 Getting error -1202 when trying to connect to My Wish List.  Says there was an error in the ITunes store and to try again later.  Any work arounds for this?  I have no other problems accessing anything else.

    Getting error -1202 when trying to connect to 'My Wish List" in ITurnes.  Says there was an error in the ITunes store and to try again later.  Have no other problems connecting or purchasing......

    This procedure is a diagnostic test. It makes no changes to your data.
    Please triple-click anywhere in the line below on this page to select it:
    ls -@Oaen L*/Coo* | pbcopy
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    Wait for a new line ending in a dollar sign ($) to appear below what you entered.
    The output of the command will be automatically copied to the Clipboard. If the command produced no output, the Clipboard will be empty. Paste into a reply to this message.
    The Terminal window doesn't show the output. Please don't copy anything from there.

  • Getting error message when i am trying to update the excel file using script task in ssis package

    Hi Guys,
    I am getting error message when I am trying to update the excel. Please find the error messages as below
    Error at Update File [Update File]: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors.
    Error at Update File [Update File]: BC30002 - Type 'Microsoft.Office.Interop.Excel.Application' is not defined., ScriptMain.vb, 32, 32
    Error at Update File [Update File]: BC30002 - Type 'Microsoft.Office.Interop.Excel.Workbook' is not defined., ScriptMain.vb, 33, 25
    Error at Update File [Update File]: The binary code for the script is not found. Please open the script in the designer by clicking Edit Script button and make sure it builds successfully.
    Warning at Update File [Update File]: Found SQL Server Integration Services 2008 Script Task "ST_050fcae972904039b4f0fe59b7528ece" that requires migration!
    and the code that   I am using is
    Dell - Internal Use - Confidential
    ' Microsoft SQL Server Integration Services Script Task
    ' Write scripts using Microsoft Visual Basic
    ' The ScriptMain class is the entry point of the Script Task.
    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Runtime
    Imports Microsoft.Office.Interop.Excel
    <System.AddIn.AddIn("ScriptMain", Version:="1.0", Publisher:="",
    Description:="")> _
    <System.CLSCompliantAttribute(False)> _
    Partial
    Public Class ScriptMain
    Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    Enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
    Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    End Enum
    Public Sub Main()
            Dts.TaskResult = ScriptResults.Success
    'Dim proc As System.Diagnostics.Process
    'kill all instances of excel
    'For Each proc In System.Diagnostics.Process.GetProcessesByName("EXCEL")
    ' proc.Kill()
    'Next
    Dim excelnacomm As
    New Microsoft.Office.Interop.Excel.Application
    Dim wbnacomm As Microsoft.Office.Interop.Excel.Workbook
            wbnacomm = excelnacomm.Workbooks.Open("http://test.xlsx")(renamed
    the excel)
            wbnacomm.RefreshAll()
            wbnacomm.Save()
            wbnacomm.Close()
            excelnacomm.Quit()
            Runtime.InteropServices.Marshal.ReleaseComObject(excelnacomm)
    End Sub
    End
    Class
    Please let me know what could be the reason
    Smash126

    Download:
    Microsoft Office 2010: Primary Interop Assemblies Redistributable
    How to: Add or Remove References By Using the Add Reference Dialog Box  /  How to:
    Add and Remove References in Visual Studio (C#)
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for

  • Lightroom5 to Photoshop Elements

    A while ago I downloaded Lightoom 5 and Photoshop 6 as a trial. As I decided not to have monthly financial commitments and chose to opt out of the cloud. Instead I purchased Lightroom 5 and Photoshop Elements. Unfortunately when I want to open my ima

  • Base value

    Dear All,    Im creating a import po  but my querry is that what value should come at the time of MIGO -3rd header -excise item column -base value amount 1-Is it only gross value of po or 2-grossvalue+ IN Basic customs which value it take pls explain

  • How to post the data into word file

    Dear Forums I am a user of jDeveloper and working on jclient\swing. The problem is that i want to post\Transfer data to a formatted word file. In word file there is a same table containing same contents as jtable. Now after selection of a particular

  • [SOLVED] Can't Complete Installation

    I wiped my drive and did a remote install, which went mostly great, I even got an internet connection. The problem is, when I get to the install packages stage, everything fails. I tried pacman -Syu which outputs :: Synchronizing package databases...

  • [SOLVED]iPython 2.0.0 problem with pyzmq

    Hello, I have problem with running ipython 2. It complains about pyzmq version, but my version is 11 versions newer than they wants. Here is output of ipython qtconsole: ipython qtconsole Traceback (most recent call last): File "/usr/lib/python3.4/si