Search code examples
jbossarchiva

Archiva deployment on wildfly 10


I have the following problem when i try to deploy archiva 2.2.1 on wildfly 10. Can someone help me to resolve it ?

Unexpected HTTP response: 500

Request
{
    "operation" => "deploy",
    "address" => [("deployment" => "archiva.war")]
}

Response

Internal Server Error
{
    "outcome" => "failed",
    "failure-description" => {"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.archiva.archiva.env.mail.Session is missing [jboss.naming.context.java.jboss.resources.mail.Session]"]},
    "rolled-back" => true
}

Solution

  • You need to specify the JNDI name in your WEB-INF/web.xml file in the archiva JAR.

    <resource-ref>
      <res-ref-name>mail/Session</res-ref-name>
      <res-type>javax.mail.Session</res-type>
      <jndi-name>java:jboss/mail/Default</jndi-name>
    </resource-ref>
    

    You can find the JNDI name by referring to the standalone/configurations/standalone-full.xml.

    <subsystem xmlns="urn:jboss:domain:mail:2.0">
        <mail-session name="default" jndi-name="java:jboss/mail/Default">
            <smtp-server outbound-socket-binding-ref="mail-smtp"/>
        </mail-session>
    </subsystem>
    

    Note the JNDI name of the mail session is java:jboss/mail/Default.