small和尚 2017-06-08 06:09 采纳率: 100%
浏览 2203
已采纳

NoSuchMethodError的问题

图片说明# 刚刚搭建好maven的ssm框架访问index的时候就出现这个问题了
java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;
at org.apache.jasper.compiler.PageInfo.(PageInfo.java:79)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:111)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)


C:\Users\Administrator.m2\repository\junit\junit\4.11\junit-4.11.jar
C:\Users\Administrator.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar
C:\Users\Administrator.m2\repository\javax\servlet\javax.servlet-api\3.0.1\javax.servlet-api-3.0.1.jar
C:\Users\Administrator.m2\repository\javax\servlet\jsp\jsp-api\2.1\jsp-api-2.1.jar
C:\Users\Administrator.m2\repository\javax\servlet\jstl\1.2\jstl-1.2.jar
C:\Users\Administrator.m2\repository\org\aspectj\aspectjweaver\1.8.6\aspectjweaver-1.8.6.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-core\4.1.7.RELEASE\spring-core-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-beans\4.1.7.RELEASE\spring-beans-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-aop\4.1.7.RELEASE\spring-aop-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-context\4.1.7.RELEASE\spring-context-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-expression\4.1.7.RELEASE\spring-expression-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-jdbc\4.1.7.RELEASE\spring-jdbc-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-tx\4.1.7.RELEASE\spring-tx-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-web\4.1.7.RELEASE\spring-web-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-webmvc\4.1.7.RELEASE\spring-webmvc-4.1.7.RELEASE.jar
C:\Users\Administrator.m2\repository\org\springframework\spring-test\4.0.6.RELEASE\spring-test-4.0.6.RELEASE.jar
C:\Users\Administrator.m2\repository\org\mybatis\mybatis\3.2.7\mybatis-3.2.7.jar
C:\Users\Administrator.m2\repository\org\mybatis\mybatis-spring\1.2.3\mybatis-spring-1.2.3.jar
C:\Users\Administrator.m2\repository\mysql\mysql-connector-java\5.1.37\mysql-connector-java-5.1.37.jar
C:\Users\Administrator.m2\repository\com\alibaba\druid\1.0.16\druid-1.0.16.jar
C:\Users\Administrator.m2\repository\com\mchange\c3p0\0.9.5-pre8\c3p0-0.9.5-pre8.jar
C:\Users\Administrator.m2\repository\com\mchange\mchange-commons-java\0.2.7\mchange-commons-java-0.2.7.jar
C:\Users\Administrator.m2\repository\org\slf4j\slf4j-log4j12\1.7.12\slf4j-log4j12-1.7.12.jar
C:\Users\Administrator.m2\repository\org\slf4j\slf4j-api\1.7.12\slf4j-api-1.7.12.jar
C:\Users\Administrator.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar
C:\Users\Administrator.m2\repository\commons-fileupload\commons-fileupload\1.3.1\commons-fileupload-1.3.1.jar
C:\Users\Administrator.m2\repository\commons-io\commons-io\2.2\commons-io-2.2.jar
C:\Users\Administrator.m2\repository\org\apache\poi\poi\3.16-beta2\poi-3.16-beta2.jar
C:\Users\Administrator.m2\repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar
C:\Users\Administrator.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar
C:\Users\Administrator.m2\repository\com\alibaba\fastjson\1.2.24\fastjson-1.2.24.jar
C:\Users\Administrator.m2\repository\org\glassfish\web\el-impl\2.2\el-impl-2.2.jar
C:\Users\Administrator.m2\repository\javax\el\el-api\2.2\el-api-2.2.jar
这些是我的包


这个是我的applicationContext.xml文件的内容
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">

<!-- 该包下的类支持注解,表示会被当作{@code mybatis mapper}处理 配置了之后表示可以自动引入mapper类 <mybatis:scan 
    base-package="com.crm.dao" /> -->
