You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@archiva.apache.org by Leon Davis <le...@yahoo.com> on 2008/01/21 21:15:49 UTC

Trouble deploying Archiva 1.0 to JBoss 4.2.2.GA

Hi I have been trying to deploy the latest version of
the Archiva war to JBoss version 4.2.2 without
success. Has anyone else been successful in deploying
the latest version of Archiva to JBoss?

I would really like to get this working and appreciate
any help anyone can offer!

I have seen the following wiki page that contains
instructions:

http://docs.codehaus.org/display/MAVENUSER/Archiva+on+JBoss

In addition to this I have looked at:
http://docs.codehaus.org/display/MAVENUSER/Archiva+on+Tomcat

What I have done:
1. I have added the following context.xml to the
META-INF directory of the Archiva war file:
<Context path="/archiva"
         docBase="/">

  <Resource name="jdbc/users"
            auth="Container"
            type="javax.sql.DataSource"
            username="sa"
            password=""
           
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
           
url="jdbc:derby:database/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:database/archiva;create=true" />

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

2. I have added a jboss-web.xml file to the WEB-INF
directory of the war: (as instructed on the wiki:
Although it feels as though there should be more
entries in this file as there are more resource-ref
entries made in the web.xml file?)
<?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>

3. I made sure that the following entry appears in the
web.xml file: 
<resource-ref>
 <res-ref-name>jdbc/users</res-ref-name>
 <res-type>javax.sql.DataSource</res-type>
 <res-auth>Container</res-auth>
</resource-ref>

This entry was already in web.xml along with the
following two other entries:
  <resource-ref>
     <res-ref-name>jdbc/archiva</res-ref-name>
     <res-type>javax.sql.DataSource</res-type>
     <res-auth>Container</res-auth>
     <res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>
  <resource-ref>
     <res-ref-name>mail/Session</res-ref-name>
     <res-type>javax.mail.Session</res-type>
     <res-auth>Container</res-auth>
     <res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>

4. I have coppied derby-10.1.3.1.jar,
derby-tools-10.1.3.1.jar and mail-1.4.jar in to
JBoss's default server's lib directory

5. I have added the following derby-ds.xml file to
JBoss's default server's deploy directory.
<?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>

The wiki says to include settings for appserver.base
and appserver.home using the CATALINA_OPTS environment
variable but I am not sure where I should be
specifying this within the JBoss configuration? As a
result I do see exceptions when the \log\logfiles can
not be found.

So What happens when loading JBoss?:
On loading JBoss: I see the following:
org.jboss.deployment.DeploymentException: Error during
deploy; - nested throwable:
(javax.naming.NamingException: resource-ref:
mail/Session has no valid JNDI binding. Check the
jboss-web/resource-ref.)

Followed by a very long stack trace.

The message mentions the resource-ref's in
jboss-web.xml and I have tried adding JNDI bindings
for both jdbc/archiva and mail/Session: (I am guessing
what these are supposed to be)
<?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>
<resource-ref>
   <res-ref-name>jdbc/archiva</res-ref-name>
   <jndi-name>java:/archiva</jndi-name>
 </resource-ref>
 <resource-ref>
   <res-ref-name>mail/Session</res-ref-name>
   <jndi-name>java:/mail</jndi-name>
 </resource-ref>
</jboss-web>

On doing so I get:
20:00:19,531 INFO  [STDOUT] 2008-01-21 20:00:19,515
[main] ERROR
org.apache.commons.configuration.JNDIConfiguration  -
Could not dereference
objectjavax.naming.NamingException: Could not
dereference object [Root exception is
javax.naming.NameNotFoundException: mail not bound]

Once again many thanks for any help you might be able
to give me.

Many thanks,
Leon Davis




      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com


Re: Trouble deploying Archiva 1.0 to JBoss 4.2.2.GA

Posted by Christian López Espínola <pe...@gmail.com>.
Hi folks, 

I had to deploy archiva 1.2.1 in JBoss 4.0.5 (yeah, I know, old versions...
but those are my requirements...) and this old thread and the wiki helped,
but it wasn't a very concrete guide (I had to experiment some things by
myself).

I wrote a more concise guide and published here:
http://penyaskitodice.wordpress.com/2009/06/22/archiva-1-2-1-sobre-jboss-as-4-0-5-en-windows-64/

It's written in Spanish but there isn't any literature there.

Hope this helps saving other's time.


Leon Davis wrote:
> 
> Hi Martin,
> 
> Many thanks for all your effort it is very much
> appreciated, I will have a go at the things you
> suggest and update the thread :)
> 
> Many thanks,
> Leon
> --- Martin Höller <ma...@xss.co.at> wrote:
> 
>> On Friday 25 January 2008 wrote Martin Höller:
>> > Ok instead of commenting it out one can configure
>> the java mail service
>> > for tomcat.
>>        ^----- not "for tomcat"! "for JBoss" would
>> obviously be correct.
>> 
>> -- 
>> Martin Höller                   |
>> martin.hoeller@xss.co.at
>> *x Software + Systeme           |
>> http://www.xss.co.at/
>> Karmarschgasse 51/2/20          | Tel:
>> +43-1-6060114-30
>> A-1100 Vienna, Austria          | Fax:
>> +43-1-6060114-71
>> 
> 
> 
> 
>       ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try
> it
> now.
> http://uk.answers.yahoo.com/ 
> 
> 

