提问者:小点点

javax. el.ELException:找不到Provider com.sun.el.ExpressionFactoryImpl


尽管有很多问题解决方案,但我仍然坚持使用ELException解决问题:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tilesConfigurer' defined in ServletContext resource [/WEB-INF/tiles-context.xml]: Invocation of init method failed; nested exception is javax.el.ELException: Provider com.sun.el.ExpressionFactoryImpl not found
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
        at org.springframework.beans.factory.support.AbstractBeanFactorygetObject(AbstractBeanFactory.java:304)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
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.springframework.web.servlet.view.tiles3.TilesConfigurer$TilesElActivator.createEvaluator(TilesConfigurer.java:407)
        at org.springframework.web.servlet.view.tiles3.TilesConfigurer$SpringTilesContainerFactory.createAttributeEvaluatorFactory(TilesConfigurer.java:374)
        at org.apache.tiles.factory.BasicTilesContainerFactory.createContainer(BasicTilesContainerFactory.java:88)
        at org.springframework.web.servlet.view.tiles3.TilesConfigurer$SpringTilesContainerFactory.createContainer(TilesConfigurer.java:296)
        at org.apache.tiles.startup.AbstractTilesInitializer.createContainer(AbstractTilesInitializer.java:114)
        at org.apache.tiles.startup.AbstractTilesInitializer.initialize(AbstractTilesInitializer.java:64)
        at org.springframework.web.servlet.view.tiles3.TilesConfigurer.afterPropertiesSet(TilesConfigurer.java:270)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
        ... 25 more
Caused by: java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
        at javax.el.FactoryFinder.newInstance(FactoryFinder.java:87)
        ... 40 more

我确信这不是由于Web应用程序代码中的任何用户影响,因为具有相同应用程序的另一台服务器运行良好并且两个应用程序的代码相同。两台服务器的环境看起来也相同。

我正在使用Apache Tomcat/8.0.37oracle-java8-jdk-amd64

以下是WEB-INF\lib使用的库列表:

