程序在Tomcat下是可以正常运行的。
但是部署到Myeclipse中出现问题。
现在的部署方法是 创建一个项目,把相应的文件导入进去。
报错信息如下:
2 个解决方案
#1
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in URL [file:/D:/Tomcat6/webapps/shop/WEB-INF/classes/applicationContext-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in URL [file:/D:/Tomcat6/webapps/shop/WEB-INF/classes/applicationContext-shiro.xml]: Cannot resolve reference to bean 'authenticationRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationRealm': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminDaoImpl': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [file:/D:/Tomcat6/webapps/shop/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [file:/D:/Tomcat6/webapps/shop/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxPoolSize'; nested exception is java.lang.NumberFormatException: For input string: "${connection_pools.max_pool_size}"
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
at
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
at
#2
spring版本和quartz的版本兼容性出了问题,例如:spring使用3.0以上版本的,而quartz使用2.0以上版本的就会出现问题.
spring-context-support-3.1.2.RELEASE.jar包中的org.springframework.scheduling.quartz.CronTriggerBean类继承org.quartz.CronTrigger类,而在quartz2.1.7版本中CronTrigger是一个接口。
你可以瞧一瞧,我这两天也犯了这个错误,哎!还得把quartz换成2.0一下的版本,好麻烦。。。
spring-context-support-3.1.2.RELEASE.jar包中的org.springframework.scheduling.quartz.CronTriggerBean类继承org.quartz.CronTrigger类,而在quartz2.1.7版本中CronTrigger是一个接口。
你可以瞧一瞧,我这两天也犯了这个错误,哎!还得把quartz换成2.0一下的版本,好麻烦。。。
#1
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in URL [file:/D:/Tomcat6/webapps/shop/WEB-INF/classes/applicationContext-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in URL [file:/D:/Tomcat6/webapps/shop/WEB-INF/classes/applicationContext-shiro.xml]: Cannot resolve reference to bean 'authenticationRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationRealm': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminDaoImpl': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [file:/D:/Tomcat6/webapps/shop/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [file:/D:/Tomcat6/webapps/shop/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxPoolSize'; nested exception is java.lang.NumberFormatException: For input string: "${connection_pools.max_pool_size}"
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
at
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
at
#2
spring版本和quartz的版本兼容性出了问题,例如:spring使用3.0以上版本的,而quartz使用2.0以上版本的就会出现问题.
spring-context-support-3.1.2.RELEASE.jar包中的org.springframework.scheduling.quartz.CronTriggerBean类继承org.quartz.CronTrigger类,而在quartz2.1.7版本中CronTrigger是一个接口。
你可以瞧一瞧,我这两天也犯了这个错误,哎!还得把quartz换成2.0一下的版本,好麻烦。。。
spring-context-support-3.1.2.RELEASE.jar包中的org.springframework.scheduling.quartz.CronTriggerBean类继承org.quartz.CronTrigger类,而在quartz2.1.7版本中CronTrigger是一个接口。
你可以瞧一瞧,我这两天也犯了这个错误,哎!还得把quartz换成2.0一下的版本,好麻烦。。。