App Engine:WEB-INF/lib中的jar,但仍会收到java.lang.ClassNotFoundException [英] App Engine: jar in WEB-INF/lib but still getting java.lang.ClassNotFoundException

查看:135
本文介绍了App Engine:WEB-INF/lib中的jar,但仍会收到java.lang.ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在App Engine应用程序的运行时期间,我收到以下异常:

During my App Engine application's runtime, I receive the following exception:

java.lang.ExceptionInInitializerError
at
org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolateExpression(ResourceBundleMessageInterpolator.java:227)

... (removed for brevity)

Caused by: java.lang.ClassNotFoundException: de.odysseus.el.ExpressionFactoryImpl

我已经在开发服务器上看到此错误,并通过在pom.xml中包含juel-impl来解决了该错误

I had seen this error on my dev server and fixed it by including juel-impl in my pom.xml

当我使用appcfg.sh从服务器中提取我的应用程序时,我发现它的WEB-INF/lib中包含juel-impl-2.2.7-20130801.163115-1.jar

When I use appcfg.sh to pull my application from the server, I see that it has juel-impl-2.2.7-20130801.163115-1.jar included in the WEB-INF/lib

我真的不知道该怎么做.

I'm really not sure what to make of this.

推荐答案

更新:根据 GAE问题跟踪器,此问题已在1.9.7版中修复.有关早期版本,请参见下文.

Update: According to the GAE issue tracker, this has been fixed in version 1.9.7. For earlier versions, see below.

Hibernate Validator 5.x使用统一的表达语言.特别是,它使用静态API方法来查找ExpressionFactory的实现.但是,App Engine 1.9.4和更低版本中的错误,似乎阻止仅在生产环境中使用任何表达式工厂实现.

Hibernate Validator 5.x makes use of the Unified Expression Language. In particular, it uses a static API method that looks up an implementation of ExpressionFactory. A bug in App Engine 1.9.4 and earlier, however, seems to prevent the use of any expression factory implementation in production only.

在解决此问题之前,有两种解决方法:

Until this is fixed, there are two workarounds:

  1. 如果不需要Bean Validation 1.1功能,请使用Hibernate Validator 4.3.1.Final.我已经成功测试过了.

  1. If you don't need the Bean Validation 1.1 features, fall back to Hibernate Validator 4.3.1.Final. I have successfully tested this.

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>4.3.1.Final</version>
</dependency>

  • 如果您需要Bean验证1.1,则有报告使其与Apache BVal的存储库快照配合使用.我还没有测试过.

  • If you need Bean Validation 1.1, there have been reports to make this work with a repository snapshot of Apache BVal. I haven't tested this.


    更新说明:按照我先前的答复(Glassfish EL或JUEL)所述指定表达式语言实现在开发中以及某些生产用例中均能正常工作,但仍无法通过某些验证.


    Update note: Specifying the expression language implementation as stated in my earlier response (Glassfish EL or JUEL) works fine in development and also in certain production use cases, but will still fail for some validations.

    这篇关于App Engine:WEB-INF/lib中的jar,但仍会收到java.lang.ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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