<!--引入属性文件 -->
<context:property-placeholder location="classpath:dataSource.properties" />
<!-- 排除controller扫描 -->
<context:component-scan base-package="com.zefu">
    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!--数据库连接 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
    init-method="init" destroy-method="close">
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />

    <!-- 配置初始化大小、最小、最大 -->
    <property name="initialSize" value="${jdbc.initialSize}" />
    <property name="maxActive" value="${jdbc.maxActive}" />
    <property name="minIdle" value="${jdbc.minIdle}" />
    <!-- 配置获取连接等待超时的时间 -->
    <property name="maxWait" value="${jdbc.maxWait}" />
    <!-- 配置监控统计拦截的filters -->
    <property name="filters" value="${jdbc.filters}" />
    <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
    <property name="timeBetweenEvictionRunsMillis" value="${jdbc.timeBetweenEvictionRunsMillis}" />
    <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
    <property name="minEvictableIdleTimeMillis" value="${jdbc.minEvictableIdleTimeMillis}" />
</bean>

<!-- sqlSessionFactory配置 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <!-- 自动扫描mybatis的配置文件和映射文件 -->
    <property name="mapperLocations" value="classpath:com/zefu/domain/*.xml"></property>
    <property name="typeAliasesPackage" value="com.zefu.domain,com.zefu.query" />
</bean>

<!-- spring扫描dao接口所在的包 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage" value="com.zefu.mapper"></property>
    <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>

<!-- 事务管理 -->
<bean id="tx"
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource"></property>
</bean>

<!-- 配置事务通知 -->
<tx:advice id="txAdvice" transaction-manager="tx">
    <tx:attributes>
        <tx:method name="insert*" propagation="REQUIRED" rollback-for="Exception"/>
        <tx:method name="update*" propagation="REQUIRED" rollback-for="Exception"/>
        <tx:method name="delete*" propagation="REQUIRED" rollback-for="Exception"/>
        <tx:method name="*" propagation="SUPPORTS" read-only="true"/>
    </tx:attributes>
</tx:advice>
<!-- 配置事务切面 -->
<aop:config>
    <aop:pointcut expression="bean(*Service)" id="pt" />
    <!-- expression="execution(*com.zefu.service.*.*(..))" -->
    <aop:advisor advice-ref="txAdvice" pointcut-ref="pt" />
</aop:config>

这个是applicationContext-mvc里面的内容
<?xml version="1.0" encoding="UTF-8"?>

xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache.xsd">

<!-- 启用spring mvc 注解-->
<mvc:annotation-driven>
    <!-- 启动JSON格式的配置 -->
    <mvc:message-converters>  
    <!-- 这里也可以自己定制class -->
    <bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">  
        <property name="supportedMediaTypes">  
            <list>  
                <value>text/html;charset=UTF-8</value>  <!-- 避免IE出现下载JSON文件的情况 -->
            </list>  
        </property>    
    </bean>  
</mvc:message-converters>  
</mvc:annotation-driven>
<!-- 自动扫描的包名 ,使Spring支持自动检测组件,只扫描Controller,排除service-->
<context:component-scan base-package="com.zefu">
    <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
</context:component-scan>


<!-- 视图解析器:定义跳转的文件的前后缀-->  
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">  
    <property name="prefix" value="jsp/" />  
    <property name="suffix" value=".jsp" />  
</bean>   
  • 写回答

3条回答 默认 最新

  • lihongbiao0610 2017-06-08 06:49
    关注

    javax-servlet jar包的版本不对,如果是3.0换成2.5试试,如果是2.5换成3.0

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 flask实现搜索框访问数据库
  • ¥15 mrk3399刷完安卓11后投屏调试只能显示一个设备
  • ¥20 白日门传奇少一个启动区服和启动服务器的快捷键,东西都是全的 , 他们说套一个出来就行了 但我就是弄不好,谁看看,
  • ¥100 如何用js写一个游戏云存档
  • ¥15 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题
  • ¥15 需要写计算过程,不要写代码,求解答,数据都在图上
  • ¥15 向数据表用newid方式插入GUID问题
  • ¥15 multisim电路设计
  • ¥20 用keil,写代码解决两个问题,用库函数