0

I manage my Components via the SpringBridgeHstComponent. If a Bean can not be initialized I don't see any errors in the log or console. Only the SpringBridgeHstComponent throws an Exception that the delegated bean couldn t be found.

Component exception caught: org.hippoecm.hst.core.component.HstComponentException: 
Cannot find delegated spring HstComponent bean from the web application context: 
MyBeanName at org.hippoecm.hst.component.support.spring.SpringBridgeHstComponent
.getDelegatedBean(SpringBridgeHstComponent.java:199)

But for finding out why the bean couldn t be initialized I would expect the typical "could not be loaded cause autowired bean is null" or sth.

Does anybody know how to configure the logging for Spring in hippocms?

cloudnaut
  • 982
  • 3
  • 13
  • 35

2 Answers2

0

Just change /add logging entry for spring in log4j.xml:

<logger name="org.springframework"><level value="debug"/></logger>

You can find log4j files in your project root/conf directory e.g., for local development:

conf/log4j-dev.xml
grunfy
  • 161
  • 1
  • 2
  • Hi, I already did that. Unfortunately there s no error level message which complains about failures in bean initializations. – cloudnaut Sep 17 '15 at 14:10
0

SpringBridgeHstComponent invokes WebApplicationContextUtils.getWebApplicationContext(ServletContext) to get ApplicationContext instance and invoke ApplicationContext#getBean(String) to retrieve the bean afterward. If there's no error in spring framework side, then the first invocation might have returned null. In that case, you may need to expose WebApplicationContext. See the following:

woonsan
  • 61
  • 3