在tomcat 6上部署Apache Archiva [英] Deploy Apache Archiva on tomcat 6

查看:191
本文介绍了在tomcat 6上部署Apache Archiva的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



规格:

  os:ubuntu 10.04 
tomcat:Apache Tomcat / 6.0.24
jvm:1.6.0_27-b27

$ CATALINA_HOME :/ usr / share / tomcat6
$ CATALINA_BASE:/ var / lib / tomcat6
$ CATALINA_OPTS:-Dappserver.home = $ CATALINA_HOME -Dappserver.base = $ CATALINA_BASE

路径到lib:$ CATALINA_BASE / common / lib

#java -version
java版本1.6.0_27
OpenJDK运行时环境(IcedTea6 1.12.3)(6b27- 1.12.3-0ubuntu1〜10.04.1)
OpenJDK客户端虚拟机(build 20.0-b12,混合模式,共享)

Tomcat本身正在运行。我按照页面上的说明将所有必需的jar复制到lib(上面指定的位置)在 / var / lib / tomcat6 / conf / Catalina / localhost / archiva.xml c>与该内容:

 <上下文路径=/ archivadocBase =/ var / lib / tomcat6 / archiva /apache-archiva-1.4-M4.war\"> 

<资源名称=jdbc / users
auth =容器
type =javax.sql.DataSource
username =philipp
password =xxx
driverClassName =org.apache.derby.jdbc.EmbeddedDriver
url =jdbc:derby://// localhost:1527 / archivausers; create = true />

<资源名称=jdbc / archiva
auth =容器
type =javax.sql.DataSource
username =philipp
password =xxx
driverClassName =org.apache.derby.jdbc.EmbeddedDriver
url =jdbc:derby:// localhost:1527 / archivadata; create = true/> ;

<资源名称=邮件/会话
auth =容器
type =javax.mail.Session
mail.smtp.host = 本地主机/>
< / Context>

在tomcat管理器中单击»start«之后: FAIL - 应用程序在上下文路径/ archiva无法启动



catalina.out上的最后一行是:



SCHWERWIEGEND:Web应用程序创建了一个带有[java.lang.ThreadLocal]类型的键的ThreadLocal(value [java.lang .ThreadLocal @ 69bf9])和类型[org.apache.logging.log4j.core.impl.Log4jLogEvent]的值(值[Logger = org.springframework.web.context.ContextLoader Level = ERROR Message =上下文初始化失败])但是当Web应用程序停止时,它无法将其删除。为了防止内存泄漏,ThreadLocal已被强制删除。
11.06.2013 16:29:30 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SCHWERWIEGEND:一个Web应用程序创建了一个带有[null]类型的值的ThreadLocal(value [org.apache.logging。 log4j.spi.DefaultThreadContextMap$1@1ea380c])和类型为[null](value [null])的值,但在Web应用程序停止时未能将其删除。为了防止内存泄漏,ThreadLocal已被强制删除。



我尝试过或多或少的一切都是我想到的,但总是失败



任何想法?

解决方案

由于我可以设法获得它运行我认为可能有用的其他人分享我采取的步骤。这些描述假设已经阅读了有关归档的官方安装说明并且应该是一种额外的解释,因为官方文档可能会更详细一些。



首先我下载了​​»war«并将其存储在 / var / lib / tomcat6 / archiva ,这定义了起点。



1。数据库:



在官方的说明一个被要求下载 derby.jar derbytools.jar 保存他们在 $ CATALINA_HOME / lib (在我的情况下指向 / usr / share / tomcat6 / lib )该文件可用于在此tomcat上运行的所有Web应用程序。在我的研究中,我来到了 apache derby项目,在那里我也找到了这个命令:

  sudo apt-get install sun-javadb-core sun-javadb-client 

