java – Spring中的UnsatisfiedDependencyException:构造函数的非法参数:参数类型不匹配

前端之家收集整理的这篇文章主要介绍了java – Spring中的UnsatisfiedDependencyException:构造函数的非法参数:参数类型不匹配前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在尝试在DepartmentService中注入DepartmentDAO.这是在我添加@Transactional注释后出现的.所以这是我的DepartmentService:

@Service
@Transactional
public class DepartmentService extends AbstractCRUDService

这是我的部门DAO:

@Repository
@Transactional(propagation = Propagation.MANDATORY)
public class DepartmentDAO extends AbstractCRUDDao

这是一个applicationContext.xml:

factorybean">
    

我的堆栈跟踪:

    мар 29,2013 4:46:35 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production envi
ronments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\
bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/
bin;C:/Program Files/Java/jre7/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\W
INDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Mercurial\;C:\Program Files\Microsoft sql Se
rver\100\Tools\Binn\;C:\Program Files\Microsoft sql Server\100\DTS\Binn\;C:\Program Files\TortoiseSV
N\bin;c:\Program Files\apache-maven-3.0.4-bin\apache-maven-3.0.4\bin;C:\Program Files\eclipse;;.
мар 29,2013 4:46:35 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.e
clipse.jst.jee.server:chardymov-webapp' did not find a matching property.
мар 29,2013 4:46:35 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
мар 29,2013 4:46:35 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1710 ms
мар 29,2013 4:46:35 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
мар 29,2013 4:46:35 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.35
мар 29,2013 4:46:38 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
мар 29,2013 4:46:38 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
29-03-13 16:46:38,669  INFO [ContextLoader:initWebApplicationContext:272] - Root WebApplicationConte
xt: initialization started
29-03-13 16:46:38,741  INFO [XmlWebApplicationContext:prepareRefresh:503] - Refreshing Root WebAppli
cationContext: startup date [Fri Mar 29 16:46:38 EAT 2013]; root of context hierarchy
29-03-13 16:46:38,797  INFO [XmlBeanDefinitionReader:loadBeanDefinitions:315] - Loading XML bean def
initions from URL [file:/C:/Documents%20and%20Settings/mach/workspace/clean2/.Metadata/.plugins/org.
eclipse.wst.server.core/tmp0/wtpwebapps/chardymov-webapp/WEB-INF/classes/applicationContext.xml]    
29-03-13 16:46:39,270  INFO [AutowiredAnnotationBeanPostProcessor:factorybean:createNativeEntityManagerFactory
:283] - Building JPA container EntityManagerFactory for persistence unit 'net.sam.jpa'
29-03-13 16:46:39,599  INFO [Version:sql statement:
alter table EMPLOYEES drop constraint FK4351FF658ECC7308 [42102-170]
Hibernate: alter table EMPLOYEES drop constraint FK4351FF6530EEAB88
29-03-13 16:46:40,578 ERROR [SchemaExport:perform:425] - HHH000389: Unsuccessful: alter table EMPLOY
EES drop constraint FK4351FF6530EEAB88
29-03-13 16:46:40,578 ERROR [SchemaExport:perform:426] - Table "EMPLOYEES" not found; sql statement:
alter table EMPLOYEES drop constraint FK4351FF6530EEAB88 [42102-170]
Hibernate: drop table DEPARTMENTS if exists
Hibernate: drop table EMPLOYEES if exists
Hibernate: drop table ROLES if exists
Hibernate: create table DEPARTMENTS (id bigint generated by default as identity,depName varchar(20)
 not null unique,primary key (id))
Hibernate: create table EMPLOYEES (id bigint generated by default as identity,name varchar(20) not 
null,surname varchar(255),department_fk bigint not null,role_fk bigint not null,primary key (id),unique (name,surname))
Hibernate: create table ROLES (id bigint generated by default as identity,roleName varchar(20) not 
null unique,primary key (id))
Hibernate: alter table EMPLOYEES add constraint FK4351FF658ECC7308 foreign key (department_fk) refer
ences DEPARTMENTS
Hibernate: alter table EMPLOYEES add constraint FK4351FF6530EEAB88 foreign key (role_fk) references 
ROLES
29-03-13 16:46:40,602  INFO [SchemaExport:execute:405] - HHH000230: Schema export complete
29-03-13 16:46:40,674  INFO [DefaultListablebeanfactory:preInstantiateSingletons:577] - Pre-instanti
ating singletons in org.springframework.beans.factory.support.DefaultListablebeanfactory@1d98539: de
fining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.sp
ringframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.an
notation.internalrequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAn
notationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,comp
osite,departmentDAO,employeeDAO,roleDAO,departmentService,employeeService,roleService,entityManagerF
actory,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframewor
k.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.inte
rceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,o
rg.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of
 factory hierarchy
29-03-13 16:46:40,730  INFO [DefaultListablebeanfactory:destroySingletons:434] - Destroying singleto
ns in org.springframework.beans.factory.support.DefaultListablebeanfactory@1d98539: defining beans [
org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.
context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.inter
nalrequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProces
sor,composite,departme
ntDAO,entityManagerFactory,transac
tionManager,org.springframework.transaction.
annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.Transa
ctionInterceptor#0,org.springframe
work.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hiera
rchy
29-03-13 16:46:40,738  INFO [LocalContainerEntityManagerfactorybean:destroy:441] - Closing JPA Entit
yManagerFactory for persistence unit 'net.sam.jpa'
29-03-13 16:46:40,738  INFO [SchemaExport:execute:343] - HHH000227: Running hbm2ddl schema export
Hibernate: alter table EMPLOYEES drop constraint FK4351FF658ECC7308
Hibernate: alter table EMPLOYEES drop constraint FK4351FF6530EEAB88
Hibernate: drop table DEPARTMENTS if exists
Hibernate: drop table EMPLOYEES if exists
Hibernate: drop table ROLES if exists
29-03-13 16:46:40,746  INFO [SchemaExport:execute:405] - HHH000230: Schema export complete
29-03-13 16:46:40,746  INFO [DriverManagerConnectionProviderImpl:stop:156] - HHH000030: Cleaning up 
connection pool [jdbc:h2:tcp://localhost/mem:db1]
29-03-13 16:46:40,746 ERROR [ContextLoader:initWebApplicationContext:307] - Context initialization f
ailed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com
posite' defined in file [C:\Documents and Settings\mach\workspace\clean2\.Metadata\.plugins\org.ecli
pse.wst.server.core\tmp0\wtpwebapps\chardymov-webapp\WEB-INF\classes\net\sam\Composite.cla
ss]: Unsatisfied dependency expressed through constructor argument with index 0 of type [net.sam_sol
utions.services.impl.DepartmentService]: : Error creating bean with name 'departmentService' defined
 in file [C:\Documents and Settings\mach\workspace\clean2\.Metadata\.plugins\org.eclipse.wst.server.
core\tmp0\wtpwebapps\chardymov-webapp\WEB-INF\classes\net\sam\services\impl\DepartmentServ
ice.class]: Instantiation of bean Failed; nested exception is org.springframework.beans.BeanInstanti
ationException: Could not instantiate bean class [net.sam.services.impl.DepartmentService]
: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: argumen
t type mismatch; nested exception is org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'departmentService' defined in file [C:\Documents and Settings\mach\workspac
e\clean2\.Metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\chardymov-webapp\WEB-INF\cla
sses\net\sam\services\impl\DepartmentService.class]: Instantiation of bean Failed; nested 
exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class 
[net.sam.services.impl.DepartmentService]: Illegal arguments for constructor; nested excep
tion is java.lang.IllegalArgumentException: argument type mismatch
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorRes
olver.java:730)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorRes
olver.java:196)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.autowireConstructor
(AbstractAutowireCapablebeanfactory.java:1035)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBeanInstance(
AbstractAutowireCapablebeanfactory.java:939)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(Abstra
ctAutowireCapablebeanfactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(Abstract
AutowireCapablebeanfactory.java:456)
    at org.springframework.beans.factory.support.Abstractbeanfactory$1.getObject(Abstractbeanfactory.ja
va:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingl
etonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java
:291)
    at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:1
93)
    at org.springframework.beans.factory.support.DefaultListablebeanfactory.preInstantiateSingletons(De
faultListablebeanfactory.java:605)
    at org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(A
bstractApplicationContext.java:925)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContex
t.java:472)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLo
ader.java:383)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.j
ava:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'd
epartmentService' defined in file [C:\Documents and Settings\mach\workspace\clean2\.Metadata\.plugin
s\org.eclipse.wst.server.core\tmp0\wtpwebapps\chardymov-webapp\WEB-INF\classes\net\sam\ser
vices\impl\DepartmentService.class]: Instantiation of bean Failed; nested exception is org.springfra
mework.beans.BeanInstantiationException: Could not instantiate bean class [net.sam.service
s.impl.DepartmentService]: Illegal arguments for constructor; nested exception is java.lang.IllegalA
rgumentException: argument type mismatch
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorRes
olver.java:288)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.autowireConstructor
(AbstractAutowireCapablebeanfactory.java:1035)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBeanInstance(
AbstractAutowireCapablebeanfactory.java:939)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(Abstra
ctAutowireCapablebeanfactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(Abstract
AutowireCapablebeanfactory.java:456)
    at org.springframework.beans.factory.support.Abstractbeanfactory$1.getObject(Abstractbeanfactory.ja
va:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingl
etonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java
:291)
    at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:1
93)
    at org.springframework.beans.factory.support.DefaultListablebeanfactory.findAutowireCandidates(Defa
ultListablebeanfactory.java:872)
    at org.springframework.beans.factory.support.DefaultListablebeanfactory.doResolveDependency(Default
Listablebeanfactory.java:814)
    at org.springframework.beans.factory.support.DefaultListablebeanfactory.resolveDependency(DefaultLi
stablebeanfactory.java:731)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(Construct
orResolver.java:795)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorRes
olver.java:723)
    ... 25 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [n
et.sam.services.impl.DepartmentService]: Illegal arguments for constructor; nested excepti
on is java.lang.IllegalArgumentException: argument type mismatch
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:158)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstanti
ationStrategy.java:121)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorRes
olver.java:280)
    ... 38 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
    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:147)
    ... 40 more
