?
Solved

Error in jsp script

Posted on 2009-05-02
1
Medium Priority
?
237 Views
Last Modified: 2012-05-06
I get error when I run jsp script please check attach code

and check complete script attach
java.util.ArrayList sReports2 = activeLayer.getSqlReports();
	SqlConnections sCons2 = (SqlConnections) application.getAttribute("imf.sql-connections");		
	
    for (java.util.Iterator sit2 = sReports2.iterator(); sit2.hasNext();)
	{
      SqlReport sReport2 = (SqlReport) sit2.next();
      SqlRecordset sRecordset2 = sReport2.getSqlRecordset();
      java.util.ArrayList sRecords2 = null;
      /*if (sReport2.isTopLevelReport())
	  {*/
        sReport2.executeQuery(sCons2);
        sRecords2 = sRecordset2.getRecords();
      /*}*/
		  
      if (sRecords2.size() > 0)
	  {
        java.util.ArrayList sColumns2 = sRecordset2.getColumns();
				  
		for (java.util.Iterator scolit2 = sColumns2.iterator(); scolit2.hasNext(); sColumnIndex++)
		{
			SqlColumn sColumn2 = (SqlColumn) scolit2.next();		   
		    String sColumnTitle = sColumn2.getAlias();	  			
						
			if (sColumnTitle.equals("FLD_PRODUCTION_QTY") || sColumnTitle.equals("NO_EMPLOYEES")
			|| sColumnTitle.equals("NO_ACCIDENTS") || sColumnTitle.equals("FLD_NO_OF_INJURIES")
			|| sColumnTitle.equals("NO_OF_VEHICLES") ||
			sColumnTitle.equals("NO_POST_SERVICES") || sColumnTitle.equals("FLD_COMMTYPE") ||
			sColumnTitle.equals("FLD_ACT_TYPE") || 
			sColumnTitle.equals("FLD_NO_UNITS") || sColumnTitle.equals("FLD_NO_CLINICS") ||
			sColumnTitle.equals("FLD_NO_IMMUNIZATION") || sColumnTitle.equals("FLD_NO_PHARMACIES") ||
			sColumnTitle.equals("FLD_NO_SCHL") || sColumnTitle.equals("FLD_NO_STF") ||
			sColumnTitle.equals("FLD_NO_OF_EXCHANGES")
			)
			{
				vr_CheckedSED2 = true;				
			}
			else if (sColumnTitle.equals("BASE_YEAR") || sColumnTitle.equals("PRIBYR_LDESC"))
			{
				//vr_CheckedCPI = true;
			}
		}
			
	  }
	}
 
 
And the error is
 
HTTP Status 500 - 
 
--------------------------------------------------------------------------------
 
type Exception report
 
message 
 
description The server encountered an internal error () that prevented it from fulfilling this request.
 
exception 
 
org.apache.jasper.JasperException: Exception in JSP: /murad_scripts/imfIdentifyDefaultTemp.jsp:946
 
943: 	java.util.ArrayList sReports2 = activeLayer.getSqlReports();
944: 	SqlConnections sCons2 = (SqlConnections) application.getAttribute("imf.sql-connections");		
945: 	
946:     for (java.util.Iterator sit2 = sReports2.iterator(); sit2.hasNext();)
947: 	{
948:       SqlReport sReport2 = (SqlReport) sit2.next();
949:       SqlRecordset sRecordset2 = sReport2.getSqlRecordset();
 
 
Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.moximedia.aims.servlet.filter.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:58)
	net.geocortex.imf.security.http.AuthorizationFilter.doFilter(AuthorizationFilter.java:147)
 
 
root cause 
 
java.lang.NullPointerException
	org.apache.jsp.murad_005fscripts.imfIdentifyDefaultTemp_jsp._jspService(imfIdentifyDefaultTemp_jsp.java:1709)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.moximedia.aims.servlet.filter.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:58)
	net.geocortex.imf.security.http.AuthorizationFilter.doFilter(AuthorizationFilter.java:147)
 
 
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
 
 
--------------------------------------------------------------------------------
 
Apache Tomcat/5.5.17

Open in new window

imfIdentifyDefaultTemp.txt
0
Comment
Question by:bwor
1 Comment
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 2000 total points
ID: 24287595
The error message seems pretty clear:  You have a null pointer on line 946.  Either sit2 is null or sReports2 is null.  
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
Social messanging services like WhatsApp and Facebook can help businesses in ways that many owners don't even imagine, giving new opportunities to connect with customers. Discover some of the most innovative things they can do for your company.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question