项目中Dubbo和shiro,
Dubbo服务在controller中引用 没有问题,
但是到了shiro的realm里面,引用 就是为空
网上说,让dubbo在shiro之前加载 。
但是我已经让shiro的配置文件放到了dubbo里面,还是不行
<?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:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 -->
<dubbo:application name="tepower_consumer" />
<!-- 使用zookeeper注册中心暴露服务地址 -->
<!-- <dubbo:registry address="multicast://224.5.6.7:1234" /> -->
<dubbo:registry address="zookeeper://192.168.10.100:2181" /> <!-- 生成远程服务代理,可以像使用本地bean一样使用demoService --> <!-- 工作流服务 -->
<dubbo:reference id="sysUserApi"
interface="com.tepower.framework.api.SysUserApi" timeout="6000" check="false" ></dubbo:reference> <!-- 引用 shiro配置 dubbo需要在shiro之前加载,否则shiro引用 dubbo服务会出现 空指针 -->
<import resource="classpath*:/spring/applicationContext-shiro.xml" /></beans>
Dubbo服务在controller中引用 没有问题,
但是到了shiro的realm里面,引用 就是为空
网上说,让dubbo在shiro之前加载 。
但是我已经让shiro的配置文件放到了dubbo里面,还是不行
<?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:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 -->
<dubbo:application name="tepower_consumer" />
<!-- 使用zookeeper注册中心暴露服务地址 -->
<!-- <dubbo:registry address="multicast://224.5.6.7:1234" /> -->
<dubbo:registry address="zookeeper://192.168.10.100:2181" /> <!-- 生成远程服务代理,可以像使用本地bean一样使用demoService --> <!-- 工作流服务 -->
<dubbo:reference id="sysUserApi"
interface="com.tepower.framework.api.SysUserApi" timeout="6000" check="false" ></dubbo:reference> <!-- 引用 shiro配置 dubbo需要在shiro之前加载,否则shiro引用 dubbo服务会出现 空指针 -->
<import resource="classpath*:/spring/applicationContext-shiro.xml" /></beans>
解决方案 »
- displaytag使用
- 对预编译的sql语句凝问?
- 奇怪的问题???
- 请问~!怎么把weblogic的端口号7001改成80~!?
- 寻找一个JAVA开发团队
- 求救:tomcat和sql server2000连接出现NullPointerException问题!急!!
- Web开发人员究竟做些什么的讨论
- 元旦值班 + 睡眠不中 + 昨天第一次被误认为女生 = 散分!
- 请教有关隐藏本页真实名的问题!
- 配置TOMCAT虚拟目录,让SERVLET可以在该目录下运行
- log4j日志测试正常,部署服务器后只有启动的时候生成一个日志文件,今后所有的日志都写到这个文件,没有按天分割
- JDBC读取MySQL数据库 中文内容正确显示 中文列名无法争取显示
http://blog.csdn.net/majian_1987/article/details/11170841楼主看下这个,实现一个类,你就可以随处使用spring bean了。