Spring 3.1 entityManagerFactory java.lang.NoSuchFieldError: NULL Error

前端 未结 2 1129
青春惊慌失措
青春惊慌失措 2020-12-15 15:37

I have just migrated Spring 3.0.5 to 3.1 GA. I faced runtime error during initialization:

org.springframework.beans.factory.BeanCreationException: Error crea         


        
相关标签:
2条回答
  • 2020-12-15 16:16

    This means there is a version mismatch--most likely with spring classes. So make sure all your spring jars are 3.1.0. Especially spring-expression. (Also upgrade your JPA provider (hibernate?) if it doesn't work after fixing spring)

    0 讨论(0)
  • 2020-12-15 16:30

    It may help you. Upgrading from Spring 3.0.3.RELEASE results in: java.lang.NoSuchFieldError: USER_DECLARED_METHODS

    Earlier I had like this

    <dependencies>
    <!-- Spring 3 dependencies -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>
    ...
    </dependencies>
    

    Then I added

    <dependencies>
    <!-- Spring 3 dependencies -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.1.2.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    ...
    
    </dependencies>
    
    0 讨论(0)
提交回复
热议问题