caelum / vraptor4

A web MVC action-based framework, on top of CDI, for fast and maintainable Java development.
http://vraptor.org
Apache License 2.0
350 stars 333 forks source link

Do not log exception when there is no environment.properties #956

Closed nykolaslima closed 9 years ago

nykolaslima commented 9 years ago

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

Turini commented 9 years ago

+1 to keep the warn, removing the exception

lucascs commented 9 years ago

+1

On Sun, Mar 15, 2015 at 11:05 PM, Rodrigo Turini notifications@github.com wrote:

+1 to keep the warn, removing the exception

— Reply to this email directly or view it on GitHub https://github.com/caelum/vraptor4/issues/956#issuecomment-81347651.

schirrel commented 6 years ago

@Turini isso ja foi implementado? Esse log fica aparecendo em cada nova requisição. Estou usando o 4.2.0-Final no repositorio mvn

Turini commented 6 years ago

@CoderSquirrel foi sim, nesse PR: https://github.com/caelum/vraptor4/pull/1101 posso fazer um release de uma nova versão do vraptor pra entrar esse até o final de semana (;

Turini commented 6 years ago

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

schirrel commented 6 years ago

AEWWWWWWWWWWWWWWWWWWWWW brigadão ;)