java - Apache Archiva 2.0 Jetty WebAppContext :Failed startup of context o. e.j.w.WebAppContext

标签 java spring jetty embedded-jetty archiva

我正在尝试建立 Apache Archiva 2.0 的一个实例。我可以通过命令行在我的家庭机器(Ubuntu 13)上成功运行独立程序:archiva2.0/bin/archiva console...但是,在我工作的 Redhat 6 机器上,Archiva 无法启动 Spring webapp 上下文。我只知道 very basics about Spring 。以下是我认为相关的日志/文件。如果我遗漏了什么,请在评论中告诉我,我很乐意更新。

Archiva 控制台输出:

2014-02-28 06:18:09,935 [WrapperSimpleAppMain] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler [] - Shutting down ExecutorService 'springScheduler'
2014-02-28 06:18:09,935 [WrapperSimpleAppMain] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor [] - Shutting down ExecutorService
2014-02-28 06:18:09,935 [WrapperSimpleAppMain] ERROR org.springframework.web.context.ContextLoader [] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'archivaUiServices': Cannot resolve reference to bean 'authenticationInterceptor#rest' while setting bean property 'providers' with key 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationInterceptor#rest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.redback.users.UserManager org.apache.archiva.redback.rest.services.interceptors.AuthenticationInterceptor.userManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManager#archiva': ....etc...

Tanuki 服务包装器日志:

INFO | jvm 1 | 2014/02/28 06:18:02 | 2014-02-28 06:18:02.785:INFO:/:Initializing Spring root WebApplicationContext
INFO | jvm 1 | 2014/02/28 06:18:09 | 2014-02-28 06:18:09.944:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/devSpace/lib/apache-archiva-2.0.0/apps/archiva/},/devSpace/lib/apache-archiva-2.0.0/apps/archiva
INFO | jvm 1 | 2014/02/28 06:18:09 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'archivaUiServices': Cannot resolve reference to bean 'authenticationInterceptor#rest' while setting bean property 'providers' with key 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationInterceptor#rest': Injection of autowired dependencies failed;

archiva2.0/contexts/archiva.xml:

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
   <Set name="contextPath">/</Set>
   <Set name="war"><SystemProperty name="jetty.home" default="."/>/apps/archiva</Set>
   <Set name="extractWAR">false</Set>
   <Set name="copyWebDir">false</Set>
</Configure>

archiva2.0/apps/archiva/WEB-INF/classes/META-INF/spring-context.xml

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:util="http://www.springframework.org/schema/util"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context-3.0.xsd
       http://www.springframework.org/schema/util
       http://www.springframework.org/schema/util/spring-util-3.0.xsd"
   default-lazy-init="true">
<context:annotation-config/>
<context:component-scan base-package="org.apache.archiva.web.api"/>
<util:properties id="archivaRuntimeProperties" location="classpath:application.properties" />
<bean id="jcr-repository" class="org.apache.jackrabbit.core.RepositoryImpl" destroy-method="shutdown" lazy-init="true">
    <constructor-arg ref="jcr-config"/>
</bean>
<bean id="jcr-config" class="org.apache.archiva.metadata.repository.jcr.ArchivaJcrRepositoryConfig" factory-method="create">
    <constructor-arg value="${appserver.base}/conf/repository.xml"/>
    <constructor-arg value="${appserver.base}/data/jcr"/>
</bean>
</beans>

最佳答案

这是某些环境下的已知问题:MRM-1807

您可以通过在安装目录或基本目录下添加正确的文件 conf/archiva.xml 来解决此问题,例如:http://s.apache.org/default-archiva.xml

关于java - Apache Archiva 2.0 Jetty WebAppContext :Failed startup of context o. e.j.w.WebAppContext,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22095723/

相关文章:

java - 为什么我收到一条错误消息,提示找不到可变长度?

java - 将 CrudRepository 中发出的命令转换为函数时出现问题

java - 创建 bean sessionFactory 时出现不兼容的类更改错误

spring - 使用 Jetty 以编程方式部署 servlet

java - 检测屏幕上的鼠标移动

java - 如何在 Primefaces tabView 中设置 Activity 选项卡?

java - MBeanExporter 和 bean 的条件加载

java - 异常: java. lang.ClassNotFoundException : org. apache.commons.dbcp.BasicDataSource

java - Jetty 用户自定义配置

java - 使用 Jetty AsyncProxyServlet 流式传输 HTTP 响应