思相见 2019-10-15 09:42 采纳率: 100%
浏览 1249
已采纳

ssm 报错:org.springframework.context.annotation.internalAsyncAnnotationProcessor

ssm 框架 在本地完美运行放到Linux服务器报错 以下内容

Error creating bean with name '**org.springframework.context.annotation.internalAsyncAnnotationProcessor'**: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.interceptor.AsyncExecutionInterceptor.(Ljava/util/concurrent/Executor;Lorg/springframework/aop/interceptor/AsyncUncaughtExceptionHandler;)V

之前是没有加 redis,没有发现问题,这次我加了redis然后就报错,大神们帮忙看看解决解决

这是spring-mvc配置:

==============spring-mvc=====================
<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"  
    xmlns:context="http://www.springframework.org/schema/context"  
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:task="http://www.springframework.org/schema/task"  
    xsi:schemaLocation="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/mvc    
                        http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
                        http://www.springframework.org/schema/task
                        http://www.springframework.org/schema/task/spring-task-4.0.xsd" >  
    <!-- 自动扫描该包,使SpringMVC认为包下用了@controller注解的类是控制器 -->  
  <mvc:annotation-driven/>
    <context:component-scan base-package="com.bls.mp.*"/>  
    <!--避免IE执行AJAX时,返回JSON出现下载文件 -->  
    <bean id="mappingJacksonHttpMessageConverter"  
        class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">  
        <property name="supportedMediaTypes">  
            <list>  
                <value>text/html;charset=UTF-8</value>  
            </list>  
        </property>  
    </bean>  
   <bean class="com.bls.mp.common.SpringTool"/>

    <!-- 启动SpringMVC的注解功能,完成请求和注解POJO的映射 -->  
 <!-- <bean  
        class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">  
        <property name="messageConverters">  
            <list>  
                <ref bean="mappingJacksonHttpMessageConverter" /> JSON转换器  
            </list>  
        </property>  
    </bean>-->  
    <!-- 定义跳转的文件的前后缀 ,视图模式配置-->  
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">  
        <!-- 这里的配置我的理解是自动给后面action的方法return的字符串加上前缀和后缀,变成一个 可用的url地址 -->  
        <property name="prefix" value="/WEB-INF/resources/jsp/" />  
        <property name="suffix" value=".jsp" />  
    </bean>  

    <!-- 配置文件上传,如果没有使用文件上传可以不用配置,当然如果不配,那么配置文件中也不必引入上传组件包 -->  
    <bean id="multipartResolver"    
        class="org.springframework.web.multipart.commons.CommonsMultipartResolver">    
        <!-- 默认编码 -->  
        <property name="defaultEncoding" value="utf-8" />    
        <!-- 文件大小最大值 -->  
        <property name="maxUploadSize" value="10485760000" />    
        <!-- 内存中的最大值 -->  
        <property name="maxInMemorySize" value="40960" />    
    </bean>   
    <!-- 全局异常处理器 -->
    <bean class="com.bls.mp.common.exception.CustomExceptionResolver"></bean>
  <mvc:annotation-driven/>
  <!-- 拦截器配置 -->
  <mvc:interceptors>
    <mvc:interceptor>
    <mvc:mapping path="/setadmin"/>
    <!--<mvc:mapping path="/user/userList"/> -->
    <mvc:mapping path="/Blocker"/>
    <mvc:mapping path="/grouponteam/grouponRanking"/> 
    <mvc:mapping path="/grouponteam/arriverTime"/> 
    <mvc:mapping path="/grouponteam/paging"/>
    <mvc:mapping path="/grouponteam/conditionGrouponT"/>
    <mvc:mapping path="/hospital/hospitalInfo"/>
    <mvc:mapping path="/hospital/setting"/>
    <mvc:mapping path="/hospital/orderdetails"/>
    <mvc:mapping path="/grouponteam/grouponTeamCountAndMoney"/>
    <mvc:mapping path="/grouponteam/OrderRefundList"/>
    <mvc:mapping path="/grouponteam/orderdetails"/>
    <mvc:mapping path="/grouponteam/paging"/>
    <mvc:mapping path="/grouponteam/conditionGrouponT"/>
    <mvc:mapping path="/grouponteam/grouponRanking"/>
    <mvc:mapping path="/grouponteam/arriverTime"/>
    <mvc:mapping path="/grouponteam/grouponTeamCountAndMoney"/>
    <mvc:mapping path="/imguoload"/>
    <mvc:mapping path="/imguoloads"/>
    <mvc:mapping path="/uploadFile"/>
    <mvc:mapping path="/uploadCenter"/>
    <mvc:mapping path="/onTheShelves"/>
    <mvc:mapping path="/updateTheRecommended"/>
    <mvc:mapping path="/deleteByGoods"/>
    <mvc:mapping path="/restoreGoods"/>
    <mvc:mapping path="/goods/goodslist"/>
    <mvc:mapping path="/goods/hasBeenOn"/>
    <mvc:mapping path="/goods/NotOn"/>
    <mvc:mapping path="/goods/RecycleBin"/>
    <mvc:mapping path="/goods/searchName"/>
    <mvc:mapping path="/goods/goodsdiy"/>

    <mvc:mapping path="/upload/uploadFile"/>
    <mvc:mapping path="/CreateClassImg"/>
    <mvc:mapping path="/imglist"/>

    <mvc:mapping path="/up_img"/>
    <mvc:mapping path="/moveImg"/>
    <mvc:mapping path="/deleteImg"/>

    <mvc:mapping path="/template/templateURL"/>
    <mvc:mapping path="/template/templateParentAll"/>
    <mvc:mapping path="/template/templatAll"/>
    <mvc:mapping path="/template/changeT"/>
    <mvc:mapping path="/template/deleteT"/>

    <mvc:mapping path="/TemplateMsg/addTemplateMsg"/>
    <mvc:mapping path="/TemplateMsg/templateMsgList"/>
    <mvc:mapping path="/TemplateMsg/templateSendlist"/>
    <mvc:mapping path="/TemplateMsg/TemplateSendMsg"/>
    <mvc:mapping path="/TemplateMsg/updataPTID"/>
    <mvc:mapping path="/TemplateMsg/deleteMB"/>

    <mvc:mapping path="/ThirdData/getdata"/>
    <mvc:mapping path="/ThirdData/updata"/>

    <mvc:mapping path="/setMoney/setMoneyList"/>
    <mvc:mapping path="/setMoney/setArriveMoney"/>
    <mvc:mapping path="/setMoney/checkfileCert"/>
    <mvc:mapping path="/setMoney/SetMoneyType"/>

    <mvc:mapping path="/user/userlists"/>
    <mvc:mapping path="/user/uOpenId"/>

    <mvc:mapping path="/visitor/theAlmostMoon"/>
    <mvc:mapping path="/visitor/SixAlmostMoon"/>
    <mvc:mapping path="/visitor/tops"/>


    <mvc:mapping path="/weixin/REFUND"/>



    <bean class="com.bls.mp.interceptor.AuthInterceptor"></bean>
    </mvc:interceptor>
  </mvc:interceptors>
  <task:annotation-driven/>
  <!-- 配置访问静态文件  -->
  <mvc:default-servlet-handler/>
  <mvc:resources location="/images/" mapping="/images/**"/>
  <mvc:resources location="/WEB-INF/js/" mapping="/js/**"/>
  <mvc:resources location="/WEB-INF/resources/jsp/" mapping="/jsp/**"/>
  <mvc:resources location="/WEB-INF/resources/css/" mapping="/css/**"/>
