应用和sqlserver同一服务器访问没问题。应用和sqlserver在不同服务器,时常出现下面错误。有没有人遇到同样的问题?
2018-05-10 14:18:39,720 - com.mchange.v2.c3p0.impl.NewPooledConnection@13fc437 handling a throwable.
com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1352)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1339)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1654)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:3694)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:5022)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:773)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:676)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:611)
at com.mchange.v2.c3p0.impl.NewProxyStatement.executeQuery(NewProxyStatement.java:35)
at com.exp.dao.jdbcutil.EXPStatement.executeQuery(EXPStatement.java:390)
at com.exp.dao.DBCommandDefaultHandler.executeSQL(DBConnectionDefaultImp.java:742)
at com.exp.dao.DBCommandDefaultHandler.executeQuery(DBConnectionDefaultImp.java:802)
at com.exp.dao.DBCommandDefaultHandler.executeQuery(DBConnectionDefaultImp.java:815)
at com.exp.dao.ormapping.BizDataAdapter.getVO(BizDataAdapter.java:421)
at com.jstrd.base.base_user.logic.Base_userLogic.select4Login(Base_userLogic.java:210)
at com.jstrd.base.security.BaseLoginModule.login(BaseLoginModule.java:36)
at com.exp.web.support.LoginContext.login(LoginContext.java:129)
at com.exp.web.support.LoginListenerSupport.doLogin(LoginListenerSupport.java:67)
at com.jstrd.base.security.BaseLoginListener.doLogin(BaseLoginListener.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:162)
at com.exp.fcl.reflect.ReflectSupport.invokeMethod(ReflectSupport.java:138)
at com.exp.web.util.DefaultEventDispatcher.invokeEvent(DefaultEventDispatcher.java:85)
at com.exp.web.util.DefaultEventDispatcher.doEvent(DefaultEventDispatcher.java:61)
at com.exp.web.util.DefaultEventDispatcher.dispatchEvent(DefaultEventDispatcher.java:44)
at com.exp.web.util.BasePage.pageProc(BasePage.java:137)
at org.apache.jsp.framework.login_jsp._jspService(login_jsp.java:173)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595
不是一直有这个错,同一个功能,大部分时间没问题,有时就会报上面的错误,怎么回事。
数据源配置:
<Default ref = "" type="mssql" factory="c3p0" >
<property name="driver">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="url"><![CDATA[jdbc:sqlserver://101.251.68.164:1433;database=JET_DB;user=sa;password=021jet.com]]></property>
<property name="maxwait">5000</property>
<property name="maxactive">100</property>
</Default>
环境:
数据库服务器:Windows Server 2008 R2
数据库版本:sqlserver 2008 R2