Archiva

Documentation for configuring for Tomcat is invalid

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-2
  • Fix Version/s: 1.0
  • Component/s: Documentation
  • Labels:
    None
  • Environment:
    Windows XP, Tomcat-5.5.17/Tomcat-5.5.20, JDK-1.5.0_06
  • Number of attachments :
    2

Description

Following http://maven.apache.org/archiva/guides/getting-started.html for Tomcat didn't get me started.
I'll go through it point by point

  1. Create a directory in tomcat called archiva, at the same level as bin, conf, logs and the others.
  2. Copy the war file from apps/archiva/lib into the new directory

There is not apps/archiva/lib in the 1.0-beta-2 distribution.
apps contains a single file : archiva-plexus-application-1.0-beta-2.jar which does itself contain a war file, so I extracted that file and copied it to the TOMCAT_HOME/archiva folder.

NB IMHO modifying TOMCAT in this manner smells all wrong.

  1. Create a conf/Catalina/localhost/archiva.xml file with the following data: yadda, yadda

The docBase attribute refers to archiva-webapp-1.0-SNAPSHOT.war instead of archiva-webapp-1.0-beta-2.war

No idea why a javax.mail.Session needs to be configured here, haven't seen any documentation in Archiva that suggests it send, receives email. But this was a slight pain when configuring for Tomcat-5.5.20 as I needed to follow the extra steps for the missing classes. If the MailSession is not required it would be better to avoid this pain by simplifying the config.

Again modifying TOMCAT like this does not feel right. Surely this config could be contained within the webapp.

  1. Copy $HOME/.m2/org/apache/derby/derby/10.1.3.1/derby-10.1.3.1.jar (or from the remote repository) into the Tomcat common/lib

I am really against this as I have now introduced Derby-10.1.3.1 into the classpath of 8all* my other applications running on that Tomcat instance. Surely this library could be packaged up into the webapp.

  1. To deal with a current bug, you'll also need to add the following to your $catalina.home/conf/web.xml in the relevant section (search for jspx):

Again, surely this could be included in the config for the Archiva webapp instead of introduced into Tomcat generally. This heavy handed approach makes maintenance difficult, eg upgrading to a new version of Tomcat is now extremely onerous.

OK, so having followed the instructions above, when I try to startup Tomcat the first thin I get is a failure with the logging sub system. see attached bad-log-filename.log. I believe this is due to the fact that ${appserver.base} in log4j.xml has never been set:



<param name="file" value="${appserver.base}/logs/archiva.log" />


Next, it fails as it can't find javax.mail.Authenticator (this is Tomcat-5.5.17).

NB I never saw any indication that "schema SA does not exist" as the final note suggests. But perhaps this was because Archiva never got that far. Certainly no application is available at http://localhost:8080/archiva/

Anyway, by this stage I became discouraged enough that I gave up.

Its a shame really as I would have liked to be able to compare Archiva against Proximity and Artifactory, both of which I managed to get setup in under 10 mins including vastly restructuring the default repository config that they ship with.

Brett, hope that helps.

Further notes:
I really don't like modifying the contents of TOMCAT_HOME other than to deploy a WAR to TOMCAT_HOME/webapps.
And the infrastructure team weren't impressed either and its makes maintenance high cost.
Better to keep all config solely within the confines of the webapp or use a environment variable to declare a separate proxy_home where all the config is contained (like Artifactory does).

  1. bad-log-filename.log
    15/Oct/07 8:41 PM
    5 kB
    William Ferguson
  2. mail-auth-class-not-found.log
    15/Oct/07 8:41 PM
    17 kB
    William Ferguson

Issue Links

Activity

Hide
Emmanuel Venisse added a comment -

