opened
bluegaspode
username_0
at io.undertow.servlet.spec.ServletContextImpl.getInitParameter(ServletContextImpl.java:421)
	at net.bull.javamelody.internal.common.Parameters.getParameterValueByName(Parameters.java:466)
	at net.bull.javamelody.internal.common.Parameters.getParameterValue(Parameters.java:455)
	at net.bull.javamelody.Parameter.getValue(Parameter.java:409)
	at net.bull.javamelody.Parameter.getValueAsBoolean(Parameter.java:416)
	at net.bull.javamelody.internal.common.Parameters.isNoDatabase(Parameters.java:323)
	at net.bull.javamelody.SpringDataSourceBeanPostProcessor.postProcessAfterInitialization(SpringDataSourceBeanPostProcessor.java:95)

This is caused, because upon restart the Parameters class still has a reference to an old ServletContext (the one from the initial App Start), which is not valid anymore.

I simple fix resolves the issue: 
in 
`net.bull.javamelody.SessionListener.contextDestroyed(...)`
you should add
`Parameters.initialize((ServletContext)` null);
right after stopping the JDBCWrapper. 

Parameters does check the servletContext for null, so if called when there is no ServletContext works fine. Once the SessionListener gets a new ServletContext after the Application restart, Parameters is initialized again with a working ServletContext.
NPE after SpringBoot hot restart
issue
created
evernat
username_1
I do not reproduce the same issue.
What do you mean by hot restart? spring-boot-devtools?
What is your spring-boot version and javamelody version?
Can you give the full stack-trace of the NPE?
Can you give the source of a simple project to reproduce the issue?
comment
created
evernat
username_1
sorry, I reproduce the issue using spring-boot-devtools.
comment
closed
evernat
username_1
issue
created
evernat
username_1
fixed by 3fc04da and ready for the next release (1.80)
comment
created
bluegaspode
username_0
Hi @username_1 
cool this was fast. I was just creating a sample project but seems this is not needed anymore.

Yes - spring-boot-devtools is involved, I used javamelody in a jhipster.tech based project.

Cheers
Stefan
comment