只需安装derby db(在我的例子中,我必须在 /etc/apt/sources.list

  sudo ln -s /usr/share/javadb/lib/*.jar -t / usr / share / tomcat6 / lib 

将所有需要的derby-jar链接到tomcat lib(可能有些不是需要在那里)。之后,我在 / var / lib / tomcat6 / archiva 中创建了目录 db ,并将其所有者和组更改为tomcat6 ,但是由您决定存储数据库文件,但重要的是不要为两个所需的数据库创建两个子目录:namly: users archiva ,在该目录内。



2。邮件



我按照说明并复制了 mail.jar activate.jar 到tomcats库。



3。 archiva主目录



阻止归档运行的其中一个错误是尝试在 / usr / share / tomcat6 / .m2 ,但是导致权限冲突,所以我创建了该目录,并将组和所有者更改为tomcat6。



最后但并非最不重要的我关心 archiva.xml ,位于 / var / lib / conf / Catalina /本地主机。因为应该替换的路径没有标记在»bold«这是很容易监督他们,所以我尝试这样做,使用 $ {path} 指出:

 <上下文路径=/ archiva
docBase =$ {路径到archiva war archive here}>

<资源名称=jdbc / users
auth =容器
type =javax.sql.DataSource
username =sa
password =
driverClassName =org.apache.derby.jdbc.EmbeddedDriver
url =jdbc:derby:$ {db文件夹的路径} / users; create = true />

<资源名称=jdbc / archiva
auth =容器
type =javax.sql.DataSource
username =sa
password =
driverClassName =org.apache.derby.jdbc.EmbeddedDriver
url =jdbc:derby:$ {path to db folder} / archiva; create = true/ >

<资源名称=邮件/会话
auth =容器
type =javax.mail.Session
mail.smtp.host = 本地主机/>
< / Context>

这应该是一切,我希望我没有忘记任何提及。搜索 catalina.out 的错误日志是一种无意义的,因为那里的消息没有描述明确的问题,因此,我想建议阅读 localhost。$ {date} .log 在同一个目录中,我可以找到更有用的调试信息。



ps Archiva的安装对Apache Continuum执行了相同的步骤,只需更换文件夹和文件名,导致运行安装的结果也是如此。



快乐安装,欢呼! / p>

I am trying to deploy Apache Archiva on my Server, but it just fails all the time.

specs:

os: ubuntu 10.04 
tomcat: Apache Tomcat/6.0.24
jvm: 1.6.0_27-b27

$CATALINA_HOME : /usr/share/tomcat6
$CATALINA_BASE : /var/lib/tomcat6
$CATALINA_OPTS : "-Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_BASE"

path to lib : $CATALINA_BASE/common/lib

#java -version
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-0ubuntu1~10.04.1)
OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)

Tomcat itself is up and running. I followed the instructions on this page, copied all the necessary jars to the lib (location specified above), created the archiva.xml in /var/lib/tomcat6/conf/Catalina/localhost/ with that content:

<Context path="/archiva" docBase="/var/lib/tomcat6/archiva/apache-archiva-1.4-M4.war">

  <Resource name="jdbc/users"
        auth="Container"
        type="javax.sql.DataSource"
        username="philipp"
        password="xxx"
        driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
        url="jdbc:derby:////localhost:1527/archivausers;create=true" />

  <Resource name="jdbc/archiva"
        auth="Container"
        type="javax.sql.DataSource"
        username="philipp"
        password="xxx"
        driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
        url="jdbc:derby://localhost:1527/archivadata;create=true" />

  <Resource name="mail/Session"
        auth="Container"
        type="javax.mail.Session"
        mail.smtp.host="localhost"/>
</Context>

After a click on »start« in the tomcat manager: FAIL - Application at context path /archiva could not be started

the last lines on the catalina.out are:

SCHWERWIEGEND: A web application created a ThreadLocal with key of type[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@69bf9]) and a value of type [org.apache.logging.log4j.core.impl.Log4jLogEvent] (value [Logger=org.springframework.web.context.ContextLoader Level=ERROR Message=Context initialization failed]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed. 11.06.2013 16:29:30 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap SCHWERWIEGEND: A web application created a ThreadLocal with key of type [null] (value [org.apache.logging.log4j.spi.DefaultThreadContextMap$1@1ea380c]) and a value of type [null] (value [null]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.

I tried more or less everything what came to my mind, but always FAIL!

Any Idea?

解决方案

Since I could manage to get it running I think it could be useful for somebody else to share the steps I have taken. These descriptions assume that one has already has read the official installation Instructions of archiva and should be a kind of additional explanation due to the fact that the official documentation could be a bit more verbose.

First I downloaded the »war« and stored it in /var/lib/tomcat6/archiva, this defines the starting point.

1. Database:

In the official instruction one is asked to download derby.jar and derbytools.jar to save them in $CATALINA_HOME/lib (in my case that points to /usr/share/tomcat6/lib) to make the files available for all web application running on this tomcat. On my research I came over the apache derby project where I also found this command:

sudo apt-get install sun-javadb-core sun-javadb-client

which just installs the derby db (in my case I had to add »multiverse« in /etc/apt/sources.list at the of one source). After that I run:

sudo ln -s /usr/share/javadb/lib/*.jar -t /usr/share/tomcat6/lib

what linked all needed derby-jars to the tomcat lib (probably some are not needed there). After that I created the directory db in /var/lib/tomcat6/archiva and changed its owner and group to tomcat6, but it is up to you where you want to store the database files, but it is important not to create the two subdirectories for the two needed databases, namly: users and archiva, inside that directory.

2. Mail

There I followed the Instructions and copied mail.jar and activation.jar to tomcats library.

3. archiva home directory

One of the Errors that prevented archiva from running was that it tried to create a home Directory in /usr/share/tomcat6/.m2, but that resulted in an permission conflict, so I created that directory and changed group and owner to tomcat6.

Last but not least I cared about the archiva.xml, located in in /var/lib/conf/Catalina/localhost. Since the paths that should be replaced were not marked in »bold« it is kind of easy to oversee them, so I try to do that here, using ${path} to point that out:

<Context path="/archiva"
     docBase="${path to the archiva war archive here}">

  <Resource name="jdbc/users"
        auth="Container"
        type="javax.sql.DataSource"
        username="sa"
        password=""
        driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
        url="jdbc:derby:${path to the db folder}/users;create=true" />

  <Resource name="jdbc/archiva"
        auth="Container"
        type="javax.sql.DataSource"
        username="sa"
        password=""
        driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
        url="jdbc:derby:${path to db folder}/archiva;create=true" />

  <Resource name="mail/Session"
        auth="Container"
        type="javax.mail.Session"
        mail.smtp.host="localhost"/>
</Context> 

That should be everything and I hope that I did not forgot anything to mention. Searching the catalina.out for error logs is a kind of senseless since the messages in there do not describe explicit problems, therefor I want to suggest to read localhost.${date}.log in the same directory, therein I could find debug information which was much more useful.

p.s.: After the Installation of Archiva did the very same Steps for Apache Continuum, just replacing folder- and filenames, what resulted in a running Installation, too.

Happy Install, cheers!

这篇关于在tomcat 6上部署Apache Archiva的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