Alien
Alien

Reputation: 426

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

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!

Upvotes: 1

Views: 1835

Answers (2)

Abdelkarim Boujida
Abdelkarim Boujida

Reputation: 73

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!

Upvotes: 1

Krullert
Krullert

Reputation: 111

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

Upvotes: 3

Related Questions