-- 
View this message in context: http://www.nabble.com/Trouble-deploying-Archiva-1.0-to-JBoss-4.2.2.GA-tp15005490p24147813.html
Sent from the archiva-users mailing list archive at Nabble.com.


Re: Trouble deploying Archiva 1.0 to JBoss 4.2.2.GA

Posted by Leon Davis <le...@yahoo.com>.
Hi Martin,

Many thanks for all your effort it is very much
appreciated, I will have a go at the things you
suggest and update the thread :)

Many thanks,
Leon
--- Martin Höller <ma...@xss.co.at> wrote:

> On Friday 25 January 2008 wrote Martin Höller:
> > Ok instead of commenting it out one can configure
> the java mail service
> > for tomcat.
>        ^----- not "for tomcat"! "for JBoss" would
> obviously be correct.
> 
> -- 
> Martin Höller                   |
> martin.hoeller@xss.co.at
> *x Software + Systeme           |
> http://www.xss.co.at/
> Karmarschgasse 51/2/20          | Tel:
> +43-1-6060114-30
> A-1100 Vienna, Austria          | Fax:
> +43-1-6060114-71
> 



      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

Re: Trouble deploying Archiva 1.0 to JBoss 4.2.2.GA

Posted by Martin Höller <ma...@xss.co.at>.
On Friday 25 January 2008 wrote Martin Höller:
> Ok instead of commenting it out one can configure the java mail service
> for tomcat.
       ^----- not "for tomcat"! "for JBoss" would obviously be correct.

-- 
Martin Höller                   | martin.hoeller@xss.co.at
*x Software + Systeme           | http://www.xss.co.at/
Karmarschgasse 51/2/20          | Tel: +43-1-6060114-30
A-1100 Vienna, Austria          | Fax: +43-1-6060114-71

Re: Trouble deploying Archiva 1.0 to JBoss 4.2.2.GA

Posted by Martin Höller <ma...@xss.co.at>.
On Wednesday 23 January 2008 wrote Martin Höller:
> Step 3a) is to comment this entry out from web.xml
>
>   <!--
>   <resource-ref>
>      <res-ref-name>mail/Session</res-ref-name>
>      <res-type>javax.mail.Session</res-type>
>      <res-auth>Container</res-auth>
>      <res-sharing-scope>Shareable</res-sharing-scope>
>   </resource-ref>
>   -->
>
> It would probably be better to configure this resource somehow but I
> don't know how to do this. Any suggestions?

Ok instead of commenting it out one can configure the java mail service for 
tomcat. This is usually done by adapting the file 
JBOSS_HOME/server/default/deploy/mail-service.xml. Instructions can be 
found here: http://wiki.jboss.org/wiki/Wiki.jsp?page=JavaMail

hth,
- martin
-- 
Martin Höller                   | martin.hoeller@xss.co.at
*x Software + Systeme           | http://www.xss.co.at/
Karmarschgasse 51/2/20          | Tel: +43-1-6060114-30
A-1100 Vienna, Austria          | Fax: +43-1-6060114-71

Re: Trouble deploying Archiva 1.0 to JBoss 4.2.2.GA

Posted by Martin Höller <ma...@xss.co.at>.
Hi!

On Monday 21 January 2008 wrote Leon Davis:
> Hi I have been trying to deploy the latest version of
> the Archiva war to JBoss version 4.2.2 without
> success. Has anyone else been successful in deploying
> the latest version of Archiva to JBoss?

I just had the same problem as you had and did not find a perfect solution
but at least archiva is running now.

What I did was basically following this wiki entry:
http://docs.codehaus.org/display/MAVENUSER/Archiva+on+JBoss

Step 1) as described

Step 1a) is to restart JBoss to make it recognize the new driver.

Step 2) as described but adding an additional datasource:

  <local-tx-datasource>
     <jndi-name>archiva</jndi-name>
     <connection-url>jdbc:derby:database/archiva;create=true</connection-url>
     <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
     <user-name>sa</user-name>
     <password></password>
     <min-pool-size>5</min-pool-size>
     <max-pool-size>20</max-pool-size>
     <idle-timeout-minutes>5</idle-timeout-minutes>
     <track-statements/>
  </local-tx-datasource>

Step 3) is not needed as the mentioned resource-ref is alread there.

Step 3a) is to comment this entry out from web.xml

  <!--
  <resource-ref>
     <res-ref-name>mail/Session</res-ref-name>
     <res-type>javax.mail.Session</res-type>
     <res-auth>Container</res-auth>
     <res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>
  -->

It would probably be better to configure this resource somehow but I don't
know how to do this. Any suggestions?

Step 4) as descibed with the addition to add the following:

  <resource-ref>
    <res-ref-name>jdbc/archiva</res-ref-name>
    <jndi-name>java:/archiva</jndi-name>
  </resource-ref>

Step 5) and 6) as descibed.


Comments (especially about setp 3a) are very welcome!

hth,
- martin
-- 
Martin Höller                   | martin.hoeller@xss.co.at
*x Software + Systeme           | http://www.xss.co.at/
Karmarschgasse 51/2/20          | Tel: +43-1-6060114-30
A-1100 Vienna, Austria          | Fax: +43-1-6060114-71