這個(gè)項(xiàng)目主要采用的技術(shù)是SSM+shiro,自動(dòng)添加了shiro配置就出現(xiàn)這樣的情況,現(xiàn)在啟動(dòng)報(bào)錯(cuò)如下:
*[2018-03-16 03:46:17,944] Artifact InfosdWebServerV1:war: Artifact is being deployed, please wait...
16-Mar-2018 15:46:23.231 信息 [RMI TCP Connection(4)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.ht... for further details.
16-Mar-2018 15:46:23.341 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization started
16-Mar-2018 15:46:23.416 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing Root WebApplicationContext: startup date [Fri Mar 16 15:46:23 CST 2018]; root of context hierarchy
16-Mar-2018 15:46:23.499 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from class path resource [applicationContext.xml]
16-Mar-2018 15:46:24.186 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' of type [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:24.750 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#0' of type [org.springframework.beans.factory.config.MethodInvokingFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
MLog initialization issue: slf4j found no binding or threatened to use its (dangerously silent) NOPLogger. We consider the slf4j library not found.
16-Mar-2018 15:46:24.860 信息 [MLog-Init-Reporter] com.mchange.v2.log.MLog. MLog clients using java 1.4+ standard logging.
16-Mar-2018 15:46:24.938 信息 [RMI TCP Connection(4)-127.0.0.1] com.mchange.v2.c3p0.C3P0Registry. Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
16-Mar-2018 15:46:25.081 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'dataSource' of type [com.mchange.v2.c3p0.ComboPooledDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:25.935 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sqlSessionFactory' of type [org.mybatis.spring.SqlSessionFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:25.948 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:25.981 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sqlSession' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:25.991 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'userMapper' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.000 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'userMapper' of type [com.sun.proxy.$Proxy13] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.024 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'userServiceImpl' of type [com.infosd.serviceImpl.UserServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.063 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'transactionManager' of type [org.springframework.jdbc.datasource.DataSourceTransactionManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.075 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean '(inner bean)#1676f93' of type [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.077 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'txAdvice' of type [org.springframework.transaction.interceptor.TransactionInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.435 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'cacheManager' of type [org.apache.shiro.cache.ehcache.EhCacheManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.453 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'credentialsMatcher' of type [com.infosd.credentials.RetryLimitHashedCredentialsMatcher] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.456 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'userRealm' of type [com.infosd.realm.UserRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.510 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sessionValidationScheduler' of type [org.apache.shiro.session.mgt.quartz.QuartzSessionValidationScheduler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.533 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sessionIdGenerator' of type [org.apache.shiro.session.mgt.eis.JavaUuidSessionIdGenerator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.534 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sessionDAO' of type [org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.544 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sessionIdCookie' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.549 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sessionListener1' of type [com.infosd.utils.MySessionListener] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.551 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'sessionManager' of type [org.apache.shiro.web.session.mgt.DefaultWebSessionManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.663 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'rememberMeCookie' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.664 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'rememberMeManager' of type [org.apache.shiro.web.mgt.CookieRememberMeManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.669 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:26.669 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization Bean 'org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor#0' of type [org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16-Mar-2018 15:46:27.653 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory E:Tomcat 8.0 64bitapache-tomcat-8.0.50webappsmanager
16-Mar-2018 15:46:27.848 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization completed in 4507 ms
16-Mar-2018 15:46:27.888 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory E:Tomcat 8.0 64bitapache-tomcat-8.0.50webappsmanager has finished in 234 ms
16-Mar-2018 15:46:27.909 嚴(yán)重 [RMI TCP Connection(4)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
16-Mar-2018 15:46:27.910 嚴(yán)重 [RMI TCP Connection(4)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [/InfosdWebServerV1] startup failed due to previous errors
16-Mar-2018 15:46:27.912 信息 [RMI TCP Connection(4)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.doClose Closing Root WebApplicationContext: startup date [Fri Mar 16 15:46:23 CST 2018]; root of context hierarchy
16-Mar-2018 15:46:27.955 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.simpl.SimpleThreadPool.initialize Job execution threads will use class loader of thread: RMI TCP Connection(4)-127.0.0.1
16-Mar-2018 15:46:27.974 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.core.SchedulerSignalerImpl.<init> Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
16-Mar-2018 15:46:27.974 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.core.QuartzScheduler.<init> Quartz Scheduler v.1.6.1 created.
16-Mar-2018 15:46:27.976 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.simpl.RAMJobStore.initialize RAMJobStore initialized.
16-Mar-2018 15:46:27.977 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.impl.StdSchedulerFactory.instantiate Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
16-Mar-2018 15:46:27.977 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.impl.StdSchedulerFactory.instantiate Quartz scheduler version: 1.6.1
16-Mar-2018 15:46:27.978 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.core.QuartzScheduler.shutdown Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.
16-Mar-2018 15:46:27.978 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.core.QuartzScheduler.standby Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.
16-Mar-2018 15:46:27.979 信息 [RMI TCP Connection(4)-127.0.0.1] org.quartz.core.QuartzScheduler.shutdown Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.
[2018-03-16 03:46:28,001] Artifact InfosdWebServerV1:war: Error during artifact deployment. See server log for details.*
我看了下,主要是同一個(gè)錯(cuò)誤:is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying),應(yīng)該是springAop代理的問題,一直找不到源頭在哪?
以下是配置文件:
<?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_2_5.xsd"
id="WebApp_ID" version="2.5">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceRequestEncoding</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>forceResponseEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>HiddenHttpMethodFilter</filter-name>
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>HiddenHttpMethodFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>HttpPutFormContentFilter</filter-name>
<filter-class>org.springframework.web.filter.HttpPutFormContentFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>HttpPutFormContentFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<!--<param-name>shiroConfig</param-name>
<param-value>classpath:spring-shiro.xml</param-value>-->
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
applicationContext.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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<!-- spring 的配置文件,這里主要配置和業(yè)務(wù)邏輯有關(guān) -->
<!-- 數(shù)據(jù)源 ,事務(wù)控制 -->
<context:component-scan base-package="com.infosd.**">
<!-- 不掃描controller,其他都掃描 -->
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!--引入jdbc配置 -->
<context:property-placeholder location="classpath:jdbc.properties" />
<!--配置數(shù)據(jù)源 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc_driverClassName}" />
<property name="jdbcUrl" value="${jdbc_url}" />
<property name="user" value="${jdbc_username}" />
<property name="password" value="${jdbc_password}" />
<!--連接池中保存的最大連接數(shù)目 -->
<property name="maxPoolSize" value="20" />
<!--連接池中保存的最少連接數(shù)目 -->
<property name="minPoolSize" value="2" />
<!-- 初始化連接大小 -->
<property name="initialPoolSize" value="2" />
<!-- 獲取連接最大等待時(shí)間 -->
<property name="maxConnectionAge" value="6000" />
<!-- 連接池最大空閑 -->
<property name="maxIdleTime" value="60" />
</bean>
<!-- 整合配置MyBatis start -->
<!-- 配置和MyBatis的整合,創(chuàng)建sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!--注入數(shù)據(jù)源 -->
<property name="dataSource" ref="dataSource" />
<!-- 指定mybatis全局配置文件的位置 -->
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<!--用于配置mapper映射xml -->
<property name="mapperLocations" value="classpath:mapper/*.xml" />
</bean>
<!--?配置掃描器,將mybatis接口的實(shí)現(xiàn)加入到ioc容器中 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 掃描所有dao接口的實(shí)現(xiàn),加入到ioc容器中 -->
<property name="basePackage" value="com.infosd.dao" />
</bean>
<!-- 整合配置MyBatis end -->
<!-- 配置一個(gè)可以執(zhí)行批量的sqlSession -->
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"></constructor-arg>
<!-- 執(zhí)行類型批量 -->
<constructor-arg name="executorType" value="BATCH"></constructor-arg>
</bean>
<!-- 對(duì)數(shù)據(jù)源進(jìn)行事務(wù)管理 -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!-- 控制數(shù)據(jù)源 -->
<property name="dataSource" ref="dataSource" />
</bean>
<aop:config proxy-target-class="true">
<aop:pointcut expression="execution(* com.infosd.service..*(..))"
id="txPoint" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint" />
</aop:config>
<!-- 配置事務(wù)增強(qiáng) -->
<!-- transaction-manager="transactionManager" 為默認(rèn)值,如果事務(wù)名字不同需修改 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 所有方法都是事務(wù)方法 -->
<tx:method name="*" />
<!-- 以get開始的所有方法 -->
<tx:method name="get*" read-only="true" />
<!-- 新增配置start -->
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="edit*" propagation="REQUIRED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="new*" propagation="REQUIRED" />
<tx:method name="set*" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="change*" propagation="REQUIRED" />
<tx:method name="check*" propagation="REQUIRED" />
<tx:method name="get*" propagation="REQUIRED" read-only="true" />
<tx:method name="find*" propagation="REQUIRED" read-only="true" />
<tx:method name="load*" propagation="REQUIRED" read-only="true" />
<tx:method name="*" propagation="REQUIRED" read-only="true" />
<!-- 新增配置end -->
</tx:attributes>
</tx:advice>
<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManagerConfigFile" value="classpath:ehcache.xml" />
</bean>
<!-- 憑證匹配器 -->
<bean id="credentialsMatcher" class="com.infosd.credentials.RetryLimitHashedCredentialsMatcher">
<constructor-arg ref="cacheManager" />
<property name="hashAlgorithmName" value="md5" />
<property name="hashIterations" value="2" />
<property name="storedCredentialsHexEncoded" value="true" />
</bean>
<!-- Realm實(shí)現(xiàn) -->
<bean id="userRealm" class="com.infosd.realm.UserRealm">
<!-- <property name="userService" ref="userService" /> -->
<property name="credentialsMatcher" ref="credentialsMatcher" />
<property name="cachingEnabled" value="true" />
<property name="authenticationCachingEnabled" value="true" />
<property name="authenticationCacheName" value="authenticationCache" />
<property name="authorizationCachingEnabled" value="true" />
<property name="authorizationCacheName" value="authorizationCache" />
</bean>
<!-- 會(huì)話ID 生成器 -->
<bean id="sessionIdGenerator"
class="org.apache.shiro.session.mgt.eis.JavaUuidSessionIdGenerator" />
<!-- 會(huì)話DAO -->
<bean id="sessionDAO"
class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
<property name="activeSessionsCacheName" value="shiro-activeSessionCache" />
<property name="sessionIdGenerator" ref="sessionIdGenerator" />
</bean>
<!-- 會(huì)話驗(yàn)證調(diào)度器 sessionValidationInterval:設(shè)置調(diào)度時(shí)間間隔 -->
<bean id="sessionValidationScheduler"
class="org.apache.shiro.session.mgt.quartz.QuartzSessionValidationScheduler">
<property name="sessionValidationInterval" value="18000000" />
<property name="sessionManager" ref="sessionManager" />
</bean>
<!-- 會(huì)話Cookie 模板 -->
<bean id="sessionIdCookie" class="org.apache.shiro.web.servlet.SimpleCookie">
<constructor-arg value="sid" />
<property name="httpOnly" value="true" />
<property name="maxAge" value="1800" />
</bean>
<!-- 記住密碼cookie -->
<bean id="rememberMeCookie" class="org.apache.shiro.web.servlet.SimpleCookie">
<constructor-arg value="rememberMe" />
<property name="httpOnly" value="true" />
<property name="maxAge" value="2592000" /><!-- 30天 30*24*60*60 -->
</bean>
<!-- rememberMe管理器,cipherKey是加密rememberMe Cookie的密鑰;默認(rèn)AES算 -->
<bean id="rememberMeManager" class="org.apache.shiro.web.mgt.CookieRememberMeManager">
<property name="cipherKey"
value="#{T(org.apache.shiro.codec.Base64).decode('4AvVhmFLUs0KTA3Kprsdag==')}" />
<property name="cookie" ref="rememberMeCookie" />
</bean>
<!-- 會(huì)話管理器 globalSessionTimeout:設(shè)置全局會(huì)話超時(shí)時(shí)間,默認(rèn)30分鐘,即如果30分鐘內(nèi)沒有訪問會(huì)話將過期 sessionValidationSchedulerEnabled:是否開啟會(huì)話驗(yàn)證器,默認(rèn)是開啟的 -->
<bean id="sessionManager"
class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<property name="globalSessionTimeout" value="18000000" />
<property name="deleteInvalidSessions" value="true" />
<property name="sessionValidationSchedulerEnabled" value="true" />
<property name="sessionValidationScheduler" ref="sessionValidationScheduler" />
<property name="sessionDAO" ref="sessionDAO" />
<property name="sessionIdCookieEnabled" value="true" />
<property name="sessionIdCookie" ref="sessionIdCookie" />
<property name="sessionListeners" ref="sessionListener1" />
</bean>
<!-- 監(jiān)聽會(huì)話 -->
<bean id="sessionListener1" class="com.infosd.utils.MySessionListener"></bean>
<!-- 安全管理器 -->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="userRealm" />
<property name="sessionManager" ref="sessionManager" />
<property name="cacheManager" ref="cacheManager" />
<property name="rememberMeManager" ref="rememberMeManager" />
</bean>
<!-- kickoutSessionControlFilter 用于控制并發(fā)登錄人數(shù)的 -->
<bean id="kickoutSessionControlFilter" class="com.infosd.utils.KickoutSessionControlFilter">
<property name="cacheManager" ref="cacheManager" />
<property name="sessionManager" ref="sessionManager" />
<property name="kickoutAfter" value="false" />
<property name="maxSession" value="2" />
<property name="kickoutUrl" value="/login?kickout=1" />
</bean>
<!-- 相當(dāng)于調(diào)用SecurityUtils.setSecurityManager(securityManager) -->
<bean
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="staticMethod"
value="org.apache.shiro.SecurityUtils.setSecurityManager" />
<property name="arguments" ref="securityManager" />
</bean>
<!-- Shiro 生命周期處理器 -->
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />
<bean id="formAuthenticationFilter"
class="org.apache.shiro.web.filter.authc.FormAuthenticationFilter">
<property name="usernameParam" value="username" />
<property name="passwordParam" value="password" />
<property name="rememberMeParam" value="rememberMe" />
<property name="loginUrl" value="/login" />
</bean>
<!-- Shiro 的Web過濾器 -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager" />
<property name="loginUrl" value="/login" />
<property name="successUrl" value="/index" />
<property name="unauthorizedUrl" value="/unauthorized" />
<!-- <property name="filters">
<util:map>
<entry key="authc" value-ref="formAuthenticationFilter" />
<entry key="kickout" value-ref="kickoutSessionControlFilter" />
</util:map>
</property> -->
<property name="filterChainDefinitions">
<value>
/static/** = anon
/index = anon
/unauthorized = anon
/login =authc
/logout = logout
/admin/**=authc,roles["超級(jí)管理員"]
</value>
</property>
</bean>
<bean
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="org.apache.shiro.authz.UnauthorizedException">
/unauthorized
</prop>
<prop key="org.apache.shiro.authz.UnauthenticatedException">
/Unauthenticated-login
</prop>
</props>
</property>
</bean>
<!-- 開啟Shiro注解 -->
<bean
class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
depends-on="lifecycleBeanPostProcessor" />
<bean
class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManager" />
</bean>
<!-- 整合配置Shiro end -->
</beans>
不知道問題出在哪里了?前期ssm都是可以運(yùn)行的,加入了shiro就出現(xiàn)這個(gè)錯(cuò)
16-Mar-2018 15:46:27.909 嚴(yán)重 [RMI TCP Connection(4)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
你要看一下其它日志,一般是tomcat下/logs/localhost/localhost.yyyy-MM-dd.log類似名字的
看看有什么報(bào)錯(cuò)
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國(guó)家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國(guó)制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國(guó)職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問,美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。