dubbo起步搭建Spring+SpringMVC+dubbo的开发环境

今天SpringMVC + Dubbo 启动时把错了!


java.lang.NullPointerException
org.springframework.core.SerializableTypeWrapper$TypeProxyInvocationHandler.invoke(SerializableTypeWrapper.java:239)
org.springframework.core.$Proxy5.hashCode(Unknown Source)
org.springframework.util.ObjectUtils.nullSafeHashCode(ObjectUtils.java:273)
org.springframework.core.ResolvableType.hashCode(ResolvableType.java:811)
org.springframework.util.ConcurrentReferenceHashMap.getHash(ConcurrentReferenceHashMap.java:214)
org.springframework.util.ConcurrentReferenceHashMap.getReference(ConcurrentReferenceHashMap.java:246)
org.springframework.util.ConcurrentReferenceHashMap.get(ConcurrentReferenceHashMap.java:226)
org.springframework.core.ResolvableType.forType(ResolvableType.java:1186)
org.springframework.core.ResolvableType.forType(ResolvableType.java:1165)
org.springframework.core.ResolvableType.forTypes(ResolvableType.java:844)
org.springframework.core.ResolvableType.getInterfaces(ResolvableType.java:403)
org.springframework.core.ResolvableType.as(ResolvableType.java:365)
org.springframework.core.convert.support.GenericConversionService.getRequiredTypeInfo(GenericConversionService.java:266)
org.springframework.core.convert.support.GenericConversionService.addConverterFactory(GenericConversionService.java:103)
org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:79)
org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:63)
org.springframework.core.convert.support.DefaultConversionService.<init>(DefaultConversionService.java:50)
org.springframework.core.env.AbstractPropertyResolver.<init>(AbstractPropertyResolver.java:41)
org.springframework.core.env.PropertySourcesPropertyResolver.<init>(PropertySourcesPropertyResolver.java:41)
org.springframework.core.env.AbstractEnvironment.<init>(AbstractEnvironment.java:112)
org.springframework.core.env.StandardEnvironment.<init>(StandardEnvironment.java:54)
org.springframework.web.context.support.StandardServletEnvironment.<init>(StandardServletEnvironment.java:44)
org.springframework.web.servlet.HttpServletBean.createEnvironment(HttpServletBean.java:215)
org.springframework.web.servlet.HttpServletBean.getEnvironment(HttpServletBean.java:205)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:160)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)

Baidu这个"
TypeProxyInvocationHandler.invoke(SerializableTypeWrapper.java:239)
"

有人也发生这个错..得到的结果是Jar冲突.去libs下载遍历了一下..好像没发现什么重复的Jar(只是版本号不一样).

继续Baidu有人说把web.xml下的配置SpringMVC的

<load-on-startup>1</load-on-startup>
删除了就可以,

删除后,启动时确定也不报错了,但是运行SpringMVC的请求时问题就会出现了.治标不治本!

后来Baidu了下"Dubbo"发现他用的是Spring2.5.再我去libs看了一个确实多了一个Spring-2.5.jar的包..和我的4.4是冲突的

修改了一下pom.xml问题解决了!

原本:

<dependency>
  <groupId>com.alibaba</groupId>
  <artifactId>dubbo</artifactId>
  <version>${dubbo.version}</version>
</dependency>

修后:

<dependency>
  <groupId>com.alibaba</groupId>
  <artifactId>dubbo</artifactId>
  <version>${dubbo.version}</version>
  <exclusions>
   <exclusion>
    <artifactId>spring</artifactId>
    <groupId>org.springframework</groupId>
   </exclusion>
  </exclusions>
</dependency>





转载于:https://my.oschina.net/vistier/blog/834395

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值