问题描述
- web开发中遇到java.lang.ClassFormatError应该怎么解决?谢谢各位大牛:)?
-
我做的项目,有好多个java文件,根据错误提示,应该怎么解决!谢谢各位大牛!
MyEclipse8.5中控制台信息如下:
2015-5-6 8:31:03 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.32 using APR version 1.5.1.
2015-5-6 8:31:03 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2015-5-6 8:31:04 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized with version OpenSSL 1.0.1j 15 Oct 2014
2015-5-6 8:31:04 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2015-5-6 8:31:04 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2015-5-6 8:31:04 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1126 ms
2015-5-6 8:31:04 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2015-5-6 8:31:04 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.43
2015-5-6 8:31:04 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2015-5-6 8:31:05 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2015-5-6 8:31:05 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2015-5-6 8:31:05 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2015-5-6 8:31:05 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2015-5-6 8:31:05 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2015-5-6 8:31:05 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory MyContent
2015-5-6 8:31:05 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2015-5-6 8:31:05 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory test_online
2015-5-6 8:31:05 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2015-5-6 8:31:05 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2015-5-6 8:31:05 org.apache.catalina.startup.Catalina start
信息: Server startup in 1269 ms
2015-5-6 8:32:34 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet SaveServlet threw exception
java.lang.ClassFormatError: Illegal exception table range in class file com/mysql/jdbc/ConnectionImpl
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at util.DBUtil.getConnection(DBUtil.java:11)
at dao.impl.SaveDaoImpl.save(SaveDaoImpl.java:16)
at service.impl.SaveServiceImpl.save(SaveServiceImpl.java:11)
at servlet.SaveServlet.doPost(SaveServlet.java:25)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1778)
at java.lang.Thread.run(Thread.java:619)
页面运行截图如下:
解决方案
com.mysql.jdbc.NonRegisteringDriver
驱动没有注册
http://www.jb51.net/article/18421.htm
解决方案二:
错误信息已经很明显了,是在com/mysql/jdbc/ConnectionImpl下,这里面配置有误。 要么没有导包,要么用户名和密码写错。
时间: 2024-10-08 21:36:52