struts_jdon_hibernate專案執行錯誤

yxh1122發表於2010-05-05
在配置struts_jdon_hibernate專案在jboss中執行時,出現錯誤,
在sample.service.UserServiceImp的getModels等訪問資料庫的方法時出現錯誤,除錯發現,執行到ThreadLocalSessionProvider類的
sess = getFactory().openSession();時,sess為空值,此時該類的_factory變數也為null,不知是不是hibernate配置的問題,詳細錯誤資訊如下:
11:01:12,343 INFO [STDOUT] 2010-05-05 11:01:12,343 [http-127.0.0.1-8080-1] DEBU
G com.jdon.aop.reflection.MethodInvokerUtil - [JdonFramework] method invoke: sam
ple.service.UserServiceImp method=getDepts
11:17:08,625 ERROR [STDERR] java.lang.NullPointerException
11:17:08,625 ERROR [STDERR] at com.jdon.persistence.hibernate.util.ThreadLocalSessionProvider.getSession(ThreadLocalSessionProvider.java
:58)
11:17:08,625 ERROR [STDERR] at com.jdon.persistence.hibernate.HibernateTemplate.doHibernate(HibernateTemplate.java:72)
11:17:08,625 ERROR [STDERR] at com.jdon.persistence.hibernate.HibernateTemplate.find(HibernateTemplate.java:450)
11:17:08,625 ERROR [STDERR] at com.jdon.persistence.hibernate.HibernateTemplate.find(HibernateTemplate.java:442)
11:17:08,625 ERROR [STDERR] at sample.dao.JdbcDaoImp.getDepts(JdbcDaoImp.java:58)
11:17:08,625 ERROR [STDERR] at sample.service.UserServiceImp.getDepts(UserServiceImp.java:123)
11:17:08,625 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:17:08,625 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
11:17:08,625 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
11:17:08,625 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.reflection.MethodInvokerUtil.execute(MethodInvokerUtil.java:54)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.reflection.ProxyMethodInvocation.methodInvoke(ProxyMethodInvocation.java:108)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:76)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.interceptor.SessionContextInterceptor.invoke(SessionContextInterceptor.java:76)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.interceptor.StatefulInterceptor.invoke(StatefulInterceptor.java:82)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.interceptor.PoolInterceptor.invoke(PoolInterceptor.java:91)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:58)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
11:17:08,625 ERROR [STDERR] at com.jdon.aop.AopClient.invoke(AopClient.java:95)
11:17:08,625 ERROR [STDERR] at com.jdon.bussinessproxy.dyncproxy.DynamicProxyWeaving.invoke(DynamicProxyWeaving.java:62)
11:17:08,625 ERROR [STDERR] at $Proxy157.getDepts(Unknown Source)
11:17:08,625 ERROR [STDERR] at sample.ps.DeptAction.execute(DeptAction.java:39)
11:17:08,625 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
11:17:08,625 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
11:17:08,625 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
11:17:08,640 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
11:17:08,640 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
11:17:08,640 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:17:08,640 ERROR [STDERR] at com.jdon.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:17:08,640 ERROR [STDERR] at com.jdon.persistence.hibernate.CloseSessionInViewFilter.doFilter(CloseSessionInViewFilter.java:43)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:17:08,640 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
11:17:08,640 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
11:17:08,640 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
11:17:08,640 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve
.java:126)
11:17:08,640 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.
java:70)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
11:17:08,640 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
11:17:08,640 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
11:17:08,640 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
11:17:08,640 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
11:17:08,640 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
11:17:08,640 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)

相關文章