You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@archiva.apache.org by Hilco Wijbenga <hi...@gmail.com> on 2006/12/15 20:59:50 UTC

Running Archiva WAR on JBoss 4.0.5

Hi all,

I checked out Archiva from Subversion and ran 'mvn clean install'.
This yielded a WAR in archiva-webapp/target. I copied this WAR into
the JBoss deploy directory and requested http://localhost/archiva.

The WAR seems to at least partially deploy but I do get a few
stacktraces. I noticed that it's looking for .m2/security.properties
and .m2/archiva.properties. I don't have these. What should I put in
these properties files?

I can deploy proximity's WAR so I think my JBoss install is ok.

Should I be able to deploy the Archiva WAR like this? Do I need to
do something in the WAR before I deploy it? Set some property during
the build?

The problem appears to be related to the database (i.e. I think it's a
JDBC connection problem).

I also tried to run 'mvn site' in the hopes of finding some info there
but the build fails. :-(

Cheers,
Hilco

P.S. Parts of the stacktraces:
Caught Exception while registering Interceptor class
pssForceAdminUserInterceptor - [unknown location]
        at org.codehaus.plexus.xwork.PlexusObjectFactory.buildInterceptor(PlexusObjectFactory.java:134)
<snip/>
Caused by: org.jpox.exceptions.ConnectionFactoryNotFoundException:
Connection Factory "java:comp/env/jdbc/users" not found
NestedThrowables:
javax.naming.NameNotFoundException: jdbc not bound
        at org.jpox.AbstractPersistenceManagerFactory.lookupDataSource(AbstractPersistenceManagerFactory.java:175)
Caused by: javax.naming.NameNotFoundException: jdbc not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)

Re: Running Archiva WAR on JBoss 4.0.5

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/15/06, Hilco Wijbenga <hi...@gmail.com> wrote:

> Woohoo! I got it to work. Just in case somebody wants to know how...

Thanks!  I saved it here on the wiki:
   http://docs.codehaus.org/display/MAVENUSER/Archiva+on+JBoss

-- 
Wendy

Re: Running Archiva WAR on JBoss 4.0.5

Posted by Hilco Wijbenga <hi...@gmail.com>.
Woohoo! I got it to work. Just in case somebody wants to know how...

(I'm running the 'default' JBoss configuration.)

1. copy archiva-webapp/src/main/webapp/WEB-INF/lib/derby-10.1.3.1.jar
into $JBOSS_HOME/server/default/lib;

2. create $JBOSS_HOME/server/default/deploy/derby-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
   <local-tx-datasource>
      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
      <!-- Datasources are not available outside the virtual machine -->
      <jndi-name>users</jndi-name>
      <!-- for in-process persistent db, saved when jboss stops. The
      org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db
shutdown -->
      <connection-url>jdbc:derby:database/archiva;create=true</connection-url>
      <!-- The driver class -->
      <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
      <!-- The login and password -->
      <user-name>sa</user-name>
      <password></password>
      <!-- The minimum connections in a pool/sub-pool. Pools are
lazily constructed on first use -->
      <min-pool-size>5</min-pool-size>
      <!-- The maximum connections in a pool/sub-pool -->
      <max-pool-size>20</max-pool-size>
      <!-- The time before an unused connection is destroyed -->
      <idle-timeout-minutes>5</idle-timeout-minutes>
      <!-- Whether to check all statements are closed when the
connection is returned to the pool,
           this is a debugging feature that should be turned off in
production -->
      <track-statements/>
   </local-tx-datasource>
</datasources>

3. edit archiva-webapp/src/main/webapp/WEB-INF/web.xml and add
<resource-ref>
  <res-ref-name>jdbc/users</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>
(somewhere between <web-app> and </web-app>);

4. create archiva-webapp/src/main/webapp/WEB-INF/jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
  <resource-ref>
    <res-ref-name>jdbc/users</res-ref-name>
    <jndi-name>java:/users</jndi-name>
  </resource-ref>
</jboss-web>

5. rerun 'mvn install' (to update the WAR with the updated web.xml and
jboss-web.xml);

6. deploy the new WAR and Archiva should work.

DISCLAIMER: I'm not, by any stretch of the word, an expert on JBoss so
this is probably not the *best* way to do it ... but it works. :-)