title: How do I view the reason why a deployment failed in JBoss 7?
body: <p>I’m using JBoss 7.1.3.Final with Java 6.  I’m trying to deploy my exploded web application project and I get this very non-descriptive error …</p>
  
  <pre><code>15:26:51,187 INFO  [stdout] (MSC service thread 1-1) [DEBUG,EntityManagerFactoryRegistry] Remove: name=default
  15:26:51,245 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Initializing Mojarra 2.1.11-jbossorg-3 20120815-1456 for context '/myproject'
  15:26:56,631 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Error listenerStart
  15:26:56,641 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/myproject] startup failed due to previous errors
  15:26:56,671 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.web.deployment.default-host./myproject: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./myproject: JBAS018040: Failed to start context
          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:94)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_65]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_65]
          at java.lang.Thread.run(Thread.java:680) [rt.jar:1.6.0_65]
  
  15:26:56,922 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "myproject.war"
  15:26:56,923 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "jenkins.war"
  15:26:56,925 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
  </code></pre>
  
  <p>JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./myproject: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./myproject: JBAS018040: Failed to start context</p>
  
  <p>There is no other stack trace before or after this error.  What kind of logging do I need to enable to get more information about why my deployment failed?  I have this log4j.properties in my WEB-INF/classes file …</p>
  
  <pre><code># Global logging configuration
  log4j.rootLogger=DEBUG, stdout
  
  # Console output...
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.conversionPattern=[%p,%c{1}] %m%n
  
  # Rolling log file output...
  log4j.appender.fileout=org.apache.log4j.FileAppender
  log4j.appender.fileout.File=myproject.log
  log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
  log4j.appender.fileout.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n
  log4j.appender.fileout.Append=false
  
  # package specific logging
  log4j.logger.net.sf.ehcache.distribution.RMICachePeer=DEBUG
  log4j.logger.org.springframework.security=DEBUG
  log4j.logger.org.hibernate=ERROR
  log4j.logger.org.collegeboard.springboard.myproject.mvc.listener=DEBUG
  log4j.logger.org.collegeboard.springboard.core.security=DEBUG
  </code></pre>
  
  <p>and here is how my logging is set up in $JBOSS_HOME/standalone/configuration/standlone.xml file …</p>
  
  <pre><code>    &lt;subsystem xmlns="urn:jboss:domain:logging:1.1"&gt;
          &lt;console-handler name="CONSOLE"&gt;
              &lt;level name="INFO"/&gt;
              &lt;formatter&gt;
                  &lt;pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/&gt;
              &lt;/formatter&gt;
          &lt;/console-handler&gt;
          &lt;periodic-rotating-file-handler name="FILE"&gt;
              &lt;formatter&gt;
                  &lt;pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/&gt;
              &lt;/formatter&gt;
              &lt;file relative-to="jboss.server.log.dir" path="server.log"/&gt;
              &lt;suffix value=".yyyy-MM-dd"/&gt;
              &lt;append value="true"/&gt;
          &lt;/periodic-rotating-file-handler&gt;
          &lt;logger category="com.arjuna"&gt;
              &lt;level name="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger category="org.apache.tomcat.util.modeler"&gt;
              &lt;level name="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger category="sun.rmi"&gt;
              &lt;level name="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger category="jacorb"&gt;
              &lt;level name="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger category="jacorb.config"&gt;
              &lt;level name="ERROR"/&gt;
          &lt;/logger&gt;
          &lt;root-logger&gt;
              &lt;level name="INFO"/&gt;
              &lt;handlers&gt;
                  &lt;handler name="CONSOLE"/&gt;
                  &lt;handler name="FILE"/&gt;
              &lt;/handlers&gt;
          &lt;/root-logger&gt;
      &lt;/subsystem&gt;
  </code></pre>