Project: Tomcat
Bug 55995 java.lang.NullPointerException at org.apache.jasper.servlet.JspCServletContext.getResource(JspCServletContext.java:344)
Reported: 2014-01-13 05:55:30 | Status: resolved fixed

Null pointer exception when running JSPC from a Shell Script. JspCServletContext.java:344 /** * Return a URL object of a resource that is mapped to the * specified context-relative path. * * @param path Context-relative path of the desired resource * * @exception MalformedURLException if the resource path is * not properly formed */ @Override public URL getResource(String path) throws MalformedURLException { if (!path.startsWith("/")) throw new MalformedURLException("Path '" + path + "' does not start with '/'"); TldCache.java:124 private long[] getLastModified(TldResourcePath tldResourcePath) { long[] result = new long[2]; result[0] = -1; result[1] = -1; try { URL url = servletContext.getResource(tldResourcePath.getWebappPath()); /usr/java/jdk1.7.0_45/bin/java -classpath :/home/tomcat/apache-tomcat-8.0.0-RC10/lib/catalina-storeconfig.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-websocket.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-i18n-es.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/catalina-tribes.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/catalina-ha.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-i18n-ja.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/jsp-api.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-util.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-jni.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/jasper.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/websocket-api.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/ecj-4.3.1.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-i18n-fr.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-api.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-coyote.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/servlet-api.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/jasper-el.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/catalina.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-dbcp.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-jdbc.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/annotations-api.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-util-scan.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/catalina-ant.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/el-api.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/lib/tomcat-spdy.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/bin/tomcat-juli.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/bin/bootstrap.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/bin/commons-daemon.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/webapps/examples/WEB-INF/lib/jstl.jar:/home/tomcat/apache-tomcat-8.0.0-RC10/webapps/examples/WEB-INF/lib/standard.jar:/home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/lib/ant-1.6.5.jar org.apache.jasper.JspC -d /home/java/source/HEAD/work/tomcat80 -v -l -uriroot /home/java/source/HEAD/work/jsp_compile_shared /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/dialog/qbAxesDlg.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/dialog/qbManualGecodingDlg.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/fmtdlg.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/index.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/joindlg.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/producer.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/simplefilter.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/selectvaluedlg.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/binddowsTestView.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/variableeditordlg.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/filterprompteditor.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/ajax_response.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/fontdlg.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/join_fields.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/tree_component.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/waiting_banner.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/folderblock/BID_FolderBlockInit.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/folderblock/BID_FolderBlockBoot.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/BID_EmptyContent.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/xml/BID_UrlProperties.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/xml/BID_IBFSpathToHrefs.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/xml/BID_xmlresponse.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/xml/BID_statusResponse.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/favorites/BID_favorites_tree.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/favorites/BID_FavoritesBlockBoot.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/favorites/BID_FavoritesBlockInit.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/favorites/BID_favorites_tree_boot.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/favorites/BID_listToXML.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/index.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_InternalPage.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_SearchTree_Boot.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_SATree_Boot.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_BiFrame.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_initView.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_ShowToolbar.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_ExternalPage.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_SATreeBiFrame.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_initBindows.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/views/BID_SearchTreeBiFrame.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/recents/BID_recents_tree_boot.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/recents/BID_recents_tree.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/recents/BID_listToXML.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/error.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/groups/BID_listToXML.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/search/BID_searchListToXML.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/search/BID_listToXML.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/tree/BID_MrPropertiesToXML.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/tree/BID_flatListToXML.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/tree/BID_PlainText.jsp /home/java/source/HEAD/work/jsp_compile_shared/WEB-INF/jsp/bid/tree/BID_listToXML.jsp 2>&1 Exception in thread "main" java.lang.NullPointerException at org.apache.jasper.servlet.JspCServletContext.getResource(JspCServletContext.java:344) at org.apache.jasper.compiler.TldCache.getLastModified(TldCache.java:124) at org.apache.jasper.compiler.TldCache.<init>(TldCache.java:70) at org.apache.jasper.JspC.initServletContext(JspC.java:1468) at org.apache.jasper.JspC.execute(JspC.java:1321) at org.apache.jasper.JspC.main(JspC.java:269)

Files changed in fix:
java/org/apache/jasper/compiler/TldCache.java