4

我是新来的河马,在河马 cms 网站上工作。我正在使用 spring 和 hibernate 创建一个注册页面。

首先,我使用 spring 和 hibernate 框架在 eclipse 中实现了这个注册示例。

然后我尝试将其集成到 Hippo CMS SITE 项目中,我做了与 eclipse 中的工作相同的所有配置。

在 hippo cms 中执行时,出现了很多异常。

[INFO] [talledLocalContainer] 17.07.2013 10:26:08 WARN  [org.hibernate.cfg.Configuration.getConfigurationInputStream():1135] /hibernate.cfg.xml not found
[INFO] [talledLocalContainer] 17.07.2013 10:26:08 WARN  [org.hippoecm.hst.container.HstFilter.doFilter():523] Fatal error encountered while processing request '/site/addUser':
[INFO] [talledLocalContainer] org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.HibernateException: /hibernate.cfg.xml not found
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:681)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:585)
[INFO] [talledLocalContainer]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
[INFO] [talledLocalContainer]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
[INFO] [talledLocalContainer]   at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
[INFO] [talledLocalContainer]   at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
[INFO] [talledLocalContainer]   at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
[INFO] [talledLocalContainer]   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
[INFO] [talledLocalContainer]   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[INFO] [talledLocalContainer]   at org.hippoecm.hst.container.HstFilter.doFilter(HstFilter.java:335)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[INFO] [talledLocalContainer]   at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
[INFO] [talledLocalContainer]   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[INFO] [talledLocalContainer]   at org.hippoecm.hst.container.XSSUrlFilter.doFilter(XSSUrlFilter.java:49)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
[INFO] [talledLocalContainer]   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
[INFO] [talledLocalContainer]   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[INFO] [talledLocalContainer]   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[INFO] [talledLocalContainer]   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
[INFO] [talledLocalContainer]   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
[INFO] [talledLocalContainer]   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
[INFO] [talledLocalContainer]   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
[INFO] [talledLocalContainer]   at java.lang.Thread.run(Thread.java:662)
[INFO] [talledLocalContainer] Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
[INFO] [talledLocalContainer]   at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1136)
[INFO] [talledLocalContainer]   at org.hibernate.cfg.Configuration.configure(Configuration.java:1160)
[INFO] [talledLocalContainer]   at org.hibernate.cfg.Configuration.configure(Configuration.java:1147)
[INFO] [talledLocalContainer]   at org.vnp.common.controller.LoginController.addUser(LoginController.java:145)
[INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[INFO] [talledLocalContainer]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO] [talledLocalContainer]   at java.lang.reflect.Method.invoke(Method.java:597)
[INFO] [talledLocalContainer]   at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
[INFO] [talledLocalContainer]   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669)
[INFO] [talledLocalContainer]   ... 55 more
4

1 回答 1

3

根据堆栈跟踪,很明显,在类路径中找不到 hibernate.cfg.xml。这通常是由于不包括包含它的罐子/战争。

于 2013-07-17T05:22:32.950 回答