shiro拦截导致dubbo消费者reference注册不成功

是夜色太荒芜 发布于 2017/08/15 16:36
阅读 968
收藏 2

dubbo referen配置

shiro配置

	<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
		<property name="securityManager" ref="securityManager" />
		<property name="loginUrl" value="/security/login.action" />
		<property name="successUrl" value="/security/first.action"/>
		<property name="unauthorizedUrl" value="/refuse.jsp" />
		<property name="filterChainDefinitions">
			<value>
				/images/** = anon
				/js/** = anon
				/styles/** = anon
				/logout.action = logout
				/index.jsp  = user
				/first.action = user
				/welcome.jsp = user
				/** = authc
			</value>
		</property>
	</bean>

	<!-- securityManager安全管理器 -->
	<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
		<property name="realm" ref="customRealm" />
		<property name="cacheManager" ref="cacheManager"/>
		<property name="sessionManager" ref="sessionManager" />
	</bean>

spring中SecurityService bean也创建成功

  [DEBUG] [2017-08-15 15:26:41] org.springframework.context.support.AbstractApplicationContext.initApplicationEventMulticaster(831) | Unable to locate ApplicationEventMulticaster with name 
  'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@82e5501]
  [DEBUG] [2017-08-15 15:26:41] org.springframework.ui.context.support.UiApplicationContextUtils.initThemeSource(85) | Unable to locate ThemeSource with name 'themeSource': 
  using default [org.springframework.ui.context.support.ResourceBundleThemeSource@4c79330a]
  [INFO] [2017-08-15 15:26:41] org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(596) |
  Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2e45d01e:
  defining beans [securityService,shiroFilter,securityManager,customRealm,credentialsMatcher,cacheManager,sessionManager]; root of factory hierarchy
  [DEBUG] [2017-08-15 15:26:41] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(215) | Creating shared instance of singleton bean 'securityService'
  [DEBUG] [2017-08-15 15:26:41] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(432) | Creating instance of bean 'securityService'
  [DEBUG] [2017-08-15 15:26:41] com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClassCode(943) |  [DUBBO] package com.alibaba.dubbo.rpc;

dubbo消费者consumer(SecurityService)注册不成功

加载中
0
是夜色太荒芜
是夜色太荒芜

已解决 原理:http://www.cnblogs.com/linjiqin/p/5859153.html

方法:加入配置 init="true"

0
是夜色太荒芜
是夜色太荒芜

引用来自“是夜色太荒芜”的评论

已解决 原理:http://www.cnblogs.com/linjiqin/p/5859153.html

方法:加入配置 init="true"

BINGO

返回顶部
顶部