dubbo起步搭建Spring+SpringMVC+dubbo的开发环境
dubbo起步搭建Spring+SpringMVC+dubbo的开发环境
卖女孩的小火柴 发表于1年前
dubbo起步搭建Spring+SpringMVC+dubbo的开发环境
  • 发表于 1年前
  • 阅读 13
  • 收藏 0
  • 点赞 0
  • 评论 0

【腾讯云】新注册用户域名抢购1元起>>>   

今天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>





  • 打赏
  • 点赞
  • 收藏
  • 分享
共有 人打赏支持
卖女孩的小火柴
粉丝 3
博文 25
码字总数 124
×
卖女孩的小火柴
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: