Reputation: 1690
I'm trying to stand up an instance of Apache Archiva 2.0. I can successfully run the standalone on my box at home (Ubuntu 13) from the command line: archiva2.0/bin/archiva console... However, on my Redhat 6 box at work, Archiva fails to startup the Spring webapp context. I only know the very basics about Spring. Below are the logs/files that I think are relevant. If I am missing anything, let me know in a comment and I'll gladly update.
Archiva console output:
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 Service Wrapper log:
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>
Upvotes: 2
Views: 3374
Reputation: 5867
This is a known issue under some environments: MRM-1807
You can correct the issue by adding a correct file as conf/archiva.xml
under the installation or base directory, for example: http://s.apache.org/default-archiva.xml
Upvotes: 2