请大侠帮我看看这到底是什么错误,我的包都导入了,找了半天没找到错误的根 源,求解?我这是springmvc的
Causedby:org.springframework.beans.BeanInstantiationException:Couldnotinstantiatebean...
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.controller.UserController]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The import org.springframework.web.bind.annotation.PathVariable cannot be resolved
PathVariable cannot be resolved to a type
PathVariable cannot be resolved to a type
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1030)
... 43 more
Caused by: java.lang.Error: Unresolved compilation problems:
The import org.springframework.web.bind.annotation.PathVariable cannot be resolved
PathVariable cannot be resolved to a type
PathVariable cannot be resolved to a type
at com.controller.UserController.<init>(UserController.java:7)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
... 45 more
可能是jar包有问题,但是不知道是哪个包有问题.请大侠帮我看看 十分感谢!!!!!! 展开
The import org.springframework.web.bind.annotation.PathVariable cannot be resolved
PathVariable cannot be resolved to a type
PathVariable cannot be resolved to a type
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1030)
... 43 more
Caused by: java.lang.Error: Unresolved compilation problems:
The import org.springframework.web.bind.annotation.PathVariable cannot be resolved
PathVariable cannot be resolved to a type
PathVariable cannot be resolved to a type
at com.controller.UserController.<init>(UserController.java:7)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
... 45 more
可能是jar包有问题,但是不知道是哪个包有问题.请大侠帮我看看 十分感谢!!!!!! 展开
1个回答
展开全部
不是你jar问题,看提示
Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
[com.controller.UserController这个类的注释有问题,解析出错
Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
[com.controller.UserController这个类的注释有问题,解析出错
更多追问追答
追问
java.lang.NoSuchMethodError: org.springframework.web.context.support.WebApplicationContextUtils.initServletPropertySources(Lorg/springframework/core/env/MutablePropertySources;
追答
缺少对应的jar包
jar包冲突
jar包版本不对
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询