Skip to content

Spring Boot 2 no logging exception message when use Apache Commons BeanUtils #12457

Closed
@alanbear

Description

@alanbear

When I use Apache Commons BeanUtils with Spring Boot 2, I can't catch exception stacktrace message.

I also try other version, only 2.X have this problem.

build.gradle

buildscript {
	ext {
		springBootVersion = '2.0.0.RELEASE'
//		springBootVersion = '1.5.10.RELEASE'
//		springBootVersion = '2.0.1.BUILD-SNAPSHOT'
	}
	repositories {
		mavenCentral()
        maven {
            url 'https://repo.spring.io/libs-snapshot'
        }
	}
	dependencies {
		classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
	}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
	mavenCentral()
    maven {
        url 'https://repo.spring.io/libs-snapshot'
    }
}


dependencies {
	compile('org.springframework.boot:spring-boot-starter')
	compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3'

	testCompile('org.springframework.boot:spring-boot-starter-test')
}

DemoApplication.java

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

	@Bean
	public CommandLineRunner run() {
		return (args) -> {
		    throw new Exception("test");
		};
	}
}

Console

2018-03-13 11:03:05.166  INFO 22690 --- [           main] com.example.demo.DemoApplication         : No active profile set, falling back to default profiles: default
2018-03-13 11:03:05.267  INFO 22690 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@22f59fa: startup date [Tue Mar 13 11:03:05 CST 2018]; root of context hierarchy
2018-03-13 11:03:06.089  INFO 22690 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-03-13 11:03:06.103  INFO 22690 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 1.67 seconds (JVM running for 3.222)
Disconnected from the target VM, address: '127.0.0.1:63647', transport: 'socket'

Process finished with exit code 1

Metadata

Metadata

Assignees

Labels

for: external-projectFor an external project and not something we can fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions