2

在嵌入式 TomEE 容器中运行 Arquillian 测试时出现以下错误

Caused by: javax.el.ELException: Provider com.sun.el.ExpressionFactoryImpl not found
    at javax.el.FactoryFinder.newInstance(FactoryFinder.java:101)
    at javax.el.FactoryFinder.find(FactoryFinder.java:197)
    at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:197)
    at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:168)
    at org.apache.jasper.runtime.JspApplicationContextImpl.<init>(JspApplicationContextImpl.java:46)
    at org.apache.jasper.runtime.JspApplicationContextImpl.getInstance(JspApplicationContextImpl.java:76)
    at org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:217)
    at org.apache.openejb.cdi.OpenEJBLifecycle.setJspELFactory(OpenEJBLifecycle.java:420)
    at org.apache.openejb.cdi.OpenEJBLifecycle.initializeServletContext(OpenEJBLifecycle.java:387)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1464)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1124)
    at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 97 more
Caused by: java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
4

1 回答 1

3

这是因为您以某种方式使用了 javax.javaee api jar 而不是 tomee 之一 (org.apache.tomee:javaee-api),因此您有其他默认值而不是 tomee 服务器中的那个。

设置系统属性以选择正确的属性或使用正确的 API 依赖项。

于 2017-01-22T18:15:55.210 回答