java ssh项目数据库关闭

问题描述

java ssh项目数据库关闭
项目运行时,一段时间后报这个错误

net.sourceforge.jtds.jdbc.JtdsPreparedStatement.close(JtdsPreparedStatement.java:485)
at org.apache.commons.dbcp.DelegatingStatement.close(DelegatingStatement.java:168)
at org.apache.commons.dbcp.DelegatingConnection.passivate(DelegatingConnection.java:426)
at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnection.java:246)
at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnection.java:122)
at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(PoolableConnectionFactory.java:628)
at org.apache.commons.pool.impl.GenericObjectPool.invalidateObject(GenericObjectPool.java:1290)
at org.apache.commons.dbcp.AbandonedObjectPool.invalidateObject(AbandonedObjectPool.java:125)
at org.apache.commons.dbcp.AbandonedObjectPool.removeAbandoned(AbandonedObjectPool.java:158)
at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:77)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)
at org.hibernate.loader.Loader.doQuery(Loader.java:801)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3293)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
at com.googlecode.genericdao.dao.hibernate.HibernateBaseDAO._get(HibernateBaseDAO.java:332)
at com.googlecode.genericdao.dao.hibernate.GeneralDAOImpl.find(GeneralDAOImpl.java:39)
at com.centerSoft.soms.service.impl.BaseManagerImpl.commLoad(BaseManagerImpl.java:310)
at sun.reflect.GeneratedMethodAccessor261.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy40.commLoad(Unknown Source)
at com.centerSoft.soms.action.DataDicAction.getAllDatadic(DataDicAction.java:92)
at sun.reflect.GeneratedMethodAccessor2374.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
.
.
.
Caused by: java.net.SocketException: socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.DataInputStream.readFully(DataInputStream.java:195)
at java.io.DataInputStream.readFully(DataInputStream.java:169)
at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:846)
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:727)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:135)
at net.sourceforge.jtds.jdbc.ResponseStream.readString(ResponseStream.java:290)
at net.sourceforge.jtds.jdbc.ResponseStream.readNonUnicodeString(ResponseStream.java:274)
at net.sourceforge.jtds.jdbc.TdsData.readData(TdsData.java:936)
at net.sourceforge.jtds.jdbc.TdsCore.tdsRowToken(TdsCore.java:3007)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2270)

解决方案

可能是网络不稳定,防火墙或者什么程序干扰,要不然就是jtds驱动有问题。

解决方案二:

网络重置或者数据库地址就连不上

时间: 2025-01-20 21:10:50

java ssh项目数据库关闭的相关文章

Java中窗口关闭事件。

问题描述 Java中窗口关闭事件. 程序代码如下: package com.packageTemp; import java.awt.event.*; import javax.swing.*; import java.awt.*; public class MouseAdapterTest { JFrame f=null; JButton btn=null; public static void main(String[] args) { new MouseAdapterTest(); } /

关于java问题-java ssh框架中的问题

问题描述 java ssh框架中的问题 For这点过不去,all有值 解决方案 还是ssh框架下的问题呢!关于ssh框架乱码问题SSH框架常见问题 解决方案二: For里面的哪一行过不去? 解决方案三: 前面print(all)改为打印其长度size,看看all这个列表长度是否非零呢? 解决方案四: 直接try,,catch捕获,,看报的什么异常

服务器-java ssh 连 ftp的问题

问题描述 java ssh 连 ftp的问题 private Expect4j getExpect(){ try{ this.closeShell(); log.debug(String.format(""Start logging to %s@%s:%s"" userNameipport)); JSch jsch =new JSch(); session = jsch.getSession(userNameipport); session.setPassword(

java 输入输出流 关闭-关于Java输入输出流关闭的问题。。。

问题描述 关于Java输入输出流关闭的问题... 在学java时老师一直强调要用完流要关闭流,但有一个问题我一直没清楚,就是装饰流该怎么个关闭,通常我们是这样关闭的: ... FileWriter fw = new FileWriter(fileName); BufferedWriter bw = new BufferedWriter(fw); ... fw.close(); bw.close(); ... 但我感觉太累赘,既然fw被bw装饰了,bw关闭的同时是否fw也被关闭呢? 或者fw被关闭

ssh整合-JAVA SSH Struts 关于a标签调用Action含参数就异常反之正常

问题描述 JAVA SSH Struts 关于a标签调用Action含参数就异常反之正常 struts 异常 Action path SSH 异常信息 There is no Action mapped for namespace [/dd] and action name [laladList] associated with context path [/baee]. - [unknown location] at com.opensymphony.xwork2.DefaultActionP

流 close()-java 输入流的关闭问题

问题描述 java 输入流的关闭问题 如下代码,运行时报Stream closed错, 把bs.close();注释了正常,每次循环不能初始化流么? import java.io.*; public class Test{ public static void main(String[] args) { try{ while(true){ BufferedReader bs = new BufferedReader(new InputStreamReader(System.in)); Syste

java ssh架构载入图片

问题描述 java ssh架构载入图片 电子商务系统,添加商品之后图片载入不了,显示错误是 10:26:54,183 ERROR Dispatcher:38 - Could not find action or result /ebusiness/UploadImages/ There is no Action mapped for action name UploadImages/. - [unknown location] at com.opensymphony.xwork2.Default

图片-Java SSH整合框架.tomcat能正常跑,没问题.用junit测试却报配置错误.

问题描述 Java SSH整合框架.tomcat能正常跑,没问题.用junit测试却报配置错误. 配置如第一张图. 报错如下面两张. new ClassPathXmlApplicationContext("applicationContext.xml");junit初始化配置时出现的问题.最后导致beanFactory.containsBean("Sys_UserDao")为fasle 解决方案 不是已经说了没有引人hibernate属性文件啊, 解决方案二: 你的

java ssh通过action和直接运行的MD5之后的字符串不一样

问题描述 java ssh通过action和直接运行的MD5之后的字符串不一样 有这样试过转码new String(str.getBytes(), "utf-8"),但这句返回的字符串是乱码 解决方案 有可能是编码的问题. 解决方案二: 直接运行的那个,才是我想要的,正确的 解决方案三: 有在别的地方修改过这个静态变量了吗? 分别在调用MD5之前打印下字节信息,看是一样的吗?有可能Action请求模式下修改了编码方式,导致中文的getBytes获取的字节不同. byte[] b = s