</beans>  

这是 web.xml

==============web.xml=====================
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>Archetype Created Web Application</display-name>

  <context-param>
    <param-name>contextConfigLocation</param-name>
       <param-value>classpath:spring-mybatis.xml</param-value>
       <param-value>classpath:spring-redis.xml</param-value>
  </context-param>
  <filter>
    <filter-name>encodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>encodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <filter>
        <filter-name>CORSFilter</filter-name>
        <filter-class>com.bls.mp.common.MyFilter</filter-class>
        <init-param>
            <param-name>excludedPages</param-name>
            <param-value>/UserAuthServlet</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>CORSFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>SpringMVC</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring-mvc.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>
  <servlet-mapping>
    <servlet-name>SpringMVC</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>/index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

这是spring-mybatis.xml 配置

==============spring-mybatis.xml=====================
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"  
    xmlns:context="http://www.springframework.org/schema/context"  
    xmlns:mvc="http://www.springframework.org/schema/mvc"  
    xsi:schemaLocation="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/mvc    
                        http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">  
    <!-- 自动扫描 -->  
    <context:component-scan base-package="com.bls.mp"/>  
    <!-- 引入配置文件 -->  
    <bean id="propertyConfigurer"  
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">  
        <property name="location" value="classpath:jdbc.properties" />  
    </bean>  

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"  
        destroy-method="close">  
        <property name="driverClassName" value="${jdbc.driver}" />  
        <property name="url" value="${jdbc.url}" />  
        <property name="username" value="${jdbc.username}" />  
        <property name="password" value="${jdbc.password}" />  
        <!-- 初始化连接大小 -->  
        <property name="initialSize" value="${initialSize}"></property>  
        <!-- 连接池最大数量 -->  
        <property name="maxActive" value="${maxActive}"></property>  
        <!-- 连接池最大空闲 -->  
        <property name="maxIdle" value="${maxIdle}"></property>  
        <!-- 连接池最小空闲 -->  
        <property name="minIdle" value="${minIdle}"></property>  
        <!-- 获取连接最大等待时间 -->  
        <property name="maxWait" value="${maxWait}"></property>  
    </bean>  

    <!-- spring和MyBatis完美整合,不需要mybatis的配置映射文件 -->  
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">  
        <property name="dataSource" ref="dataSource" />  
        <!-- 自动扫描mapping.xml文件 -->  
        <property name="mapperLocations" value="classpath:com/bls/mp/mapping/*.xml"></property>  
    </bean>  

    <!-- DAO接口所在包名,Spring会自动查找其下的类 -->  
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">  
        <property name="basePackage" value="com.bls.mp.dao" />  
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>  
    </bean>  

    <!-- (事务管理)transaction manager, use JtaTransactionManager for global tx -->  
    <bean id="transactionManager"  
        class="org.springframework.jdbc.datasource.DataSourceTransactionManager">  
        <property name="dataSource" ref="dataSource" />  
    </bean>  


