我正在尝试建立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]信息org.springframework.scheduling.concurrent.ThreadPoolTask​​Scheduler []-关闭ExecutorService'springScheduler'
  2014-02-28 06:18:09,935 [WrapperSimpleAppMain]信息org.springframework.scheduling.concurrent.ThreadPoolTask​​Executor []-关闭ExecutorService
  2014-02-28 06:18:09,935 [WrapperSimpleAppMain]错误org.springframework.web.context.ContextLoader []-上下文初始化失败
  org.springframework.beans.factory.BeanCreationException:创建名称为'archivaUiServices'的bean时出错:用键1设置bean属性'providers'时,无法解析对bean'authenticationInterceptor#rest'的引用;嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为'authenticationInterceptor#rest'的bean时出错:自动连接依赖项的注入失败;嵌套的异常是org.springframework.beans.factory.BeanCreationException:无法自动连线字段:私有org.apache.archiva.redback.users.UserManager org.apache.archiva.redback.rest.services.interceptors.AuthenticationInterceptor.userManager;嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为'userManager#archiva'的bean时出错:.... etc ...


Tanuki服务包装程序日志:


  信息| jvm 1 | 2014/02/28 06:18:02 | 2014-02-28 06:18:02.785:INFO:/:初始化Spring根WebApplicationContext
  信息| jvm 1 | 2014/02/28 06:18:09 | 2014-02-28 06:18:09.944:WARN:oejw.WebAppContext:上下文oejwWebAppContext {/,file:/devSpace/lib/apache-archiva-2.0.0/apps/archiva /},/ devSpace /的启动失败lib / apache-archiva-2.0.0 / apps / archiva
  信息| jvm 1 | 2014/02/28 06:18:09 | org.springframework.beans.factory.BeanCreationException:创建名称为'archivaUiServices'的bean时出错:用键1设置bean属性'providers'时,无法解析对bean'authenticationInterceptor#rest'的引用;嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为'authenticationInterceptor#rest'的bean时出错:自动连接依赖项的注入失败;


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

09-27 06:25