Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.Be
关于报错Error creating bean with name ‘adServiceImpl’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:
随便粘一点代码吧
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘adServiceImpl’: Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.imooc.dao.AdDao org.imooc.service.serviceImpl.AdServiceImpl.adDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘adDao’ defined in file [D:\GitCode\comment\comment\out\artifacts\comment_war_exploded\WEB-INF\classes\org\imooc\dao\AdDao.class]: Cannot resolve reference to bean ‘sqlSessionFactory’ while setting bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\GitCode\comment\comment\out\artifacts\comment_war_exploded\WEB-INF\classes\mapper\AdDao.xml]’; nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘Ad’. Cause: java.lang.ClassNotFoundException: Cannot find class: Ad
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory
1.getObject(AbstractBeanFactory.java:305)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:835)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)atorg.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)atorg.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)atcom.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)atorg.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482)atorg.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)atcom.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)atjavax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)atjavax.management.remote.rmi.RMIConnectionImpl.access
1.
g
e
t
O
b
j
e
c
t
(
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
j
a
v
a
:
305
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
s
u
p
p
o
r
t
.
D
e
f
a
u
l
t
S
i
n
g
l
e
t
o
n
B
e
a
n
R
e
g
i
s
t
r
y
.
g
e
t
S
i
n
g
l
e
t
o
n
(
D
e
f
a
u
l
t
S
i
n
g
l
e
t
o
n
B
e
a
n
R
e
g
i
s
t
r
y
.
j
a
v
a
:
230
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
s
u
p
p
o
r
t
.
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
d
o
G
e
t
B
e
a
n
(
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
j
a
v
a
:
301
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
s
u
p
p
o
r
t
.
A
b
s
t
r
a
c
t
B
e
a
n
F
a
c
t
o
r
y
.
g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
i
o
n
I
m
p
l
.
a
c
c
e
s
s
300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl
PrivilegedOperation.run(RMIConnectionImpl.java:1309)atjavax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)atjavax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atsun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)atsun.rmi.transport.Transport
P
r
i
v
i
l
e
g
e
d
O
p
e
r
a
t
i
o
n
.
r
u
n
(
R
M
I
C
o
n
n
e
c
t
i
o
n
I
m
p
l
.
j
a
v
a
:
1309
)
a
t
j
a
v
a
x
.
m
a
n
a
g
e
m
e
n
t
.
r
e
m
o
t
e
.
r
m
i
.
R
M
I
C
o
n
n
e
c
t
i
o
n
I
m
p
l
.
d
o
P
r
i
v
i
l
e
g
e
d
O
p
e
r
a
t
i
o
n
(
R
M
I
C
o
n
n
e
c
t
i
o
n
I
m
p
l
.
j
a
v
a
:
1401
)
a
t
j
a
v
a
x
.
m
a
n
a
g
e
m
e
n
t
.
r
e
m
o
t
e
.
r
m
i
.
R
M
I
C
o
n
n
e
c
t
i
o
n
I
m
p
l
.
i
n
v
o
k
e
(
R
M
I
C
o
n
n
e
c
t
i
o
n
I
m
p
l
.
j
a
v
a
:
829
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
0
(
N
a
t
i
v
e
M
e
t
h
o
d
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
(
N
a
t
i
v
e
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
j
a
v
a
:
62
)
a
t
s
u
n
.
r
e
f
l
e
c
t
.
D
e
l
e
g
a
t
i
n
g
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
i
n
v
o
k
e
(
D
e
l
e
g
a
t
i
n
g
M
e
t
h
o
d
A
c
c
e
s
s
o
r
I
m
p
l
.
j
a
v
a
:
43
)
a
t
j
a
v
a
.
l
a
n
g
.
r
e
f
l
e
c
t
.
M
e
t
h
o
d
.
i
n
v
o
k
e
(
M
e
t
h
o
d
.
j
a
v
a
:
498
)
a
t
s
u
n
.
r
m
i
.
s
e
r
v
e
r
.
U
n
i
c
a
s
t
S
e
r
v
e
r
R
e
f
.
d
i
s
p
a
t
c
h
(
U
n
i
c
a
s
t
S
e
r
v
e
r
R
e
f
.
j
a
v
a
:
346
)
a
t
s
u
n
.
r
m
i
.
t
r
a
n
s
p
o
r
t
.
T
r
a
n
s
p
o
r
t
1.run(Transport.java:200)
at sun.rmi.transport.Transport
1.run(Transport.java:197)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.Transport.serviceCall(Transport.java:196)atsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)atsun.rmi.transport.tcp.TCPTransport
1.
r
u
n
(
T
r
a
n
s
p
o
r
t
.
j
a
v
a
:
197
)
a
t
j
a
v
a
.
s
e
c
u
r
i
t
y
.
A
c
c
e
s
s
C
o
n
t
r
o
l
l
e
r
.
d
o
P
r
i
v
i
l
e
g
e
d
(
N
a
t
i
v
e
M
e
t
h
o
d
)
a
t
s
u
n
.
r
m
i
.
t
r
a
n
s
p
o
r
t
.
T
r
a
n
s
p
o
r
t
.
s
e
r
v
i
c
e
C
a
l
l
(
T
r
a
n
s
p
o
r
t
.
j
a
v
a
:
196
)
a
t
s
u
n
.
r
m
i
.
t
r
a
n
s
p
o
r
t
.
t
c
p
.
T
C
P
T
r
a
n
s
p
o
r
t
.
h
a
n
d
l
e
M
e
s
s
a
g
e
s
(
T
C
P
T
r
a
n
s
p
o
r
t
.
j
a
v
a
:
568
)
a
t
s
u
n
.
r
m
i
.
t
r
a
n
s
p
o
r
t
.
t
c
p
.
T
C
P
T
r
a
n
s
p
o
r
t
ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport
ConnectionHandler.lambda
C
o
n
n
e
c
t
i
o
n
H
a
n
d
l
e
r
.
l
a
m
b
d
a
run
0(TCPTransport.java:683)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.tcp.TCPTransport
0
(
T
C
P
T
r
a
n
s
p
o
r
t
.
j
a
v
a
:
683
)
a
t
j
a
v
a
.
s
e
c
u
r
i
t
y
.
A
c
c
e
s
s
C
o
n
t
r
o
l
l
e
r
.
d
o
P
r
i
v
i
l
e
g
e
d
(
N
a
t
i
v
e
M
e
t
h
o
d
)
a
t
s
u
n
.
r
m
i
.
t
r
a
n
s
p
o
r
t
.
t
c
p
.
T
C
P
T
r
a
n
s
p
o
r
t
ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor
Worker.run(ThreadPoolExecutor.java:617)atjava.lang.Thread.run(Thread.java:748)Causedby:org.springframework.beans.factory.BeanCreationException:Couldnotautowirefield:privateorg.imooc.dao.AdDaoorg.imooc.service.serviceImpl.AdServiceImpl.adDao;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname‘adDao′definedinfile[D:\GitCode\comment\comment\out\artifacts\commentwarexploded\WEB−INF\classes\org\imooc\dao\AdDao.class]:Cannotresolvereferencetobean‘sqlSessionFactory′whilesettingbeanproperty‘sqlSessionFactory′;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname‘sqlSessionFactory′definedinclasspathresource[applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.springframework.core.NestedIOException:Failedtoparsemappingresource:‘file[D:\GitCode\comment\comment\out\artifacts\commentwarexploded\WEB−INF\classes\mapper\AdDao.xml]′;nestedexceptionisjava.lang.RuntimeException:ErrorparsingMapperXML.Cause:org.apache.ibatis.builder.BuilderException:Errorresolvingclass.Cause:org.apache.ibatis.type.TypeException:Couldnotresolvetypealias‘Ad′.Cause:java.lang.ClassNotFoundException:Cannotfindclass:Adatorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
W
o
r
k
e
r
.
r
u
n
(
T
h
r
e
a
d
P
o
o
l
E
x
e
c
u
t
o
r
.
j
a
v
a
:
617
)
a
t
j
a
v
a
.
l
a
n
g
.
T
h
r
e
a
d
.
r
u
n
(
T
h
r
e
a
d
.
j
a
v
a
:
748
)
C
a
u
s
e
d
b
y
:
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
B
e
a
n
C
r
e
a
t
i
o
n
E
x
c
e
p
t
i
o
n
:
C
o
u
l
d
n
o
t
a
u
t
o
w
i
r
e
f
i
e
l
d
:
p
r
i
v
a
t
e
o
r
g
.
i
m
o
o
c
.
d
a
o
.
A
d
D
a
o
o
r
g
.
i
m
o
o
c
.
s
e
r
v
i
c
e
.
s
e
r
v
i
c
e
I
m
p
l
.
A
d
S
e
r
v
i
c
e
I
m
p
l
.
a
d
D
a
o
;
n
e
s
t
e
d
e
x
c
e
p
t
i
o
n
i
s
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
B
e
a
n
C
r
e
a
t
i
o
n
E
x
c
e
p
t
i
o
n
:
E
r
r
o
r
c
r
e
a
t
i
n
g
b
e
a
n
w
i
t
h
n
a
m
e
‘
a
d
D
a
o
′
d
e
f
i
n
e
d
i
n
f
i
l
e
[
D
:
\GitCode
\comment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E
x
c
e
p
t
i
o
n
:
E
r
r
o
r
p
a
r
s
i
n
g
M
a
p
p
e
r
X
M
L
.
C
a
u
s
e
:
o
r
g
.
a
p
a
c
h
e
.
i
b
a
t
i
s
.
b
u
i
l
d
e
r
.
B
u
i
l
d
e
r
E
x
c
e
p
t
i
o
n
:
E
r
r
o
r
r
e
s
o
l
v
i
n
g
c
l
a
s
s
.
C
a
u
s
e
:
o
r
g
.
a
p
a
c
h
e
.
i
b
a
t
i
s
.
t
y
p
e
.
T
y
p
e
E
x
c
e
p
t
i
o
n
:
C
o
u
l
d
n
o
t
r
e
s
o
l
v
e
t
y
p
e
a
l
i
a
s
‘
A
d
′
.
C
a
u
s
e
:
j
a
v
a
.
l
a
n
g
.
C
l
a
s
s
N
o
t
F
o
u
n
d
E
x
c
e
p
t
i
o
n
:
C
a
n
n
o
t
f
i
n
d
c
l
a
s
s
:
A
d
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
b
e
a
n
s
.
f
a
c
t
o
r
y
.
a
n
n
o
t
a
t
i
o
n
.
A
u
t
o
w
i
r
e
d
A
n
n
o
t
a
t
i
o
n
B
e
a
n
P
o
s
t
P
r
o
c
e
s
s
o
r
AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:571)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at
首先如果这个问题要是报错的话需要先看一下你的service层、DAO层、controller层是不是加了各自的注解,如果加了注解仍然没有解决这个问题的话 ,那么你就需要去检查一下你的mapper文件映射的那个SQL返回结果或者参数类型 是不是你的实体对象的路径
解决方案就是把下图的那个resultType的返回类型Ad 改成 你自己的实体类型的绝对路径 我的是org.imooc.bean.Ad ,希望能够帮到大家,弄了一天了才找到错误
还有可能是你自己的SQL写的有问题,反正不要去看Injection of autowired dependencies failed这个什么自动注入依赖错误,其实出错的原因是因为你的mapping映射的SQL有问题,不要被错误提示误导大家了
更多推荐
所有评论(0)