我通过SpringBridgeHstComponent管理我的组件。如果Bean无法初始化,我在日志或控制台中看不到任何错误。只有SpringBridgeHstComponent会抛出无法找到委托bean的异常。
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)但是为了找出bean不能被初始化的原因,我希望看到典型的“由于自动连接的bean为空而无法加载”或sth。
有谁知道如何在hippocms中配置Spring的日志记录吗?
发布于 2015-09-17 22:08:34
只需在log4j.xml中更改spring的/add日志记录条目:
<logger name="org.springframework"><level value="debug"/></logger>您可以在项目根目录/conf目录中找到log4j文件,例如,用于本地开发:
conf/log4j-dev.xml发布于 2015-09-17 22:24:59
SpringBridgeHstComponent调用WebApplicationContextUtils.getWebApplicationContext(ServletContext)来获取ApplicationContext实例,然后调用ApplicationContext#getBean(String)来检索bean。如果在spring框架端没有错误,那么第一次调用可能会返回null。在这种情况下,您可能需要公开WebApplicationContext。请参阅以下内容:
https://stackoverflow.com/questions/32613052
复制相似问题