1
resposta

Erro com o antl-2.7.7jar

Ao dar "start" no servidor aparecem diversos erros como o abaixo.

mai 25, 2018 9:04:24 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar GRAVE: Unable to process Jar entry [antlr/preprocessor/Option.class] from Jar [jar:file:/C:/Users/Junior/OneDrive/Documentos/Desenvolvimento%20Java/Alura/Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/livrariabsi/WEB-INF/lib/antlr-2.7.7.jar!/] for annotations java.util.zip.ZipException: invalid LOC header (bad signature) ....

Tem algo haver com o antlr-2.77.jar. Ele não consta na pasta lib do meu projeto e nem no meu arquivo pom.xml.

Que jar é esse? Qual sua função? Se é uma dependência do projeto porque não foi sugerido sua inclusão no arquivo pom.xml?

segue abaixo as dependências do meu pom.xml

<dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>4.1.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-servlet-api</artifactId>
            <version>7.0.30</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl-api</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>jstl-impl</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.6.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
            <scope>runtime</scope>
        </dependency>
        <!--  configuração jpa e driver mysql -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.3.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>4.1.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.15</version>
        </dependency>
    </dependencies>
1 resposta

Eu estou com esse mesmo problema. Adicionei a dependência abaixo mas não resolveu:

antlr antlr 2.7.7

Abaixo o LOG do TomCat java.lang.NoClassDefFoundError: antlr/ANTLRException java.lang.ClassLoader.defineClass1(Native Method) java.lang.ClassLoader.defineClass(ClassLoader.java:763) java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3222) org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1409) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1897) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1771) org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:57) org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:124) org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:88) org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:190) org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301) org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236) org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1796) org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:342) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:289) com.sun.proxy.$Proxy29.createQuery(Unknown Source) br.com.casadocodigo.loja.daos.ProdutoDAO.listar(ProdutoDAO.java:26) br.com.casadocodigo.loja.daos.ProdutoDAO$$FastClassBySpringCGLIB$$ad96cfa9.invoke()