日期:2014-05-18  浏览次数:21781 次

如何解决 Cannot inherit from final class
javax.servlet.ServletException:   Cannot   inherit   from   final   class
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
com.jspdev.ch8.EncodingFilter.doFilter(EncodingFilter.java:36)


root   cause  

java.lang.VerifyError:   Cannot   inherit   from   final   class
java.lang.ClassLoader.defineClass0(Native   Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:537)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1652)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:883)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1212)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
org.apache.xerces.impl.XMLNSDocumentScannerImpl.createContentDispatcher(XMLNSDocumentScannerImpl.java:555)
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.(XMLDocumentFragmentScannerImpl.java:249)
org.apache.xerces.impl.XMLDocumentScannerImpl.(XMLDocumentScannerImpl.java:245)
org.apache.xerces.impl.XMLNSDocumentScannerImpl.(XMLNSDocumentScannerImpl.java:110)
org.apache.xerces.parsers.IntegratedParserConfiguration.createDocumentScanner(IntegratedParserConfiguration.java:271)
org.apache.xerces.parsers.DTDConfiguration.(DTDConfiguration.java:367)
org.apache.xerces.parsers.StandardParserConfiguration.(StandardParserConfiguration.java:198)
org.apache.xerces.parsers.IntegratedParserConfiguration.(IntegratedParserConfiguration.java:182)
org.apache.xerces.parsers.IntegratedParserConfiguration.(IntegratedParserConfiguration.java:139)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native   Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
java.lang.Class.newInstance0(Class.java:308)
java.lang.Class.newInstance(Class.java:261)
org.apache.xerces.util.ObjectFactory.newInstance(ObjectFactory.java:266)
org.apache.xerces.util.ObjectFactory.findJarServiceProvider(ObjectFactory.java:360)
org.apache.xerces.util.ObjectFactory.createObject(ObjectFactory.java:185)
org.apache.xerces.util.ObjectFactory.createObject(ObjectFactory.java:120)
org.apache.xerces.parsers.DOMParser.(DOMParser.java:153)
org.apache.xerces.parsers.DOMParser.(DOMParser.java:137)
org.apache.xerces.jaxp.DocumentBuilderImpl.(DocumentBuilderImpl.java:102)
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(DocumentBuilderFactoryImpl.java:88)
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:133)
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:112)
org.apache.jasper.compiler.JspConfig.init(JspConfig.java:213)
org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:229)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:207)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)