waytofall
waytofall

Reputation: 383

NullPointerException in _jspInit

I got a NullPointerException in the _jspInit function in my jsp page while I access it from the web browser by typing in the address. I search the web and most of them said that this is because in my WEB-INF/lib folder, there is the .jar file jsp-api.jar confilicted with the jar file of the tomcat container like in java.lang.NullPointerException at org.apache.jsp.page_jsp._jspInit in Tomcat 6, but works in Tomcat 7. However, I check the lib folder and find no such jar files. What's the cause and how to fix it?

Here's the jsp error page:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:538)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.NullPointerException
    org.apache.jsp.index_jsp._jspInit(index_jsp.java:25)
    org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
    org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:340)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.35 logs.

Here's my jar file list in the lib directory of my web application in tomcat6:

activation-1.1.jar              
antlr-2.7.6.jar                 
bean-validator.jar              
c3p0-0.9.1.jar                  
cglib-2.2.jar                   
commons-codec-1.2.jar           
commons-codec-1.4.jar           
commons-collections-3.1.jar     
commons-httpclient-3.1.jar      
commons-lang-2.4.jar            
commons-logging.jar             
commons-logging-1.1.jar         
cxf-api-2.2.9.jar               
cxf-common-schemas-2.2.9.jar    
cxf-common-utilities-2.2.9.jar  
cxf-rt-bindings-soap-2.2.9.jar  
cxf-rt-bindings-xml-2.2.9.jar   
cxf-rt-core-2.2.9.jar           
cxf-rt-databinding-jaxb-2.2.9.jar        
cxf-rt-frontend-jaxws-2.2.9.jar          
cxf-rt-frontend-simple-2.2.9.jar         
cxf-rt-transports-http-2.2.9.jar         
cxf-rt-ws-addr-2.2.9.jar                 
cxf-tools-common-2.2.9.jar               
dom4j-1.6.1.jar                          
ehcache-1.2.3.jar                        
emayclient-v2.jar                        
epcis-captureclient-0.5.0.jar            
epcis-commons-0.5.0.jar                  
epcis-queryclient-0.5.0.jar              
geronimo-annotation_1.0_spec-1.1.1.jar   
geronimo-jaxws_2.1_spec-1.0.jar          
geronimo-stax-api_1.0_spec-1.0.1.jar     
geronimo-ws-metadata_2.0_spec-1.1.2.jar  
hibernate3.jar                           
httpclient-4.1.jar                       
httpcore-4.1.jar                 
httpmime-4.1.jar                 
javassist-3.9.0.GA.jar           
javax.annotation.jar             
javax.ejb.jar                    
javax.enterprise.deploy.jar      
javax.jms.jar                    
javax.management.j2ee.jar        
javax.persistence.jar            
javax.resource.jar               
javax.security.auth.message.jar  
javax.security.jacc.jar          
javax.servlet.jar                
javax.servlet.jsp.jar            
javax.servlet.jsp.jstl.jar       
javax.transaction.jar            
jaxb-api-osgi.jar                
jaxb-impl-2.2.jar                
jboss-cache-1.4.1.GA.jar                     
jbosscache-core-3.1.0.GA.jar                 
jdom-2.0.4.jar                               
jsf-api.jar                                  
jsf-impl.jar                                 
json-20090211.jar                            
jsr311-api.jar                               
jstl-impl.jar                                
jta-1.1.jar                                  
junit.jar                                    
log4j-1.2.14.jar                             
m4uapi.jar                                   
mail.jar                                     
mysql-connector-java-5.1.21-bin.jar          
org.hamcrest.core_1.1.0.v20090501071000.jar  
oscache-2.1.jar
proxool-0.8.3.jar
qrgen-1.1.jar
saaj-api-1.3.jar
saaj-impl-1.3.2.jar
slf4j-api-1.5.8.jar
slf4j-log4j12-1.5.8.jar
stax-api-1.0-2.jar
swarmcache-1.0RC2.jar
textmagic-sms-api-1.0.jar
webservices-api-osgi.jar
weld-osgi-bundle.jar
wsdl4j-1.6.2.jar
wstx-asl-3.2.9.jar
xml-resolver-1.2.jar
XmlSchema-1.4.5.jar
zxing-core-1.7.jar
zxing-j2se-1.7.jar

Upvotes: 1

Views: 1516

Answers (1)

RonK
RonK

Reputation: 9652

Assuming the JAR is the correct direction to go with - I would check to see if it appears in the common.loader property in your catalina.properties file (located under the conf) directory.

Upvotes: 1

Related Questions