Uploaded image for project: 'Archiva'
  1. Archiva
  2. MRM-1881

Release 2.2.0 does not work with PostgreSQL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Workaround
    • Affects Version/s: 2.2.0
    • Fix Version/s: None
    • Component/s: Documentation, system
    • Labels:
    • Environment:
      oracle-java-1.8, ubuntu-12.04-lts
    • Flags:
      Important

      Description

      It seems that support for PostgreSQL is broken and mostly undocumented.

      There a few things that need to be addressed:

      • Include PostgreSQL ODBC driver in the build, no need to keep it outside only to make the installation harder.
      • Include commented out PostreSQL database configuration inside /conf/jetty.conf including
      <New id="users" class="org.eclipse.jetty.plus.jndi.Resource">
          <Arg>jdbc/users</Arg>
          <Arg>
            <New class="org.apache.tomcat.jdbc.pool.DataSource">
              <Set name="driverClassName">org.postgresql.Driver</Set>
              <Set name="url">jdbc:postgresql://localhost/archiva</Set>
              <Set name="name">ArchivaApp</Set>
              <Set name="username">archiva</Set>
              <Set name="password">archivasecret</Set>
              <Set name="maxWait">10000</Set>
              <Set name="removeAbandonedTimeout">10000</Set>
              <Set name="initialSize">15</Set>
              <Set name="maxActive">30</Set>        
              <Set name="removeAbandoned">true</Set>
              <Set name="logAbandoned">true</Set>
              <Set name="testOnBorrow">true</Set>
              <Set name="validationQuery">select 1</Set>
              <Set name="testOnReturn">false</Set>
              <Set name="defaultTransactionIsolation">8</Set>
            </New>
          </Arg>
        </New>
      

      Also even with these changes being made it seems that Archiva is not properly initialized. The database tables are created with the default admin account but we cannot validate the admin account (email confirmation fails). We will attach the logs.

      Here are few excerpts from the logs:

      INFO   | jvm 1    | 2015/04/07 17:34:15 | 2015-04-07 17:34:15.209:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/opt/archiva/apps/archiva/},/opt/archiva/apps/archiva
      INFO   | jvm 1    | 2015/04/07 17:34:15 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'archivaServices': Cannot resolve reference to bean 'authenticationInterceptor
      INFO   | jvm 1    | 2015/04/07 17:34:15 |   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
      INFO   | jvm 1    | 2015/04/07 17:34:15 |   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
      INFO   | jvm 1    | 2015/04/07 17:34:15 |   at java.lang.Thread.run(Thread.java:745)
      INFO   | jvm 1    | 2015/04/07 17:34:15 | Caused by:
      INFO   | jvm 1    | 2015/04/07 17:34:15 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationInterceptor#rest': Injection of autowired dependencies failed;
      INFO   | jvm 1    | 2015/04/07 17:34:15 |   at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
      
      2015-04-07 17:34:13,313 [WrapperSimpleAppMain] INFO  org.apache.archiva.web.security.ArchivaRbacManager [] - use rbacManagerIds: '[jdo]'
      2015-04-07 17:34:13,452 [WrapperSimpleAppMain] WARN  JPOX.Plugin [] - Extension Point "org.eclipse.jdt.apt.core.annotationProcessorFactory" not registered, but plugin "" defined in jar:file:/opt/archiva/apps
      /archiva/WEB-INF/lib/org.eclipse.sisu.inject-0.0.0.M2a.jar!/plugin.xml refers to it.
      2015-04-07 17:34:13,471 [WrapperSimpleAppMain] WARN  JPOX.Plugin [] - Extension Point "org.eclipse.jdt.apt.core.annotationProcessorFactory" not registered, but plugin "" defined in jar:file:/opt/archiva/apps
      /archiva/WEB-INF/lib/org.eclipse.sisu.inject-0.0.0.M2a.jar!/plugin.xml refers to it.
      2015-04-07 17:34:13,660 [WrapperSimpleAppMain] INFO  org.apache.archiva.redback.role.DefaultRoleManager [] - loading System
      2015-04-07 17:34:14,867 [WrapperSimpleAppMain] INFO  org.apache.archiva.redback.role.processor.DefaultRoleModelProcessor [] - time to process roles model: 191 ms
      2015-04-07 17:34:14,873 [WrapperSimpleAppMain] INFO  org.apache.archiva.redback.role.DefaultRoleManager [] - loading Archiva
      2015-04-07 17:34:15,129 [WrapperSimpleAppMain] INFO  org.apache.archiva.redback.role.processor.DefaultRoleModelProcessor [] - time to process roles model: 156 ms
      2015-04-07 17:34:15,130 [WrapperSimpleAppMain] INFO  org.apache.archiva.redback.role.DefaultRoleManager [] - DefaultRoleManager initialize time 1527
      2015-04-07 17:34:15,165 [WrapperSimpleAppMain] WARN  org.springframework.web.context.support.XmlWebApplicationContext [] - Exception encountered during context initialization - cancelling refresh attempt
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'archivaServices': Cannot resolve reference to bean 'authenticationInterceptor#rest' while setting bean property 'provid
      ers' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationInterceptor#rest': Injection of autowired dependencies failed; nes
      ted 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': Injection of autowired dependencies fa
      iled; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin org.apache.archiva
      .web.security.ArchivaConfigurableUsersManager.redbackRuntimeConfigurationAdmin; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redbackRuntimeConfi
      gurationAdmin#default': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List org.apache.ar
      chiva.admin.repository.AbstractRepositoryAdmin.auditListeners; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditListener#metadata': Injection o
      f autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.metadata.repository.RepositorySessionFactory
       org.apache.archiva.audit.MetadataAuditListener.repositorySessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositorySessionFactory#
      jcr': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.metadata.repository.Metadat
      aResolver org.apache.archiva.metadata.repository.jcr.JcrRepositorySessionFactory.metadataResolver; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '
      metadataResolver#default': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.metada
      ta.repository.storage.RepositoryStorage org.apache.archiva.metadata.repository.DefaultMetadataResolver.repositoryStorage; nested exception is org.springframework.beans.factory.BeanCreationException: Error cr
      eating bean with name 'repositoryStorage#maven2': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private or
      g.apache.archiva.admin.model.managed.ManagedRepositoryAdmin org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage.managedRepositoryAdmin; nested exception is org.springframework.beans
      .factory.BeanCreationException: Error creating bean with name 'managedRepositoryAdmin#default': Invocation of init method failed; nested exception is org.apache.archiva.admin.model.RepositoryAdminException:
      Cannot forcefully unlock a NativeFSLock which is held by another indexer component: /opt/archiva/repositories/repositories/snapshots/repositories/snapshots/.indexer/write.lock
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359) ~[spring-beans-4.1.4.RELEASE.jar:4.1.4.RELEASE]
      

        Attachments

        1. archiva-2.2.0-postgresql-logs.tar.gz
          10 kB
          Sorin Sbarnea
        2. logs.tar.gz
          18 kB
          Sorin Sbarnea

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sbarnea Sorin Sbarnea
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: