问题描述
我正在尝试在Google App Engine上部署Spring Boot应用程序,但是在尝试调用与该应用程序关联的任何API时收到以下错误日志.
I am trying to deploy my Spring Boot application on Google App Engine, however I receive the following error logs when attempting to call any of the APIs associated with the app.
但是,仅当我在Google App Engine上运行我的应用程序时,才会发生此错误.如果我在本地打包并运行它,则该应用程序将按预期运行.
However, this error only occurs when I run my app on Google App Engine. If I package it locally and run it, the app works as expected.
有什么想法可能导致此问题?谢谢!
Any ideas what might be causing this issue? Thanks you!
推荐答案
确保您具有el依赖项;
Make sure you have the el dependency;
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.1-b08</version>
</dependency>
还要在您的appengine-web.xml中添加一个env-variables条目;
Also add a env-variables entry to your appengine-web.xml;
<env-variables>
<env-var name="javax.el.ExpressionFactory" value="com.sun.el.ExpressionFactoryImpl" />
</env-variables>
并添加文件"META-INF/services/javax.el.ExpressionFactory"内容:
And add the file 'META-INF/services/javax.el.ExpressionFactory'with the contents:
com.sun.el.ExpressionFactoryImpl
这篇关于在Google App Engine Standard上运行Spring Boot Application时发生javax.el.ExpressionFactory错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!