发布时间:2024-08-13 14:01
1. Tomcat 8的报错:
Unmapped Spring configuration files found.
Failed to scan JAR [jndi:/localhost/WEB-INF/lib/oracle-jdbc-9.2.0.8.jar]
Tomcat 7的报错:
Failed to scan JAR [jndi:/localhost/WEB-INF/lib/oracle-jdbc-9.2.0.8.jar] from WEB-INF/lib
java.util.zip.ZipException: error in opening zip file
Tomcat 6的报错:
ERROR org.hibernate.util.JDBCExceptionReporter (234) - Cannot load JDBC driver class \'oracle.jdbc.driver.OracleDriver\'
15:01:35,182 ERROR org.hibernate.util.JDBCExceptionReporter (234) - Cannot load JDBC driver class \'oracle.jdbc.driver.OracleDriver\'
15:01:35,183 ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate (175) - could not get database metadata
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class \'oracle.jdbc.driver.OracleDriver\'
2. 用的是Intellij IDEA+Maven+Tomcat部署web项目,结果报这个错。打开External Libraries下的oracle-jdbc-9.2.0.8.jar,发现只有20k,猜测应该是jar包不对,删除了这个,把同事的.m2下面的文件夹考过来就行了。需要注意一点:当Maven Projects有红色浪线时是还没有加载好,需要等等才能启动Tomcat。
3. 上面的错误没有了之后,又出现一个错误:
SEVERE: Exception invoking method manageApp
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1917)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1806)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1765)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1751)
参照了这篇文章(http://www.mincoder.com/web/1426.shtml)解决了。
{tomcatPath}/conf/web.xml 修改方法:
在最后添加:metadata-complete=\"true\"
应用终于成功启动了。太难得了,搞了两三个小时。