应用部署后不定时报Closed connection closed by,请教什么原因

P2V常见问题_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
P2V常见问题
上传于|0|0|文档简介
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩27页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢?您当前的位置: >
[FMS]NetConnection返回的错误提示介绍
时间: 15:12来源:</  极酷网页播放器
[FMS]NetConnection返回的错误提示介绍,as3与fms,NetConnection类
netconnection.connect的几种错误。
有以下这几种返回:
1、netconnection.call.failed error
netconnection.call() 调用服务器端方法失败。返回的info对象包含一个具体的调用失败说明。for in一下可以看到。
2、netconnection.connect.appshutdown error
服务器端应用程序因为一些原因被关闭(过度占用server端资源),或者服务器已经被关闭。
3、netconnection.connect.closed status
连接中断。
4、netconnection.connect.failed error
连接失败。如fms 没有启动。
5、netconnection.connect.invalidapp error
targeturi中rtmp://[ip或domain]/[appname]
其中appname不存在。
6、netconnection.connect.rejected error
连接被拒绝 原因:
targeturi指定的application不充许client连接,或者传递给应用程序的参数不对,也可能是server应用程序直接拒绝连接(可以在appname文件夹中写一个asc文件做到)
这时,info对象有一个application属性,包含服务器方法application.rejectconnection()的返回值。
client在被拒绝后会马上再收到一个netconnection.connect.closed的信息。
7、netconnection.connect.success status
连接成功。
当返回是netconnection.connect.fail时,可以从下面几个方面思考原因:
are you connecting to the correct server?
is the server running?
are you specifying the protocol (rtmp:) for connecting to the server?
if you are connecting from behind a firewall, are you specifying the correct protocol (rtmpt:)?
to connect to the server can also fail if the permissible number of
socket connectionson either the client or the server computer is at its
limit. this limit is ependent on how much physical memory your server
has, and how busy the connections are. on windows systems,the memory for
socket connections is allocated out of the non-paged memory, so it
cannot beswapped out to a page file. you may see that you reach the
maximum limit at different valuesfrom time to time as other running
programs (such as core operating-system services) arecompeting with your
program for space in the non-paged memory pool.
交流QQ群:nginx不能在响应头部添加Keep-Alive,详见:
http1.1中默认的keep-alive为connection(使用持久化连接),在http1.0中则默认为close,在大并发量的情况下可能需要将客户端的连接close掉,以保障服务器的正常运转。(因为每一台服务器它所能建立的最大连接数是有上限的,lnux下ulimit n xxx)
以腾讯首页为例,就有很多是请求是在客户端发生请求后,服务器响应完就立即关闭了。
nginx不像apache,直接有指令keep-alive off/它使用的是keepalive_timeout [time],默认的时长为75,可以在http、server、location使用此指令。
在本机进行的模拟测试:
nginx.conf指定的VHOST中添加了规则:
location /gtj/ {
&#160;&#160;&#160; alias C:/phpApp/gtj/;
&#160;&#160;&#160; keepalive_timeout&#160; 0;
&#160;&#160;&#160; expires 5m;
客户端请求后,可以用httpwatch抓取返回的头部信息:
阅读(...) 评论()项目使用hibernate 2.0,spring 1.2.8,struts问题在于连接很快就被占满,怀疑PSRING没有管理连接,仔细查看LOG发现,会有些warn提示unclosed session.在网上查了些资料,资料显示若在DAO中使用getHibernateTemplate().*时,spring会自动管理session(包括connection),而强制使用getSession()时时spring是不管理session的。而项目中大量使用这种代码,如下: Session session = this.getSession(); // 拼装hql String queryStr = "from DyDutyGroup dyDutyGroup where dyDutyGroup.isChange="
+ Constants.GROUP_IS_NOT_CHANGE
+ " AND PID IS NOT NULL and pid in "
+ "(select dyUser.dutyGroupId from DyUser dyUser where dyUser.userId = '"
+ userId + "'" + "and dyUser.isManager = 1" + ")"; Query query = session.createQuery(queryStr); // 当前页通过每页数*当前页数取得要取记录的行数 query.setFirstResult(pageSize.intValue() * curPage.intValue()); // 取pageSize条 query.setMaxResults(pageSize.intValue()); java.util.List result = query.list();其中这行Session session = this.getSession();正如资料显示,spring是不进行session管理的。资料显示需要手动关闭。finally {this.closeSessionIfNecessary(session);}这时,我做了试验,在使用getSession()方法中添加closeSessionIfNecessary(session)关闭session方法。有此方法会关闭,而有些又是报错,提示session is colsed。郁闷至极。
项目中在web.xml中配置OpenSessionInViewFilter。而applicationContext的加载方式我使用的是struts的plugin方式配置ServiceLocator,通过ServiceLocator.getInstance().getBean()方式取得bean.这里就有问题了,OpenSessionInViewFilter是setAttribute()一个context,而我并没有使用spring的Action的支持获取Context,而是通过ServiceLocator中的factory = new ClassPathXmlApplicationContext(fn);方式加载context,这时OpenSessionInViewFilter会管理session吗?也就是说OpenSessionInViewFilter会生效吗?我的lazy暂时是fasle。我的疑惑在,如果我调用getSession(),spring是否真的不会管理session,是否需要手动关闭。若真需要手动关闭,那问题就有了,我显示的使用this.closeSessionIfNecessary(session);关才SESSION,为什么提示session is closed,是spring container在管理session吗?具体spring事务配置如下: &bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&
&property name="driverClassName"&
&value&${hibernate.connection.driver_class}&/value&
&/property&
&property name="url"&
&value&${hibernate.connection.url}&/value&
&/property&
&property name="username"&
&value&${hibernate.connection.username}&/value&
&/property&
&property name="password"&
&value&${hibernate.connection.password}&/value&
&/property&
&/bean& &bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"&
&property name="hibernateProperties"&
&prop key="hibernate.dialect"&net.sf.hibernate.dialect.Oracle9Dialect&/prop&
&/property&
&property name="dataSource"&
&ref bean="dataSource"/&
&/property&
&property name="configLocation"&
&value&classpath:hibernate.duty.xml&/value&
&/property&
&bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"&
&property name="sessionFactory"&
&ref local="sessionFactory"/&
&/property&
&/bean& &bean id="dyDutyConfigRuleDao"
class="com.boco.eoms.subsystem.duty.dao.impl.DyDutyConfigRuleDaoImpl"&
&property name="sessionFactory"&
&ref bean="sessionFactory" /&
&/property& &/bean& &bean id="dyDutyConfigRuleBO"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"&
&property name="transactionManager"&
&ref bean="transactionManager" /&
&/property&
&property name="target"&
&ref local="dyDutyConfigRuleTarget" /&
&/property&
&property name="transactionAttributes"&
&prop key="addDyDutyDateConfigRule"&
PROPAGATION_REQUIRED,ISOLATION_DEFAULT,-Exception
&prop key="updateDyDutyDateConfigRule"&
PROPAGATION_REQUIRED,ISOLATION_DEFAULT,-Exception
&prop key="addDyDutyDateConfigRuleByPeriods"&
PROPAGATION_REQUIRED,ISOLATION_DEFAULT,-Exception
&prop key="updateDyDutyDateConfigRuleByPeriods"&
PROPAGATION_REQUIRED,ISOLATION_DEFAULT,-Exception
&/property& &/bean&有时还会出现这个问题,在一个人登陆后,退出重新登陆时,就会出现如下错误。00:42:22,302 ERROR JDBCExceptionReporter:38 - Cannot open connectionjava.sql.SQLException: ORA-01017: invalid username/ logon denied at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289) at oracle.jdbc.ttc7.O3log.receive1st(O3log.java:407) at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:259) at oracle.jdbc.driver.OracleConnection.&init&(OracleConnection.java:346) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:140) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:291)多谢。祝好~~~~~~~~~
直接调用getSession()肯定是不推荐的,可使用getHibernateTemplate().getSession,Spring的Session是一个thread-bound Session ,就是说它是和某个线程绑定的,而这个线程往往就是承载Servlet/Jsp的那个线程,实际意思就是其生命周期scope是request/response的。所以和Servlet的context无关。强制通过getSession()获得的Hibernate Session, 这个session可能是当前事务中之前打开的用过的那个Session,或者可能是一个新的,如果你需要必须是新的,那么通过你引用的那个HibernateTemplate中 的allowCreate为true!采取这个方案可以解决你connection关闭的错误。
谢谢banq,连接问题已解决。现在我觉得OpenSessionInViewFilter问题很多,我使用ServiceLocator方式加载,filter也不起作用。所以想问可lazy怎么解决。十分感谢。感谢banq
想激活lazy,目前我也只知道只能采取OpenSessionInView模式,而这个模式弊病很多,我以前帖子批判过。这个基本问题必须由他们作者亲自来解决,可以说是一个原罪。
最佳分辨率
OpenSource
Code & 2002-20进服务器一两秒被T出提示Server Closed Connection_squad吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0可签7级以上的吧50个
本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:4,311贴子:
进服务器一两秒被T出提示Server Closed Connection
进服务器一两秒被T出提示Server Closed Connection有没有遇到的,怎么解决啊
游戏特效培训,毕业年薪20w,来CGWANG吧!
我进他们服务器的群问他们说什么eac的问题
去owls3服没有这个问题
这问题是网络问题,有的运营商ban了eac,然而服务器有eac保护,所以进不去,owls3服没有eac,你可以尝试重新联网或者重启,不行就去3服
贴吧热议榜
使用签名档&&
保存至快速回贴}

我要回帖

更多关于 be closed to 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信