解決org.hibernate.exception.GenericJDBCException: Cannot open connection
使用SSH開發專案時發現多次從後臺取資料時就會報org.hibernate.exception.GenericJDBCException: Cannot open connection錯誤,解決辦法如下:在web.xml中配置配置OpenSessionInViewFilter,將如下程式碼加入到web.xml中
問題結決。
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<!-- singleSession預設為true,若設為false則等於沒用OpenSessionInView -->
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--Spring Context listener-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml</param-value>
</context-param>
問題結決。
相關文章
- org.hibernate.exception.JDBCConnectionException: Cannot open connection 解決辦法ExceptionJDBC
- 解決“su: cannot open session: Permission denied”Session
- Cannot get a connection, pool exhausted解決辦法
- FileZilla:425 Can't open data connection for transfer of解決辦法
- libcudart.so.8.0: cannot open shared object file解決方案DartObject
- 解決ImportError: libmysqlclient_r.so.16: cannot open shared object fileImportErrorIBMMySqlclientObject
- 解決java connectionJava
- 解決eclipse中egit中的cannot open git-upload-pack問題EclipseGit
- ERROR: UTL_SMTP.OPEN_CONNECTIONError
- ascp: Failed to open TCP connection for SSH, exiting. Session Stop (Error: Failed to open TCP connection for SSH)AITCPSessionError
- 解決 Cannot find OpenSSL's
- 解決GD32新建工程時提示:cannot open source input file “RTE_Components.h“
- xtrabackup: Error: cannot open /../../base/xtrabackup_checkpointsError
- virt-manager cannot open display問題
- inplace-abn 報錯解決: ImportError: libcudart.so.9.0: cannot open shared object file: No such file or dirImportErrorDartObject
- (轉)RAC srvctl 命令報 libpthread.so.0 cannot open shared object file解決辦法threadObject
- -bash: ulimit: open files: cannot modify limit: Operation not permittedMIT
- cannot allocate new log 的解決方法
- FTP Connection refused error 解決辦法FTPError
- 1 Million TCP Connection 問題解決TCP
- 解決Xmanager-AIX XDMCP Connection failedAI
- 解決cannot find module providing package或cannot find main modulePackageAI
- linux解決xhost: unable to open displayLinux
- linux解決xhost unable to open display‘’Linux
- Ubuntu Cannot allocate memory 錯誤解決方案Ubuntu
- Jquery DataTables解決 Cannot reinitialise DataTable 問題jQuery
- ImportError: cannot import name ‘imresize‘解決辦法ImportError
- 影片匯聚平臺EasyCVR啟動出現報錯“cannot open shared object file”的原因排查與解決VRObject
- conda環境下ImportError: libmkl_intel_lp64.so.1: cannot open shared object file問題解決ImportErrorIBMIntelObject
- 完美解決xhost +報錯: unable to open display
- 轉貼:xhost unable to open display解決方法
- Ubuntu 解決 Too many open files 問題Ubuntu
- rs.open與connection.execute(sql)的區別SQL
- RH5 安裝ORACLE 10G 出錯 1,libXp.so.6: cannot open 2,libXt.so.6: cannot openH5Oracle 10g
- 解決Cannot find module '@angular/compiler-cli'AngularCompile
- Cannot find SS.INI file for user *** 解決方法
- TypeError: Descriptors cannot not be created directly問題的解決Error
- 12C-ORA-65086: cannot open/close the pluggable databaseDatabase