gpt4 book ai didi

java - Spring 3.1 entityManagerFactory java.lang.NoSuchFieldError : NULL Error

转载 作者:IT老高 更新时间:2023-10-28 13:05:33 24 4
gpt4 key购买 nike

我刚刚将 Spring 3.0.5 迁移到 3.1 GA。我在初始化期间遇到了运行时错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/spring/infrastructure-config.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: NULL
...
Caused by: java.lang.NoSuchFieldError: NULL
at org.springframework.expression.TypedValue.<clinit>(TypedValue.java:32)
at org.springframework.expression.spel.support.StandardEvaluationContext.setRootObject(StandardEvaluationContext.java:85)
at org.springframework.expression.spel.support.StandardEvaluationContext.<init>(StandardEvaluationContext.java:74)
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:124)
at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1299)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.evaluate(BeanDefinitionValueResolver.java:210)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:182)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
... 39 more

这是我的 xml。

<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName" value="MyPersistenceUnit" />
</bean>

这个 java.lang.NoSuchFieldError: NULL 是关于什么的? 3.0.5 没有问题。

最佳答案

这意味着存在版本不匹配——很可能是 spring 类。所以确保你所有的 spring jar 都是 3.1.0。特别是 spring-expression。 (如果在修复 spring 后它不起作用,还升级您的 JPA 提供程序( hibernate ?))

关于java - Spring 3.1 entityManagerFactory java.lang.NoSuchFieldError : NULL Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8500708/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com