spring spring添加到pom.xml时的spring orm异常

时间:2012-09-17 08:50:45

标签: java spring spring-mvc

我是Spring开发的新手,我尝试为spring orm添加maven依赖项,在pom.xml文件中,它在服务器启动时给出以下异常。此外,当我删除该依赖项时,异常就会发生。你能告诉我这有什么不妥吗?

感谢。

SEVERE: Unable to process Jar entry [org/springframework/orm/jpa/JpaObjectRetrievalFailureException.class] from Jar [jar:file:/home/madhumal/mavenproj/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/NurseryApplication/WEB-INF/lib/spring-orm-3.1.2.RELEASE.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid constant pool reference: 99. Constant pool size is: 25
    at org.apache.tomcat.util.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:184)
    at org.apache.tomcat.util.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:203)
    at org.apache.tomcat.util.bcel.classfile.SourceFile.getSourceFileName(SourceFile.java:92)
    at org.apache.tomcat.util.bcel.classfile.JavaClass.<init>(JavaClass.java:122)
下面的

是我的pom.xml文件。

<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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>mad.maventest2.app</groupId>
    <artifactId>NurseryApplication</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>NurseryApplication</name>

    <properties>
        <spring.version>3.1.2.RELEASE</spring.version>
        <hibernate.version>4.1.6.Final</hibernate.version>
    </properties>


    <dependencies>

        <!-- Spring 3 dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <!-- Spring Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>



        <!-- <dependency> -->
        <!-- <groupId>org.hibernate</groupId> -->
        <!-- <artifactId>hibernate-core</artifactId> -->
        <!-- <version>${hibernate.version}</version> -->
        <!-- </dependency> -->

        <!-- <dependency> -->
        <!-- <groupId>org.hibernate</groupId> -->
        <!-- <artifactId>hibernate-entitymanager</artifactId> -->
        <!-- <version>${hibernate.version}</version> -->
        <!-- </dependency> -->

        <!-- other dependencies -->
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.6</version>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                    <wtpversion>1.5</wtpversion>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

1 个答案:

答案 0 :(得分:1)

org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid constant pool reference: 99. Constant pool size is: 25

看起来jar文件有问题。 - 从当地m2中删除它。存储库和maven将再次下载它。我希望这可以解决问题。