如何修复在Maven项目中创建带有名称错误的bean的错误

时间:2019-05-04 19:02:44

标签: java eclipse maven alfresco

我使用eclipse IDE创建了一个新的maven项目。创建项目后,我什么也没做,只是尝试使用本教程中所述的run.bat命令运行项目。 (https://ecmarchitect.com/alfresco-developer-series-tutorials/maven-sdk/tutorial/tutorial.html)但是现在我收到类似“在类路径资源[alfresco / action-services-context.xml]中定义名称为'actionService'的bean创建错误”之类的错误。我不解决这个问题。请帮我。

我的错误日志如下。

2019-05-05 00:08:54,285  WARN  [context.support.XmlWebApplicationContext] [localhost-startStop-1] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityBridgeTableCache' defined in class path resource [alfresco/cache-context.xml]: Cannot resolve reference to bean 'tenantAdminService' while setting bean property 'tenantAdminService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantAdminService' defined in URL [jar:file:/D:/$PUCSL_SNAIL/workflow-tutorial-test/target/tomcat/webapps/workflow-tutorial-test-platform/WEB-INF/lib/alfresco-repository-5.2.f.jar!/alfresco/mt/mt-admin-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'permissionServiceImpl' while setting bean property 'permissionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionServiceImpl' defined in class path resource [alfresco/public-services-security-context.xml]: Cannot resolve reference to bean 'authorityService' while setting bean property 'authorityService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityService' defined in class path resource [alfresco/authority-services-context.xml]: Cannot resolve reference to bean 'personService' while setting bean property 'personService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'personServicePermissionsManager' while setting bean property 'permissionsManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personServicePermissionsManager' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'ownableService' while setting bean property 'ownableService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ownableService' defined in class path resource [alfresco/ownable-services-context.xml]: Cannot resolve reference to bean 'renditionService' while setting bean property 'renditionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'renditionService' defined in class path resource [alfresco/rendition-services-context.xml]: Cannot resolve reference to bean 'ActionService' while setting bean property 'actionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ActionService' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'actionService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionService' defined in class path resource [alfresco/action-services-context.xml]: Cannot resolve reference to bean 'NodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'NodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditMethodInterceptor' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'auditComponent' while setting bean property 'auditComponent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditComponent' defined in class path resource [alfresco/audit-services-context.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
 2019-05-05 00:08:54,323  ERROR [web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityBridgeTableCache' defined in class path resource [alfresco/cache-context.xml]: Cannot resolve reference to bean 'tenantAdminService' while setting bean property 'tenantAdminService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantAdminService' defined in URL [jar:file:/D:/$PUCSL_SNAIL/workflow-tutorial-test/target/tomcat/webapps/workflow-tutorial-test-platform/WEB-INF/lib/alfresco-repository-5.2.f.jar!/alfresco/mt/mt-admin-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'permissionServiceImpl' while setting bean property 'permissionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionServiceImpl' defined in class path resource [alfresco/public-services-security-context.xml]: Cannot resolve reference to bean 'authorityService' while setting bean property 'authorityService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityService' defined in class path resource [alfresco/authority-services-context.xml]: Cannot resolve reference to bean 'personService' while setting bean property 'personService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'personServicePermissionsManager' while setting bean property 'permissionsManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personServicePermissionsManager' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'ownableService' while setting bean property 'ownableService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ownableService' defined in class path resource [alfresco/ownable-services-context.xml]: Cannot resolve reference to bean 'renditionService' while setting bean property 'renditionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'renditionService' defined in class path resource [alfresco/rendition-services-context.xml]: Cannot resolve reference to bean 'ActionService' while setting bean property 'actionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ActionService' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'actionService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionService' defined in class path resource [alfresco/action-services-context.xml]: Cannot resolve reference to bean 'NodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'NodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditMethodInterceptor' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'auditComponent' while setting bean property 'auditComponent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditComponent' defined in class path resource [alfresco/audit-services-context.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1419)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:938)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
        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.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantAdminService' defined in URL [jar:file:/D:/$PUCSL_SNAIL/workflow-tutorial-test/target/tomcat/webapps/workflow-tutorial-test-platform/WEB-INF/lib/alfresco-repository-5.2.f.jar!/alfresco/mt/mt-admin-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'permissionServiceImpl' while setting bean property 'permissionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionServiceImpl' defined in class path resource [alfresco/public-services-security-context.xml]: Cannot resolve reference to bean 'authorityService' while setting bean property 'authorityService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityService' defined in class path resource [alfresco/authority-services-context.xml]: Cannot resolve reference to bean 'personService' while setting bean property 'personService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'personServicePermissionsManager' while setting bean property 'permissionsManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personServicePermissionsManager' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'ownableService' while setting bean property 'ownableService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ownableService' defined in class path resource [alfresco/ownable-services-context.xml]: Cannot resolve reference to bean 'renditionService' while setting bean property 'renditionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'renditionService' defined in class path resource [alfresco/rendition-services-context.xml]: Cannot resolve reference to bean 'ActionService' while setting bean property 'actionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ActionService' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'actionService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionService' defined in class path resource [alfresco/action-services-context.xml]: Cannot resolve reference to bean 'NodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'NodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditMethodInterceptor' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'auditComponent' while setting bean property 'auditComponent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditComponent' defined in class path resource [alfresco/audit-services-context.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1419)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        ... 25 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'permissionServiceImpl' while setting bean property 'permissionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionServiceImpl' defined in class path resource [alfresco/public-services-security-context.xml]: Cannot resolve reference to bean 'authorityService' while setting bean property 'authorityService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityService' defined in class path resource [alfresco/authority-services-context.xml]: Cannot resolve reference to bean 'personService' while setting bean property 'personService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'personServicePermissionsManager' while setting bean property 'permissionsManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personServicePermissionsManager' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'ownableService' while setting bean property 'ownableService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ownableService' defined in class path resource [alfresco/ownable-services-context.xml]: Cannot resolve reference to bean 'renditionService' while setting bean property 'renditionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'renditionService' defined in class path resource [alfresco/rendition-services-context.xml]: Cannot resolve reference to bean 'ActionService' while setting bean property 'actionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ActionService' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'actionService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionService' defined in class path resource [alfresco/action-services-context.xml]: Cannot resolve reference to bean 'NodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'NodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditMethodInterceptor' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'auditComponent' while setting bean property 'auditComponent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditComponent' defined in class path resource [alfresco/audit-services-context.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1419)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        ... 35 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionServiceImpl' defined in class path resource [alfresco/public-services-security-context.xml]: Cannot resolve reference to bean 'authorityService' while setting bean property 'authorityService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorityService' defined in class path resource [alfresco/authority-services-context.xml]: Cannot resolve reference to bean 'personService' while setting bean property 'personService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'personServicePermissionsManager' while setting bean property 'permissionsManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personServicePermissionsManager' defined in class path resource [alfresco/authentication-services-context.xml]: Cannot resolve reference to bean 'ownableService' while setting bean property 'ownableService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ownableService' defined in class path resource [alfresco/ownable-services-context.xml]: Cannot resolve reference to bean 'renditionService' while setting bean property 'renditionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'renditionService' defined in class path resource [alfresco/rendition-services-context.xml]: Cannot resolve reference to bean 'ActionService' while setting bean property 'actionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ActionService' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'actionService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionService' defined in class path resource [alfresco/action-services-context.xml]: Cannot resolve reference to bean 'NodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'NodeService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditMethodInterceptor' defined in class path resource [alfresco/public-services-context.xml]: Cannot resolve reference to bean 'auditComponent' while setting bean property 'auditComponent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditComponent' defined in class path resource [alfresco/audit-services-context.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1419)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        ... 45 more

1 个答案:

答案 0 :(得分:0)

在pom.xml文件中添加jaxb-api依赖项

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
</dependency>

如果即使添加以上依赖项后仍然仍然遇到相同的错误,请尝试以下StackOverflowQuestion答案