1

Ok, I'm struggling to get Archiva 1.4 in standalone mode to use an existing Postgres db. Can anyone help me configure it?

end-user
  • 2,845
  • 6
  • 30
  • 56

2 Answers2

1

Working with Olivier, this was my final, working db config:

  <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://<server>/Archiva</Set>
        <Set name="name">ArchivaApp</Set>
        <Set name="username">...</Set>
        <Set name="password">...</Set>
        <!-- depends on your concurrent users numbers -->
        <Set name="maxWait">10000</Set>
        <Set name="removeAbandonedTimeout">10000</Set>
        <Set name="maxActive">30</Set>
        <Set name="initialSize">15</Set>
        <Set name="removeAbandoned">true</Set>
        <Set name="logAbandoned">true</Set>
        <Set name="testOnBorrow">true</Set>
        <!-- very rigourous sql query validation -->
        <Set name="validationQuery">select 1</Set>
      </New>
    </Arg>
  </New>

It was important to set the testOnBorrow parameter; some of the others don't matter.

end-user
  • 2,845
  • 6
  • 30
  • 56
0

Depends if you are using standalone or in a servlet container

1)Standalone have a look here http://archiva.apache.org/docs/1.4-M4-SNAPSHOT/adminguide/standalone.html replace com.mysql.jdbc.Driver with your jdbc driver and replace url jdbc:mysql://localhost/archiva

put your jdbc driver jar to lib directory 2) servlet container (it depends :-) ) for Apache Tomcat see http://archiva.apache.org/docs/1.4-M4-SNAPSHOT/adminguide/webapp.html put your jdbc driver jar to lib directory change values

driverClassName="org.apache.derby.jdbc.EmbeddedDriver" url="jdbc:derby:/path/to/database/users;create=true"

I have updated documentation here database section

Olivier Lamy
  • 2,280
  • 1
  • 14
  • 12