activation-1.1.jar               hibernate-c3p0-4.2.7.Final.jar                  lucene-analyzers-3.6.2.jar        slf4j-simple-1.7.7.jar                    tiles-autotag-core-runtime-1.1.0.jar
amqp-client-3.3.4.jar            hibernate-commons-annotations-4.0.2.Final.jar   lucene-core-3.6.2.jar             snakeyaml-1.11.jar                        tiles-compat-3.0.3.jar
antlr-2.7.7.jar                  hibernate-core-4.2.7.Final.jar                  lucene-facet-3.6.2.jar            solr-analysis-extras-3.6.2.jar            tiles-core-3.0.3.jar
aopalliance-1.0.jar              hibernate-entitymanager-4.2.7.Final.jar         lucene-grouping-3.6.2.jar         solr-core-3.6.2.jar                       tiles-el-3.0.3.jar
asm-4.2.jar                      hibernate-jpa-2.0-api-1.0.1.Final.jar           lucene-highlighter-3.6.2.jar      solr-solrj-3.6.2.jar                      tiles-extras-3.0.3.jar
avro-1.7.5.jar                   hibernate-search-4.4.0.Final.jar                lucene-kuromoji-3.6.2.jar         spring-amqp-1.3.5.RELEASE.jar             tiles-freemarker-3.0.3.jar
c3p0-0.9.1.1.jar                 hibernate-search-analyzers-4.4.0.Final.jar      lucene-memory-3.6.2.jar           spring-aop-4.0.3.RELEASE.jar              tiles-jsp-3.0.3.jar
c3p0-0.9.2.1.jar                 hibernate-search-engine-4.4.0.Final.jar         lucene-misc-3.6.2.jar             spring-beans-4.0.3.RELEASE.jar            tiles-mvel-3.0.3.jar
cas-client-core-3.1.12.jar       hibernate-search-orm-4.4.0.Final.jar            lucene-phonetic-3.6.2.jar         spring-context-4.0.3.RELEASE.jar          tiles-ognl-3.0.3.jar
cassandra-driver-core-2.1.2.jar  hibernate-validator-5.1.0.Final.jar             lucene-smartcn-3.6.2.jar          spring-context-support-4.0.3.RELEASE.jar  tiles-request-api-1.0.3.jar
cassandra-driver-dse-2.1.2.jar   httpclient-4.3.3.jar                            lucene-spatial-3.6.2.jar          spring-core-4.0.3.RELEASE.jar             tiles-request-freemarker-1.0.3.jar
cglib-3.1.jar                    httpcore-4.3.2.jar                              lucene-spellchecker-3.6.2.jar     spring-cql-1.1.0.RELEASE.jar              tiles-request-jsp-1.0.3.jar
classmate-1.0.0.jar              jackson-core-asl-1.9.2.jar                      lucene-stempel-3.6.2.jar          spring-data-cassandra-1.1.0.RELEASE.jar   tiles-request-mustache-1.0.3.jar
commons-beanutils-1.9.2.jar      jackson-mapper-asl-1.9.12.jar                   lz4-1.2.0.jar                     spring-data-commons-1.9.0.RELEASE.jar     tiles-request-servlet-1.0.3.jar
commons-codec-1.6.jar            javaee-api-7.0.jar                              mail-1.4.7.jar                    spring-expression-4.0.3.RELEASE.jar       tiles-request-servlet-wildcard-1.0.3.jar
commons-collections-3.2.1.jar    javassist-3.18.1-GA.jar                         mchange-commons-java-0.2.3.4.jar  spring-jdbc-4.0.3.RELEASE.jar             tiles-request-velocity-1.0.3.jar
commons-compress-1.4.1.jar       javassist-3.7.ga.jar                            metrics-core-3.0.2.jar            spring-jms-4.0.3.RELEASE.jar              tiles-servlet-3.0.3.jar
commons-dbcp-1.4.jar             javax.mail-1.5.0.jar                            mvel2-2.0.11.jar                  spring-orm-4.0.3.RELEASE.jar              tiles-template-3.0.3.jar
commons-digester-2.0.jar         jawr-3.3.3.jar                                  netty-3.9.0.Final.jar             spring-rabbit-1.3.5.RELEASE.jar           tiles-velocity-3.0.3.jar
commons-io-2.4.jar               jboss-logging-3.1.3.GA.jar                      ognl-2.7.3.jar                    spring-retry-1.1.0.RELEASE.jar            validation-api-1.1.0.Final.jar
commons-lang-2.6.jar             jboss-transaction-api_1.1_spec-1.0.1.Final.jar  oro-2.0.8.jar                     spring-security-cas-3.1.4.RELEASE.jar     velocity-1.6.2.jar
commons-lang3-3.3.2.jar          jcl-over-slf4j-1.7.12.jar                       paranamer-2.3.jar                 spring-security-config-3.1.4.RELEASE.jar  velocity-tools-2.0.jar
commons-logging-1.1.3.jar        jna-4.0.0.jar                                   poi-3.10-FINAL.jar                spring-security-core-3.1.4.RELEASE.jar    waffle-jna-1.7.jar
commons-pool-1.5.4.jar           jna-platform-4.1.0.jar                          poi-ooxml-3.10-FINAL.jar          spring-security-web-3.1.4.RELEASE.jar     
compiler-0.8.4.jar               jstl-1.2.jar                                    poi-ooxml-schemas-3.10-FINAL.jar  spring-tx-4.0.3.RELEASE.jar               xmlbeans-2.3.0.jar
dom4j-1.6.1.jar                  liquibase-core-3.1.1.jar                        postgresql-9.4-1200-jdbc41.jar    spring-web-4.0.3.RELEASE.jar
ehcache-2.8.3.jar                log4j-over-slf4j-1.7.7.jar                      quartz-2.2.1.jar                  spring-webmvc-4.0.3.RELEASE.jar
freemarker-2.3.20.jar            logback-classic-1.1.3.jar                          stax-api-1.0.1.jar
guava-16.0.jar                   logback-core-1.1.3.jar                          slf4j-api-1.7.5.jar               tiles-api-3.0.3.jar

下面是Tomcat8使用的/usr/share/java库的列表:

commons-dbcp-1.4.jar    jsp-api-2.3.jar                     tomcat8-catalina.jar                     tomcat8-i18n-fr-8.0.37.jar    tomcat8-jni.jar                 tomcat8-util-scan-8.0.37.jar
commons-dbcp.jar        libintl.jar                         tomcat8-catalina-storeconfig-8.0.37.jar  tomcat8-i18n-fr.jar           tomcat8-jsp-api-8.0.37.jar      tomcat8-util-scan.jar
commons-pool-1.6.jar    tomcat8-annotations-api-8.0.37.jar  tomcat8-catalina-storeconfig.jar         tomcat8-i18n-ja-8.0.37.jar    tomcat8-jsp-api.jar             tomcat8-websocket-8.0.37.jar
commons-pool.jar        tomcat8-annotations-api.jar         tomcat8-coyote-8.0.37.jar                tomcat8-i18n-ja.jar           tomcat8-juli-8.0.37.jar         tomcat8-websocket-api-8.0.37.jar
ecj.jar                 tomcat8-api-8.0.37.jar              tomcat8-coyote.jar                       tomcat8-jasper-8.0.37.jar     tomcat8-juli.jar                tomcat8-websocket-api.jar
eclipse-ecj-3.11.0.jar  tomcat8-api.jar                     tomcat8-dbcp-8.0.37.jar                  tomcat8-jasper-el-8.0.37.jar  tomcat8-servlet-api-8.0.37.jar  tomcat8-websocket.jar
eclipse-ecj.jar         tomcat8-catalina-8.0.37.jar         tomcat8-dbcp.jar                         tomcat8-jasper-el.jar         tomcat8-servlet-api.jar
el-api-3.0.jar          tomcat8-catalina-ant-8.0.37.jar     tomcat8-el-api-8.0.37.jar                tomcat8-jasper.jar            tomcat8-tribes-8.0.37.jar
el-impl-2.2.jar         tomcat8-catalina-ant.jar            tomcat8-el-api.jar                       tomcat8-jdbc-8.0.37.jar       tomcat8-tribes.jar
java_defaults.mk        tomcat8-catalina-ha-8.0.37.jar      tomcat8-i18n-es-8.0.37.jar               tomcat8-jdbc.jar              tomcat8-util-8.0.37.jar
javaee-api-7.0.jar      tomcat8-catalina-ha.jar             tomcat8-i18n-es.jar                      tomcat8-jni-8.0.37.jar        tomcat8-util.jar

我已经将el-api、el-impl和jsp-api添加到 /usr/share/java,因为这些库在 /usr/share/java中找不到。

POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.company.test</groupId>
    <artifactId>app</artifactId>
    <version>0.1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <url>http://maven.apache.org</url>

    <prerequisites>
        <maven>3.0.0</maven>
    </prerequisites>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <springframework.version>4.0.3.RELEASE</springframework.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-servlet-api</artifactId>
            <version>8.0.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
            <version>3.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.3.3</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.1.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.2.7.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.2.7.Final</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-extras</artifactId>
            <version>3.0.3</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>guava</artifactId>
                    <groupId>com.google.guava</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
        </dependency>
        <dependency>
            <groupId>net.jawr</groupId>
            <artifactId>jawr</artifactId>
            <version>3.3.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-cas</artifactId>
            <version>3.1.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>3.1.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${springframework.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.10-FINAL</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jdbc</artifactId>
            <version>8.0.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.3.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.10-FINAL</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>16.0</version>
        </dependency>
        <dependency>
            <groupId>org.cassandraunit</groupId>
            <artifactId>cassandra-unit-spring</artifactId>
            <version>2.0.2.1</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-log4j12</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>cassandra-all</artifactId>
            <version>2.1.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.4-1200-jdbc41</version>
            </dependency>
            <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>${project.basedir}/documentation/package/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>${project.basedir}/src/main/webapp/WEB-INF</directory>
            </testResource>
            <testResource>
                <directory>${project.basedir}/src/test/resources</directory>
            </testResource>
            <testResource>
                <directory>${project.basedir}/documentation/conf</directory>
            </testResource>
        </testResources>
        <testOutputDirectory>target/test-classes</testOutputDirectory>
        <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>

        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.5</version>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.7</version>
            </plugin>
            <plugin>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5</version>
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>prod-resources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                            <overwrite>true</overwrite>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                    <excludes>
                                        <exclude>**/*.jks</exclude>
                                        <exclude>**/*.xlsx</exclude>
                                    </excludes>
                                    <filtering>true</filtering>
                                </resource>
                                <resource>
                                    <directory>documentation/package/resources</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                            <filters>
                                <filter>${project.basedir}/src/main/resources/application.properties</filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <argLine>-Duser.timezone=UTC -Duser.language=en -Duser.region=US</argLine>
                    <threadCount>1</threadCount>
                    <includes>
                        <include>**/*Tests.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/*IntegrationalTests.java</exclude>
                    </excludes>
                    <systemPropertyVariables>
                        <user.timezone>Etc/UTC</user.timezone>
                    </systemPropertyVariables>
                    <!-- <forkCount>3</forkCount> <reuseForks>true</reuseForks> -->

                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>src/main/jsp</directory>
                            <targetPath>WEB-INF/jsp</targetPath>
                        </resource>
                        <resource>
                            <directory>src/main/tags</directory>
                            <targetPath>WEB-INF/tags</targetPath>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.6</version>
                <dependencies>
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm</artifactId>
                        <version>5.0.3</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                    <check/>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>${springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
                <version>${springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.5</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-expression</artifactId>
                <version>${springframework.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                    <check/>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.16</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
            </plugin>
        </plugins>
    </reporting>
</project>

但是,我仍然无法找到com. sun.el.ExpressionFactoryImpl


共3个答案

匿名用户

删除

<dependency>
  <groupId>javax.el</groupId>
  <artifactId>javax.el-api</artifactId>
  <version>3.0.0</version>
  <scope>provided</scope>
</dependency>

对于这个jar有javax. el.ExpressionFactory

tomcat8-el-api. jar有同一个。

这会引起冲突

匿名用户

删除此

<dependency>
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
            <version>3.0.0</version>
            <scope>provided</scope>
</dependency>

并尝试与

<dependency>
          <groupId>org.glassfish.web</groupId>
          <artifactId>el-impl</artifactId>
          <version>2.2</version>
</dependency>

匿名用户

我尝试了所有已经回答的解决方案,但没有一个对我有用Spring Boot 2.1.3嵌入tomcat。以下依赖项对我有用

    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.el</artifactId>
    </dependency>