title: I have recently converted my project to maven. But have an error Resource read error: Could not load com/sun/xml/txw2/Content.class
body: <p>I have recently converted my project to maven. I have added all .jar files for META-INF/lib to maven dependencies. but the error is Resource read error: Could not load com/sun/xml/txw2/Content.class.I also have explicitly added few repositories to .m/repositories... </p>
  
  <pre><code>SEVERE: Resource read error: Could not load com/sun/xml/txw2/Content.class.
      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:61)
          at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)
          at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:420)
          at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
          at org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:3512)
          at org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:1458)
          at org.apache.catalina.loader.WebappClassLoaderBase.getResourceAsStream(WebappClassLoaderBase.java:1686)
          at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2272)
          at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2262)
          at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2168)
          at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2120)
          at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)
          at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1942)
          at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1927)
          at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1332)
          at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:888)
          at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
          at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
          at org.apache.catalina.core.StandardContext.reload(StandardContext.java:4138)
          at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:425)
          at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1341)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1542)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1520)
          at java.lang.Thread.run(Thread.java:745)
  
      Oct 13, 2016 5:31:04 PM org.apache.catalina.loader.WebappClassLoaderBase findResourceInternal
      SEVERE: Resource read error: Could not load com/sun/xml/txw2/DatatypeWriter.class.
      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:61)
          at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)
          at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:420)
          at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
          at org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:3512)
          at org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:1458)
          at org.apache.catalina.loader.WebappClassLoaderBase.getResourceAsStream(WebappClassLoaderBase.java:1686)
          at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2272)
          at org.apache.catalina.startup.ContextConfig.populateJavaClassCache(ContextConfig.java:2265)
          at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2168)
          at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2120)
          at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)
          at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1942)
          at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1927)
          at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1332)
          at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:888)
          at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
          at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
          at org.apache.catalina.core.StandardContext.reload(StandardContext.java:4138)
          at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:425)
          at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1341)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1542)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1520)
          at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>and the pom.xml file is like this :</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;myApp&lt;/groupId&gt;
    &lt;artifactId&gt;myApp&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;resources&gt;
        &lt;resource&gt;
          &lt;directory&gt;src&lt;/directory&gt;
          &lt;excludes&gt;
            &lt;exclude&gt;**/*.java&lt;/exclude&gt;
          &lt;/excludes&gt;
        &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
          &lt;configuration&gt;
            &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
            &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.5.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.7&lt;/source&gt;
            &lt;target&gt;1.7&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
   &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;asm&lt;/groupId&gt;
          &lt;artifactId&gt;asm&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
          &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
          &lt;version&gt;1.3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-io&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-logging&lt;/groupId&gt;
          &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
       &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.gcm&lt;/groupId&gt;
          &lt;artifactId&gt;gcm-server&lt;/artifactId&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
          &lt;artifactId&gt;gson&lt;/artifactId&gt;
          &lt;version&gt;2.2.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-core-asl&lt;/artifactId&gt;
          &lt;version&gt;1.9.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-jaxrs&lt;/artifactId&gt;
          &lt;version&gt;1.9.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
          &lt;version&gt;1.9.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-xc&lt;/artifactId&gt;
          &lt;version&gt;1.9.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.stephenc.simple-java-mail&lt;/groupId&gt;
          &lt;artifactId&gt;simple-java-mail&lt;/artifactId&gt;
          &lt;version&gt;1.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
          &lt;version&gt;1.18&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
          &lt;version&gt;1.18&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-json&lt;/artifactId&gt;
          &lt;version&gt;1.18&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
          &lt;version&gt;1.18&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
          &lt;version&gt;1.18&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jettison&lt;/groupId&gt;
          &lt;artifactId&gt;jettison&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
          &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
          &lt;version&gt;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
          &lt;artifactId&gt;jsr311-api&lt;/artifactId&gt;
          &lt;version&gt;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.30&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
          &lt;artifactId&gt;org.apache.commons.logging&lt;/artifactId&gt;
          &lt;version&gt;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-expression&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
      &lt;version&gt;2.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;sun.misc&lt;/groupId&gt;
      &lt;artifactId&gt;sun.misc.BASE64Decoder&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.xml.txw2&lt;/groupId&gt;
      &lt;artifactId&gt;txw2&lt;/artifactId&gt;
      &lt;version&gt;20070616&lt;/version&gt;
  &lt;/dependency&gt;
  
   &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>also the .m2 repository folder format is:</p>
  
  <pre><code>C:\Users\userName\.m2\repository\com\sun\xml\txw2
  |_txw2
    |_20070616 -&gt;_remote.repositories,txw2-20070616,txw2-20070616.jar.sha1,txw2-       20070616.pom,txw2-20070616.pom.sha1
  |_txw2-project
  </code></pre>