javax.el.ExpressionFactory Error when running Spring Boot Application on Google App Engine Standard

☆樱花仙子☆ 提交于 2020-01-03 04:17:07

问题


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.

Unable to initialize 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on the classpath, or use ParameterMessageInterpolator instead at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:68) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:330) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:244) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:182) at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:97) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:657) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:619) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:589) at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:783) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:263) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.scheduling.annotation.ProxyAsyncConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncConfiguration'

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!


回答1:


Make sure you have the el dependency;

    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.el</artifactId>
        <version>3.0.1-b08</version>
    </dependency>

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>

And add the file 'META-INF/services/javax.el.ExpressionFactory' with the contents:

    com.sun.el.ExpressionFactoryImpl



回答2:


With the help of Krullert's answer I managed to fix the same problem for a java 8 application on app engine. I followed the steps of Krullert's answer The only extra thing I needed to do is add the 'WEB-INF/classes/META-INF/services/javax.el.ExpressionFactory' file.

One remark: To be able to use 'org.glassfish:javax.el:3.0.1-b08' you need to work with servlet api version 3.1 ('javax.servlet:javax.servlet-api:3.1.0'). App engine standard now supports java 8 to be able to use that!



来源:https://stackoverflow.com/questions/44872862/javax-el-expressionfactory-error-when-running-spring-boot-application-on-google

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!