The method getJspApplicationContext(ServletContext) is undefined for the type Js
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的解決方法
最近又開始看jsp,不過我看的那本書的版本已經舊了,那時候用的tomcat還是5的版本,我現在自己下的用的是tomcat6,在執行隨書光碟的例子的時候,報了這樣的錯誤:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 23 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
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.24 logs.
Apache Tomcat/6.0.24
後來在網上查了查,說是因為專案中有像jsp-api.jar servlet-api.jar跟tomcat6的lib中同樣的包,但版本比tomcat6的版本要低,在執行的時候,因為會優先載入專案中的包,所以產生了錯誤,把專案中和tomcat相同的包刪除(必須刪除,如果替換還會產生其他的錯誤),問題就可以解決了。
實際通過這個問題,則可以明白,在佈署jsp網站(在tomcat上)的時候,專案中的jar包不能有和tomcat的lib中相同的包(自己包的版本比 tomcat低或相同),否則會因為先載入自己專案中的包而導致程式錯誤。所以在有相包的情況的時候,將自己的包給刪掉,就不會出現問題了。
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 23 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
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.24 logs.
Apache Tomcat/6.0.24
後來在網上查了查,說是因為專案中有像jsp-api.jar servlet-api.jar跟tomcat6的lib中同樣的包,但版本比tomcat6的版本要低,在執行的時候,因為會優先載入專案中的包,所以產生了錯誤,把專案中和tomcat相同的包刪除(必須刪除,如果替換還會產生其他的錯誤),問題就可以解決了。
實際通過這個問題,則可以明白,在佈署jsp網站(在tomcat上)的時候,專案中的jar包不能有和tomcat的lib中相同的包(自己包的版本比 tomcat低或相同),否則會因為先載入自己專案中的包而導致程式錯誤。所以在有相包的情況的時候,將自己的包給刪掉,就不會出現問題了。
相關文章
- The method getWriter() is undefined for the type HttpServletRequest的問題UndefinedHTTPServlet
- Attribute GetCustomAttribute via method info of type
- 安裝redis cluster時:undefined method `invoke_with_build_args' for nil:NilClassRedisUndefinedUI
- type.jsJS
- Python-unsupported operand type(s) for %: 'builtin_function_or_method' and 'int'PythonUIFunction
- MyBatis提示getFundBonus attempted to return null from a method with a primitive return type (double)MyBatisNullMIT
- js提示Cannot read property ‘replace‘ of undefinedJSUndefined
- BUG——AngularJS:Cannot set property ‘pic‘ of undefinedAngularJSUndefined
- js中null和undefined的區別JSNullUndefined
- js中undefined和null的區別JSUndefinedNull
- ServletContext物件ServletContext物件
- Git Push問題remote: hooks/update:10 undefined method 'require_relative' for main:Object(Nometh...GitREMHookUndefinedUIAIObject
- 處理 JS 中 undefined 的 7 個技巧JSUndefined
- ServletContext 學習ServletContext
- ServletContext介紹ServletContext
- JS學習筆記:JS 的function( window, undefined ) {}(window)寫法JS筆記FunctionUndefined
- JS中判斷null、undefined與NaN的方法JSNullUndefinedNaN
- JS 的型別(null 和 undefined 的區別)JS型別NullUndefined
- js方法鏈(Method Chaining)簡單介紹JSAI
- JS 應用篇(一):Undefined與Null的區別JSUndefinedNull
- js如何判斷一個變數是否是undefinedJS變數Undefined
- 7.107 JSON Type ConstructorJSONStruct
- TypeError: Object of type ‘datetime‘ is not JSON serializableErrorObjectJSON
- undefined reference toUndefined
- null == undefined ?NullUndefined
- share undefinedUndefined
- 註解中用於@target的方法annotation/--ElementType.METHOD,ElementType.TYPE對應方法,類介面
- javax.servlet.ServletContext介面JavaServletContext
- ServletContext,ActionContext,ServletActionContextServletContext
- js如何判斷一個變數值是否為undefinedJS變數Undefined
- js中什麼情況下返回值是undefinedJSUndefined
- Form表單JSONContent-type解析ORMJSON
- vue.js 中 data, prop, computed, method,watch 介紹Vue.js
- 解決javax.servlet.jsp.JspException cannot be resolved to a typeJavaServletJSException
- servlet ServletConfig ServletContextServletContext
- 關於 UndefinedUndefined
- undefined和nullUndefinedNull
- Qt undefined reference to ***QTUndefined