I have a SpringMVC 3.0.5 app using Hibernate 3.6.1 and it's
AnnotationSessionFactoryBean and when I add <hprof:profiler /> I get
the following NPE.
[09-14 09:09:51] ERROR ContextLoader [Thread-2]: Context
initialization failed
java.lang.NullPointerException
at
hibernatingrhinos.hibernate.profiler.spring.ProfilerBeanFactoryPostProcessor.registerProperties(ProfilerBeanFactoryPostProcessor.java:
51)
at
hibernatingrhinos.hibernate.profiler.spring.ProfilerBeanFactoryPostProcessor.overrideHibernateSettings(ProfilerBeanFactoryPostProcessor.java:
44)
at
hibernatingrhinos.hibernate.profiler.spring.ProfilerBeanFactoryPostProcessor.postProcessBeanFactory(ProfilerBeanFactoryPostProcessor.java:
32)
at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:
663)
at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:
646)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
407)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:
276)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:
197)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:
47)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
4723)
at org.apache.catalina.core.StandardContext
$1.call(StandardContext.java:5226)
at org.apache.catalina.core.StandardContext
$1.call(StandardContext.java:5221)
at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I have tried the following:
<hprof:profiler host="localhost" init-on-startup="false" port="1234"
useSpy="false" />
Hoping that setting all properties would give a different error, but
to no avail. Side note: The documentation at
http://hibernateprofiler.com/learn
shows to use "address", but this is not a valid attribute of the
profiler element.
Our AnnotationSessionFactoryBean is set up as an abstract bean with
other bean definitions declaring it as a parent. I'm not sure if this
would make any difference. But I did try and put <hprof:profiler /> in
bean definitions which declare the AnnotationSessionFactoryBean as a
parent, but no difference.
I can provide more information as it is needed.
Regards