You can look at the Continuum installation doc (http://maven.apache.org/continuum/documentation/1_1/installation/tomcat.html). Continuum and Archiva installs are very similar.

Show
Emmanuel Venisse added a comment - You can look at the Continuum installation doc (http://maven.apache.org/continuum/documentation/1_1/installation/tomcat.html). Continuum and Archiva installs are very similar.
Hide
Eduardo Issao Ito added a comment -

I've just installed Archiva-1.0-beta4 in Tomcat-5.5.25 and what I did was:

1. Compiled the source manually and uncompressed the file archiva-web/archiva-webapp/target/archiva-webapp-1.0-beta-4.war into $CATALINA_HOME/archiva/archiva-webapp-1.0-beta-4

2. Copied mail-1.4.jar and derby-10.1.3.1.jar to $CATALINA_HOME/commons/lib

3. Created the file $CATALINA_HOME/conf/Catalina/localhost/archiva.xml

4. I didn't changed $CATALINA_HOME/conf/web.xml as stated n the docs. Is it still needed? What is the bug?

5. Edited the file $CATALINA_HOME/bin/setenv.sh to add the line below:

export CATALINA_OPTS="-Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_HOME"

It seems to be working!

But there is an issue: the derby database and derby.log are created in the current directory from where I start Tomcat...
How can I fix the path of derby?

By the way, why is derby.jar in a Tomcat directry instead of WEB-INF/lib inside the war?

Show
Eduardo Issao Ito added a comment - I've just installed Archiva-1.0-beta4 in Tomcat-5.5.25 and what I did was: 1. Compiled the source manually and uncompressed the file archiva-web/archiva-webapp/target/archiva-webapp-1.0-beta-4.war into $CATALINA_HOME/archiva/archiva-webapp-1.0-beta-4 2. Copied mail-1.4.jar and derby-10.1.3.1.jar to $CATALINA_HOME/commons/lib 3. Created the file $CATALINA_HOME/conf/Catalina/localhost/archiva.xml 4. I didn't changed $CATALINA_HOME/conf/web.xml as stated n the docs. Is it still needed? What is the bug? 5. Edited the file $CATALINA_HOME/bin/setenv.sh to add the line below: export CATALINA_OPTS="-Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_HOME" It seems to be working! But there is an issue: the derby database and derby.log are created in the current directory from where I start Tomcat... How can I fix the path of derby? By the way, why is derby.jar in a Tomcat directry instead of WEB-INF/lib inside the war?
Hide
Brett Porter added a comment -

I've made minor adjustments to the doc, and there is some more comprehensive doc on the wiki.

The mail is needed for sending user account details. It can be safely omitted if you don't need forgotten password accounts to work and will be admining by hand.

The derby jar must be in the common/lib so that it works as a JNDI data source from Tomcat, which is instantiated before the web application classloader is started.

I've removed the workaround since that appears not to be needed any more.

Show
Brett Porter added a comment - I've made minor adjustments to the doc, and there is some more comprehensive doc on the wiki. The mail is needed for sending user account details. It can be safely omitted if you don't need forgotten password accounts to work and will be admining by hand. The derby jar must be in the common/lib so that it works as a JNDI data source from Tomcat, which is instantiated before the web application classloader is started. I've removed the workaround since that appears not to be needed any more.
Hide
Daniel Harvey added a comment -

Suggest re-opening as I cannot get it working with the existing docs - I had to go to the wiki and Jira to get the answers.

Specifically, I could not deploy on Tomcat 6 without defining in Tomcat's enviroment:

export CATALINA_OPTS="-Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_HOME"

which is not covered in the current install docs.

Show
Daniel Harvey added a comment - Suggest re-opening as I cannot get it working with the existing docs - I had to go to the wiki and Jira to get the answers. Specifically, I could not deploy on Tomcat 6 without defining in Tomcat's enviroment:
export CATALINA_OPTS="-Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_HOME"
which is not covered in the current install docs.
Hide
Brett Porter added a comment -

Daniel - would you mind opening a new issue for this?

Show
Brett Porter added a comment - Daniel - would you mind opening a new issue for this?
Hide
Wendy Smoak added a comment -

re-closing as MRM-646 is already open

Show
Wendy Smoak added a comment - re-closing as MRM-646 is already open

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: