question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not log exception when there is no environment.properties

See original GitHub issue

When we don’t have a environment.properties file, VRaptor latest version is logging:

WARN [http-bio-8080-exec-1] (DefaultEnvironment.java:103) - Could not find the file environment.properties to load.
java.lang.NullPointerException
    at java.util.Properties$LineReader.readLine(Properties.java:434)
    at java.util.Properties.load0(Properties.java:353)
    at java.util.Properties.load(Properties.java:341)
    at br.com.caelum.vraptor.environment.DefaultEnvironment.loadAndPut(DefaultEnvironment.java:100)
    at br.com.caelum.vraptor.environment.DefaultEnvironment.getProperties(DefaultEnvironment.java:82)
    at br.com.caelum.vraptor.environment.DefaultEnvironment.has(DefaultEnvironment.java:168)
    at br.com.caelum.vraptor.environment.DefaultEnvironment.get(DefaultEnvironment.java:173)

We should only log the warn message and not the exception. This could led users to think that it’s a unexpected behaviour.

What do you think guys? @Turini @lucascs

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Turinicommented, Apr 5, 2018

está feito! em algumas horas o 4.2.1 já deve estar disponível no repositório do maven

0reactions
schirrelcommented, Apr 6, 2018

AEWWWWWWWWWWWWWWWWWWWWW brigadão 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring 3.1 @PropertySources does not throw Exception if ...
If the property is not found a java.lang.IllegalStateException is thrown. Share.
Read more >
26. Logging - Spring
Since logging is initialized before the ApplicationContext is created, it is not possible to control logging from @PropertySources in Spring @Configuration ...
Read more >
Do not print stack trace when environment variables access is ...
This issue is a security issue. When running log4j in a restricted environment where the calling application is not allowed to access environment...
Read more >
Logging Exceptions in Java - Loggly
A look at common approaches to exception handling and logging in Java. The examples use Log4j2, but the concepts apply to many modern ......
Read more >
Handle errors in ASP.NET Core Blazor apps - Microsoft Learn
Discover how ASP.NET Core Blazor manages unhandled exceptions and how to develop apps that detect and handle errors.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found