jndi-name
element in the resource-ref
seems to be mandatory, contrary to AS6 or other application servers.
Keeping things like this in mind can drastically reduce the time spent on investigating deployment errors like the one below:My JMS Connection Factory jms/MyConnectionFactory java:/jms/MyConnectionFactory javax.jms.ConnectionFactory Container
Unknown error Unexpected HTTP response: 500 Request { "address" => [("deployment" => "MyApp.war")], "operation" => "deploy" } Response Internal Server Error { "outcome" => "failed", "failure-description" => {"JBAS014771: Services with missing/unavailable dependencies" => [ "jboss.deployment.unit.\"MyApp.war\".component.\"javax.faces.webapp.FacesServlet\".START Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".jboss.security.jacc Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.MySessionBean1.START Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.\"org.apache.catalina.servlets.DefaultServlet\".START Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".jndiDependencyService Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.MySessionBean2.START Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.\"org.apache.jasper.servlet.JspServlet\".START Missing[JBAS014861: ]", "jboss.naming.context.java.module.\"MyApp\".\"MyApp\".env.jms.MyConnectionFactory Missing[jboss.naming.context.java.jboss.resources.jms.MyConnectionFactory]", "jboss.web.deployment.default-host./myapp Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.\"org.jboss.as.weld.webtier.jsp.JspInitializationListener\".START Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.MySessionBean3.START Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START Missing[JBAS014861: ]", "jboss.deployment.unit.\"MyApp.war\".component.MySessionBean4.START Missing[JBAS014861: ]" ]}, "rolled-back" => true }In this example, JBoss complains about every possible component of the web application, so it's kind of difficult to spot the real (and only) error in the deployment:
... "jboss.naming.context.java.module.\"MyApp\".\"MyApp\".env.jms.MyConnectionFactory Missing[jboss.naming.context.java.jboss.resources.jms.MyConnectionFactory]", "jboss.web.deployment.default-host./myapp Missing[JBAS014861: ]", ...The error was caused by the previously missing
jndi-name
element which was not needed when deploying the same application to AS6:
...After adding the JNDI name to the configuration, the deployment worked fine on AS7.java:/jms/MyConnectionFactory ...
Note taken.