Lorin S. Lorin S. - 5 months ago 44
Java Question

Spring-Boot Deployment -- JBAS011555: Failed to configure logging using 'logging.properties' configuration file

AKA: How-To Configure Logging for Spring-Boot + JBOSS 7.1 Server

Trying to deploy a spring-boot application against an older JBoss 7.1 server instance (customer requirement.)

I originally was working with a project that stands up fine under Tomcat but when I deploy it to JBoss, it issues the logging error you see below. I have found the usual suspects via Google for both the jboss-structure.xml changes and the build.gradle dependencies. I remain with the indicated error though.

I am using: Spring-Boot 1.3.5 and for the example of this question, I am taking a fresh build, directly from http://start.spring.io and deploying it without any modifications.

build.gradle:

buildscript {
ext {
springBootVersion = '1.3.5.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'spring-boot'
apply plugin: 'war'


war {
baseName = 'demo'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
}

configurations {
providedRuntime
}

dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-data-rest')
compile('org.springframework.boot:spring-boot-starter-mustache')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-ws')
runtime('com.h2database:h2')
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
testCompile('org.springframework.boot:spring-boot-starter-test')
}


eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}


server.log

2016-06-02 13:10:37,946 INFO [org.jboss.as.server.deployment] (MSC service thread 1-18) | DeploymentServiceListener constructor for deployment demo-0.0.1-SNAPSHOT.war]
2016-06-02 13:10:37,947 INFO [org.jboss.as.server.deployment] (MSC service thread 1-18) | JBAS015876: Starting deployment of "demo-0.0.1-SNAPSHOT.war"
2016-06-02 13:10:39,069 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) | MSC00001: Failed to start service jboss.deployment.unit."demo-0.0.1-SNAPSHOT.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."demo-0.0.1-SNAPSHOT.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "demo-0.0.1-SNAPSHOT.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]
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.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011555: Failed to configure logging using 'logging.properties' configuration file.
at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:125)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]
... 5 more
Caused by: java.lang.IllegalArgumentException: className is null
at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:52) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
at org.jboss.logmanager.config.HandlerConfigurationImpl.<init>(HandlerConfigurationImpl.java:54) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
at org.jboss.logmanager.config.LogContextConfigurationImpl.addHandlerConfiguration(LogContextConfigurationImpl.java:138) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
at org.jboss.logmanager.PropertyConfigurator.configureHandler(PropertyConfigurator.java:477) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:379) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:92) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:122)
... 6 more

2016-06-02 13:10:39,071 INFO [org.jboss.as.server] (host-controller-connection-threads - 9) | JBAS015870: Deploy of deployment "demo-0.0.1-SNAPSHOT.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"demo-0.0.1-SNAPSHOT.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"demo-0.0.1-SNAPSHOT.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"demo-0.0.1-SNAPSHOT.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011555: Failed to configure logging using 'logging.properties' configuration file.
Caused by: java.lang.IllegalArgumentException: className is null"}}
2016-06-02 13:10:39,095 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) | JBAS015877: Stopped deployment demo-0.0.1-SNAPSHOT.war in 23ms

Answer

Took 3 steps to get this to work with helpful logging...

  1. Start JBoss in per-deployment logging mode. I just launched it with export JAVA_OPTS=-Dorg.jboss.as.logging.per-deployment=false
  2. Add compile('org.slf4j:slf4j-api:1.7.5') to my build.gradle
  3. Configure logging in application.properties (note: application.yml doesn't seem to work for JBoss config in this case):
logger.level=INFO

logger.handlers=FILE,CONSOLE

handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
handler.CONSOLE.properties=autoFlush
handler.CONSOLE.level=INFO
handler.CONSOLE.autoFlush=true
handler.CONSOLE.formatter=PATTERN

handler.FILE=org.jboss.logmanager.handlers.FileHandler
handler.FILE.level=DEBUG
handler.FILE.properties=autoFlush,fileName
handler.FILE.autoFlush=true
handler.FILE.fileName=bridge.log
handler.FILE.formatter=PATTERN

formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.PATTERN.properties=pattern
formatter.PATTERN.pattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n