мар 29,2013 4:46:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframewor
k.web.context.ContextLoaderListener
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com
posite' defined in file [C:\Documents and Settings\mach\workspace\clean2\.Metadata\.plugins\org.ecli
pse.wst.server.core\tmp0\wtpwebapps\chardymov-webapp\WEB-INF\classes\net\sam\Composite.cla
ss]: Unsatisfied dependency expressed through constructor argument with index 0 of type [net.sam_sol
utions.services.impl.DepartmentService]: : Error creating bean with name 'departmentService' defined
 in file [C:\Documents and Settings\mach\workspace\clean2\.Metadata\.plugins\org.eclipse.wst.server.
core\tmp0\wtpwebapps\chardymov-webapp\WEB-INF\classes\net\sam\services\impl\DepartmentServ
ice.class]: Instantiation of bean Failed; nested exception is org.springframework.beans.BeanInstanti
ationException: Could not instantiate bean class [net.sam.services.impl.DepartmentService]
: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: argumen
t type mismatch; nested exception is org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'departmentService' defined in file [C:\Documents and Settings\mach\workspac
e\clean2\.Metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\chardymov-webapp\WEB-INF\cla
sses\net\sam\services\impl\DepartmentService.class]: Instantiation of bean Failed; nested 
exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class 
[net.sam.services.impl.DepartmentService]: Illegal arguments for constructor; nested excep
tion is java.lang.IllegalArgumentException: argument type mismatch
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorRes
olver.java:730)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorRes
olver.java:196)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.autowireConstructor
(AbstractAutowireCapablebeanfactory.java:1035)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBeanInstance(
AbstractAutowireCapablebeanfactory.java:939)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(Abstra
ctAutowireCapablebeanfactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(Abstract
AutowireCapablebeanfactory.java:456)
    at org.springframework.beans.factory.support.Abstractbeanfactory$1.getObject(Abstractbeanfactory.ja
va:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingl
etonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java
:291)
    at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:1
93)
    at org.springframework.beans.factory.support.DefaultListablebeanfactory.preInstantiateSingletons(De
faultListablebeanfactory.java:605)
    at org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(A
bstractApplicationContext.java:925)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContex
t.java:472)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLo
ader.java:383)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.j
ava:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'd
epartmentService' defined in file [C:\Documents and Settings\mach\workspace\clean2\.Metadata\.plugin
s\org.eclipse.wst.server.core\tmp0\wtpwebapps\chardymov-webapp\WEB-INF\classes\net\sam\ser
vices\impl\DepartmentService.class]: Instantiation of bean Failed; nested exception is org.springfra
mework.beans.BeanInstantiationException: Could not instantiate bean class [net.sam.service
s.impl.DepartmentService]: Illegal arguments for constructor; nested exception is java.lang.IllegalA
rgumentException: argument type mismatch
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorRes
olver.java:288)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.autowireConstructor
(AbstractAutowireCapablebeanfactory.java:1035)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBeanInstance(
AbstractAutowireCapablebeanfactory.java:939)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(Abstra
ctAutowireCapablebeanfactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(Abstract
AutowireCapablebeanfactory.java:456)
    at org.springframework.beans.factory.support.Abstractbeanfactory$1.getObject(Abstractbeanfactory.ja
va:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingl
etonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java
:291)
    at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:1
93)
    at org.springframework.beans.factory.support.DefaultListablebeanfactory.findAutowireCandidates(Defa
ultListablebeanfactory.java:872)
    at org.springframework.beans.factory.support.DefaultListablebeanfactory.doResolveDependency(Default
Listablebeanfactory.java:814)
    at org.springframework.beans.factory.support.DefaultListablebeanfactory.resolveDependency(DefaultLi
stablebeanfactory.java:731)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(Construct
orResolver.java:795)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorRes
olver.java:723)
    ... 25 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [n
et.sam.services.impl.DepartmentService]: Illegal arguments for constructor; nested excepti
on is java.lang.IllegalArgumentException: argument type mismatch
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:158)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstanti
ationStrategy.java:121)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorRes
olver.java:280)
    ... 38 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
    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:147)
    ... 40 more

мар 29,2013 4:46:40 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
мар 29,2013 4:46:40 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/chardymov-webapp] startup Failed due to prevIoUs errors
мар 29,2013 4:46:40 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
мар 29,2013 4:46:40 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/chardymov-webapp] registered the JDBC driver [org.h2.Driver] but faile
d to unregister it when the web application was stopped. To prevent a memory leak,the JDBC Driver h
as been forcibly unregistered.
мар 29,2013 4:46:40 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
мар 29,2013 4:46:40 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 9757 ms
最佳答案
@Transactional作为代理实现,恕我直言Spring不解析代理类型为DepartmentDAO.在这种情况下,您有2个@R_301_463@案:

>让你的DA实现一个接口并通过最后注入它
>在Spring配置中启用CGLib代理

原文链接:https://www.f2er.com/spring/431485.html

猜你在找的Spring相关文章