-
Notifications
You must be signed in to change notification settings - Fork 40.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spring.mvc.log-resolved-exception
gets enabled by default.
#29706
Comments
Thanks for the report. I haven't been able to reproduce the resolver handler logging by default with a trivial sample using the code snippets you've provided. It's possible there is other configuration in your application that isn't shown here. If you would like us to spend more time investigating, please provide a complete minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it and attaching it to this issue. |
Hi. My entire configuration is composed by the following 3 files:
spring:
liquibase.change-log: db/changelog/db.changelog-master.xml
jpa:
open-in-view: false
data.web.pageable:
one-indexed-parameters: true
max-page-size: 500
jackson.default-property-inclusion: non_null
server:
shutdown: graceful
servlet:
jsp.registered: false
context-path: /p-b
spring.datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:pb-db;DB_CLOSE_ON_EXIT=FALSE
spring.jndi.ignore=true Also, I'm not setting anything programmatically apart /**
* @author Cosimo Damiano Prete
* @since 31/01/2022
*/
@Configuration
@EnableTransactionManagement
@EnableJpaAuditing(
auditorAwareRef = PersistenceConfig.AUDITOR_AWARE_BEAN_NAME,
dateTimeProviderRef = PersistenceConfig.DATE_TIME_PROVIDER_BEAN_NAME
)
public class PersistenceConfig {
static final String AUDITOR_AWARE_BEAN_NAME = "auditorAware";
static final String DATE_TIME_PROVIDER_BEAN_NAME = "dateTimeProvider";
@Bean(name = AUDITOR_AWARE_BEAN_NAME)
AuditorAware<String> auditorAware() {
return () -> Optional.of("tbd");
}
@Bean(name = DATE_TIME_PROVIDER_BEAN_NAME)
DateTimeProvider dateTimeProvider() {
return () -> Optional.of(OffsetDateTime.now(Clock.systemUTC()));
}
} and my main class is just @SpringBootApplication
public class PBApplication {
public static void main(String[] args) {
SpringApplication.run(PBApplication.class, args);
}
} |
@cdprete I still l can't reproduce the issue with the information provided. There are additional libraries in your application and possibly other code that isn't shown, and it's not a good use of our time to try to re-create everything you are doing. As requested, please provide a sample demonstrating the problem that we can compile and run ourselves. |
Hi @wilkinsona. That said, I think this should properly be documented ;) |
There's already a section in the reference docs about DevTools' property defaults, including a link to the class to which I linked above. #29406 is tracking inlining the default properties in the documentation in place of the link to |
HI. |
Thanks for the access to the repository. Unfortunately, it doesn't reproduce the behaviour that you have described. With the dependency on DevTools in place, I can see that If you'd like us to spend any more time on this, we'll need a sample that reproduces the problem that you have described. It should also be as minimal as possible to reproduce your specific problem. It took me some time to get your sample to run as I had to, for example, update the DB configuration. I'm afraid I won't have time to look at such an unnecessarily complex sample next time. |
Hi. |
Yes. I removed it from the pom.xml, double-checked that my IDE had updated the classpath to remove the dependency, and then ran the application again. |
That's very strange... For what concern the DB, the warning is
but it happens only with the devtools enabled. |
DevTools automatically shuts down the database on each restart (close of the context) to ensure that it can then be recreated and any |
In my "example", I was able to narrow down the issue further.
|
If you can provide a minimal sample that reproduces that behaviour, we can take another look. It should be something that's as small as possible to reproduce the problem and include a test or some simple instructions that show how to do so. |
Thanks for the minimal sample. Unlike in your original description, the exception is being logged by
See #14936 for some additional details. You may want to add an |
Oh, that's true. The handler is different. Thanks for the feedbacks ;) |
Hi.
I'm using Spring Boot 2.6.3 and from the moment I've defined a
ResponseEntityExceptionHandler
I get an annoying warning log in the console of the typeWARN 7072 --- [nio-8080-exec-2] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [<fully-qualified-class-name>: <message>]
.The handler is the following:
By putting a breakpoint in the setter of
WebMvcProperties
I can see it actually gets called with the valuetrue
even though I don't have such value set at all in myapplication.yml
file.Strangely enough, if I explicitly set it to
false
then it stays like that (probably my props are applied later).The issue doesn't seem to be caused by the
ResponseEntityExceptionHandler
, since I get the same also when the handler is defined asI've also tried adding an
@Order
annotation with highest priority (so that it would trigger my advice first), but it didn't help.The text was updated successfully, but these errors were encountered: