急 hibernate 循环执行insert时出现 Io 异常: The Network Adapter could not establish the

问题描述

org.springframework.jdbc.UncategorizedSQLException:Hibernateoperation:Cannotopenconnection;uncategorizedSQLExceptionforSQL[???];SQLstate[null];errorcode[17002];Io异常:TheNetworkAdaptercouldnotestablishtheconnection;nestedexceptionisjava.sql.SQLException:Io异常:TheNetworkAdaptercouldnotestablishtheconnection

解决方案

解决方案二:
Eclipse中出现错误如下ERROR-JDBCExceptionReporter.logExceptions(101)|Io异常:TheNetworkAdaptercouldnotestablishtheconnectionERROR-JDBCExceptionReporter.logExceptions(101)|Io异常:TheNetworkAdaptercouldnotestablishtheconnectionERROR-AbstractFlushingEventListener.performExecutions(324)|Couldnotsynchronizedatabasestatewithsessionorg.hibernate.exception.GenericJDBCException:Cannotopenconnectionatorg.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)atorg.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)atorg.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)atorg.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)atorg.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:116)atorg.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)atorg.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2242)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2678)atorg.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)atorg.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)atorg.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)atorg.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)atorg.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)atorg.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)atorg.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)atorg.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)atorg.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:420)atorg.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)atorg.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:694)atcn.com.ztaxj.core.base.BaseDao.insert(BaseDao.java:32)atcn.com.ztaxj.core.base.BaseService.insert(BaseService.java:28)atcn.com.ztaxj.permission.action.User.uploadLdap(User.java:105)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(UnknownSource)atsun.reflect.DelegatingMethodAccessorImpl.invoke(UnknownSource)atjava.lang.reflect.Method.invoke(UnknownSource)atcom.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)atcom.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)atorg.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:314)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)atorg.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atorg.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atorg.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atorg.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:314)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atorg.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atorg.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atcom.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)atorg.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)atorg.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)atorg.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)atorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)atjava.lang.Thread.run(UnknownSource)Causedby:java.sql.SQLException:Io异常:TheNetworkAdaptercouldnotestablishtheconnectionatoracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)atoracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)atoracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)atoracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)atoracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
解决方案三:
有没有高手帮忙看下呀~~
解决方案四:
循环的代码贴下吧.大家一起研究下.不知道你是不是循环太多了,然后每次打开一个新连接没有释放,导致连接池不够用了
解决方案五:
最大的肯能是数据库连接开多了,达到上限
解决方案六:
具体看看出错的代码吧。3L、4L说的可能性比较大

时间: 2024-09-13 12:54:50

急 hibernate 循环执行insert时出现 Io 异常: The Network Adapter could not establish the的相关文章

连接数据库报错Io 异常: The Network Adapter could not establish the

问题描述 一个纠结好久的问题,小女对JAVA实在是门外汉,只能求教诸位高人了...起因是负责运营的系统平时连接都很正常,但是到业务高峰期服务器经常发生瞬堵,检查后台日志,报错信息如下:解决方案二:<2011-4-2下午05时30分29秒CST><Info><JDBC><cnsz030356><ICSs-GCCSFServer1146><ExecuteThread:'23'forqueue:'weblogic.kernel.Default'&

Oracle 连接Io exception : The Network Adapter could not

具体错误 java.sql.SQLRecoverableException: Io 异常: The Network Adapter could not establish the connection  at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)  at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.j

如何避免远程循环执行SSH时,到第一条之后就退出

RT 今天遇到的小问题,记录下来. 据说关键是加  < /dev/null 我也是看网上别人说的,测试成功. #!/bin/bash while read line do echo $line ssh -l wls81 $line "cp -r /appsystems/ /appsystems.back/" < /dev/null done < "ip_address.txt"  

急,.net程序删除文件时总是提示异常

问题描述 我写的一个文件删除应用程序,部分代码如下:picName=dt.Rows[i][0].ToString();//从数据库中得到文件名.FileInfofi=newFileInfo(Server.MapPath(pathname+picName));//创建FileInfo对象if(fi.Exists)fi.Delete();//如果文件存在就删除它!!运行后,总是报错,异常说是拒绝访问:ServerErrorin'/'Application.----------------------

JDBC连接Oracle数据库出现Io 异常

环境:Oracle11g + MyEclipse 6.5 + JDK1.6 问题:JDBC连接Oracle数据库出现以下错误: java.sql.SQLRecoverableException: Io 异常: The Network Adapter could not establish the connection at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101) at oracle.

连接oracle抛异常 o-java 连接 oracle数据库 抛 Io 异常 ... 求解啊!!

问题描述 java 连接 oracle数据库 抛 Io 异常 ... 求解啊!! import java.sql.*; public class TestJDBC { public static void main(String[] args) throws Exception{ Class.forName("oracle.jdbc.driver.OracleDriver"); //new oracle.jdbc.driver.OracleDriver(); Connection co

hibernate 循环遍历 list对象,只保存最后一条数据,偶现

问题描述 hibernate 循环遍历 list对象,只保存最后一条数据,偶现 @Transactional(readOnly = false, propagation = Propagation.REQUIRED) public String rankScoreIn(MultipartFile file, String classid, String testname, String grad, String subject) { StringBuilder failureMsg = new

c#-C#仿QQ聊天的代码。在打开聊天窗口并输入聊天内容执行发送时,程序报错

问题描述 C#仿QQ聊天的代码.在打开聊天窗口并输入聊天内容执行发送时,程序报错 这是一段仿QQ聊天的代码.在打开聊天窗口并输入聊天内容执行发送时,程序报错: 参数化查询 '(@FromUserId int,@ToUserId int,@Message nvarchar(1),@MessageType' 需要参数 '@MessageState',但未提供该参数. 错误详细信息为: 未处理 System.Data.SqlClient.SqlException Message="参数化查询 '(@F

css3实现循环执行动画,且动画每次都有延迟

一.最终效果   需求:gift图片的小动画每隔2s执行一次. 需求就一句话,我们看一下实现过程. 二.实现过程 1.网页结构 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> a { display: inline-block; backgro