mysql connector의 버전에 따른, 톰캣 오류

    에러 내용

    mysql과 톰캣 버전의 충돌 때문인지, mysql-connector-java를 maven으로 받아서 빌드를 할 때, 아래와 같은 에러가 발생하였음.




    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/jobis]]

    at java.util.concurrent.FutureTask.report(FutureTask.java:122)

    at java.util.concurrent.FutureTask.get(FutureTask.java:192)

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)

    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/jobis]]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)

    ... 6 more

    Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@61b0a946]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)

    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4868)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5003)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

    ... 6 more

    Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@774f8c1]

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)

    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

    ... 9 more

    Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)

    at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:142)

    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)

    ... 12 more

    Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)

    at java.util.zip.ZipFile.read(Native Method)

    at java.util.zip.ZipFile.access$1400(ZipFile.java:60)

    at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)

    at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:419)

    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)

    at sun.misc.IOUtils.readFully(IOUtils.java:65)

    at java.util.jar.JarFile.getBytes(JarFile.java:425)

    at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)

    at java.util.jar.JarFile.getManifest(JarFile.java:180)

    at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)

    ... 13 more



    Maven Dependency


    <dependency>

    <groupId>mysql</groupId>

    <artifactId>mysql-connector-java</artifactId>

    <version>5.1.31</version>

    </dependency> 


    설치한 버전은 5.1.31 버전이었고, 여태까지 해당 jar 파일로 프로젝트를 이상없이 하였기에 다른 방법을 찾으면서 삽질을 했으나, 아주 간단하게 문제가 해결되었음


    <dependency>

    <groupId>mysql</groupId>

    <artifactId>mysql-connector-java</artifactId>

    <version>6.0.6</version>

    </dependency>


    mysql connector 버전을 5.1.31에서 6.0.6으로 변경하니, org.apache.catalina.LifecycleException 에러가 발생안되고 심플하게 해결됨.




    반응형

    댓글

    Designed by JB FACTORY