InvalidLOCheader (badsignature) error and java. lang. ClassFormatError: com/mysql/jdbc Error

Source: Internet
Author: User

InvalidLOCheader (badsignature) error and java. lang. ClassFormatError: com/mysql/jdbc Error

1. The error message is as follows:

SEVERE: Resource read error: Could not load org.springframework.jmx.support.MetricType.java.util.zip.ZipException: invalid LOC header (bad signature)<span style="white-space:pre"></span>at java.util.zip.ZipFile.read(Native Method)<span style="white-space:pre"></span>at java.util.zip.ZipFile.access$1400(ZipFile.java:56)<span style="white-space:pre"></span>at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:677)<span style="white-space:pre"></span>at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:413)<span style="white-space:pre"></span>at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)<span style="white-space:pre"></span>at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:3104)<span style="white-space:pre"></span>at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2771)<span style="white-space:pre"></span>at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160)<span style="white-space:pre"></span>at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1668)<span style="white-space:pre"></span>at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)<span style="white-space:pre"></span>at java.lang.Class.getDeclaredMethods0(Native Method)<span style="white-space:pre"></span>at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)<span style="white-space:pre"></span>at java.lang.Class.getDeclaredMethods(Class.java:1810)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:104)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:101)<span style="white-space:pre"></span>at java.security.AccessController.doPrivileged(Native Method)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:100)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:84)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:221)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)<span style="white-space:pre"></span>at java.lang.reflect.Method.declaredAnnotations(Method.java:699)<span style="white-space:pre"></span>at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:692)<span style="white-space:pre"></span>at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:196)<span style="white-space:pre"></span>at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:161)<span style="white-space:pre"></span>at org.springframework.context.annotation.ConfigurationClassUtils.isLiteConfigurationCandidate(ConfigurationClassUtils.java:106)<span style="white-space:pre"></span>at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:87)<span style="white-space:pre"></span>at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:233)<span style="white-space:pre"></span>at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203)<span style="white-space:pre"></span>at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:622)<span style="white-space:pre"></span>at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)<span style="white-space:pre"></span>at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)<span style="white-space:pre"></span>at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)<span style="white-space:pre"></span>at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)<span style="white-space:pre"></span>at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)<span style="white-space:pre"></span>at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)<span style="white-space:pre"></span>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)<span style="white-space:pre"></span>at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)<span style="white-space:pre"></span>at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)<span style="white-space:pre"></span>at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)<span style="white-space:pre"></span>at java.util.concurrent.FutureTask.run(FutureTask.java:166)<span style="white-space:pre"></span>at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)<span style="white-space:pre"></span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)<span style="white-space:pre"></span>at java.lang.Thread.run(Thread.java:722)ERROR 12-31_13:41:08 ContextLoader.java 312 Context initialization failed java.lang.NoClassDefFoundError: org/springframework/jmx/support/MetricType<span style="white-space:pre"></span>at java.lang.Class.getDeclaredMethods0(Native Method)<span style="white-space:pre"></span>at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)<span style="white-space:pre"></span>at java.lang.Class.getDeclaredMethods(Class.java:1810)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:104)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:101)<span style="white-space:pre"></span>at java.security.AccessController.doPrivileged(Native Method)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:100)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:84)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:221)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)<span style="white-space:pre"></span>at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)<span style="white-space:pre"></span>at java.lang.reflect.Method.declaredAnnotations(Method.java:699)<span style="white-space:pre"></span>at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:692)<span style="white-space:pre"></span>at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:196)<span style="white-space:pre"></span>at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:161)<span style="white-space:pre"></span>at org.springframework.context.annotation.ConfigurationClassUtils.isLiteConfigurationCandidate(ConfigurationClassUtils.java:106)<span style="white-space:pre"></span>at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:87)<span style="white-space:pre"></span>at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:233)<span style="white-space:pre"></span>at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203)<span style="white-space:pre"></span>at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:622)<span style="white-space:pre"></span>at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)<span style="white-space:pre"></span>at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)<span style="white-space:pre"></span>at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)<span style="white-space:pre"></span>at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)<span style="white-space:pre"></span>at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)<span style="white-space:pre"></span>at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)<span style="white-space:pre"></span>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)<span style="white-space:pre"></span>at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)<span style="white-space:pre"></span>at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)<span style="white-space:pre"></span>at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)<span style="white-space:pre"></span>at java.util.concurrent.FutureTask.run(FutureTask.java:166)<span style="white-space:pre"></span>at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)<span style="white-space:pre"></span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)<span style="white-space:pre"></span>at java.lang.Thread.run(Thread.java:722)Caused by: java.lang.ClassNotFoundException: org.springframework.jmx.support.MetricType<span style="white-space:pre"></span>at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)<span style="white-space:pre"></span>at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)<span style="white-space:pre"></span>... 34 more

2. The error message is as follows:

 12-31_12:00:15 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@29579f4e -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (100). Last acquisition attempt exception:java.sql.SQLException: java.lang.ClassFormatError: com/mysql/jdbc/MysqlIO    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)    at com.mysql.jdbc.Util.handleNewInstance(Util.java:435)    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)    at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)    at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)    at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)    at com.mchange.v2.async.ThreadPerTaskAsynchronousRunner$TaskThread.run(ThreadPerTaskAsynchronousRunner.java:255)I 12-31_12:00:15 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@379bcf16 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (100). Last acquisition attempt exception:java.sql.SQLException: java.lang.ClassFormatError: com/mysql/jdbc/MysqlIO    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)    at com.mysql.jdbc.Util.handleNewInstance(Util.java:435)


The project runs normally. An error is reported after the server is restarted, as described in Section 1 and 2.

Solution: Replace the jar in lib, and cause the jar package to become unreadable due to corruption.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.