</beans>

这是spring-redis.xml配置

===================spring-redis.xml==============
<?xml version="1.0" encoding="UTF-8"?>
<beans    xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:p="http://www.springframework.org/schema/p"
          xmlns:tx="http://www.springframework.org/schema/tx"
          xmlns:context="http://www.springframework.org/schema/context"
          xsi:schemaLocation="
      http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.springframework.org/schema/tx
      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:property-placeholder location="classpath:*.properties"/>
    <!--设置数据池-->
    <bean id="poolConfig"  class="redis.clients.jedis.JedisPoolConfig">
        <property name="maxIdle" value="${redis.maxIdle}"></property>
        <property name="minIdle" value="${redis.minIdle}"></property>
        <property name="maxTotal" value="${redis.maxTotal}"></property>
        <property name="maxWaitMillis" value="${redis.maxWaitMillis}"></property>
        <property name="testOnBorrow" value="${redis.testOnBorrow}"></property>
    </bean>
    <!--链接redis-->
    <bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
     <property name="hostName" value="${redis.host}"></property>
        <property name="port" value="${redis.port}"></property>
        <property name="password" value="${redis.password}"></property>
       <property name="timeout" value="${redis.timeout}"></property>
        <property name="poolConfig" ref="poolConfig"></property>
    </bean>

    <bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate" p:connection-factory-ref="connectionFactory" >
        <!--以下针对各种数据进行序列化方式的选择-->
        <property name="keySerializer">
            <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" />
        </property>
        <property name="valueSerializer">
            <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" />
        </property>
        <property name="hashKeySerializer">
            <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" />
        </property>
        <!--<property name="hashValueSerializer">
            <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" />
        </property>-->
    </bean>
</beans>
  • 写回答

2条回答 默认 最新

  • 忆白。 2019-10-22 10:31
    关注

    jar 包冲突,仔细看看你的spring版本.

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

报告相同问题?

悬赏问题

  • ¥15 关于#vscode#的问题:ESP32开发板对接MQTT实现小灯泡的开关
  • ¥15 TMC2209串口模式下读取不到寄存器的值串口助手蓝色字体是发过去的消息,绿色字体是收到的消息,第二行发送读取寄存器的指令但是没有读取到寄存器的值串口助手如下图:接线如下图,如何解决?
  • ¥15 高通安卓11提取完整线刷包软件,或者优博讯dt50顺丰刷机包
  • ¥20 C,有个译码器,换了信道就跑不出原来数据
  • ¥15 MIMIC数据库安装问题
  • ¥60 基于JTag协议开发Fpga下载器上位机,哪位大🐂有偿指导?
  • ¥20 全书网Java爬取数据
  • ¥15 怎么获取红包封面的原始链接,并且获取红包封面序列号
  • ¥100 微信小程序跑脚本授权的问题
  • ¥100 房产抖音小程序苹果搜不到安卓可以付费悬赏