Spring 3.1 entityManagerFactory java.lang.NoSuchFieldError: NULL 错误 [英] Spring 3.1 entityManagerFactory java.lang.NoSuchFieldError: NULL Error

查看:26
本文介绍了Spring 3.1 entityManagerFactory java.lang.NoSuchFieldError: NULL 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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 没有问题.

What is this java.lang.NoSuchFieldError: NULL about? Have no issue with 3.0.5.

推荐答案

这意味着版本不匹配——很可能与 spring 类有关.因此,请确保您所有的弹簧罐都是 3.1.0.特别是spring-expression.(如果修复 spring 后不起作用,还要升级您的 JPA 提供程序(休眠?)

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)

这篇关于Spring 3.1 entityManagerFactory java.lang.NoSuchFieldError: NULL 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