Author Topic: App crash and restart  (Read 134110 times)

ushacomm

  • Customer
  • Newbie
  • *
  • Posts: 34
    • View Profile
App crash and restart
« on: July 17, 2012, 03:51:43 AM »
During testing there was an incident of Java App (INTF) crash in AIX (we are still investigating what led to this event). After the crash, the browser was showing this error:

********************************************
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: java.rmi.ConnectException: Connection refused to host: 10.2.88.96; nested exception is:
   java.net.ConnectException: A remote host refused an attempted connect operation.
   com.creamtec.ajaxswing.ServletHelper.processHttpRequest(ServletHelper.java:280)
   com.creamtec.ajaxswing.AjaxSwingRouter.doPost(AjaxSwingRouter.java:141)
   com.creamtec.ajaxswing.AjaxSwingRouter.doGet(AjaxSwingRouter.java:120)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   com.creamtec.ajaxswing.AjaxSwingRouter.service(AjaxSwingRouter.java:106)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.rmi.ConnectException: Connection refused to host: 10.2.88.96; nested exception is:
   java.net.ConnectException: A remote host refused an attempted connect operation.
   sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
   sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:210)
   sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:196)
   sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
   com.creamtec.ajaxswing.ClientAgentImpl_Stub.getUserLocale(Unknown Source)
   com.creamtec.ajaxswing.ServletHelper.handleRequestException(ServletHelper.java:330)
   com.creamtec.ajaxswing.ServletHelper.processHttpRequest(ServletHelper.java:277)
   com.creamtec.ajaxswing.AjaxSwingRouter.doPost(AjaxSwingRouter.java:141)
   com.creamtec.ajaxswing.AjaxSwingRouter.doGet(AjaxSwingRouter.java:120)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   com.creamtec.ajaxswing.AjaxSwingRouter.service(AjaxSwingRouter.java:106)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.net.ConnectException: A remote host refused an attempted connect operation.
   java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:383)
   java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:245)
   java.net.PlainSocketImpl.connect(PlainSocketImpl.java:232)
   java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377)
   java.net.Socket.connect(Socket.java:539)
   java.net.Socket.connect(Socket.java:488)
   java.net.Socket.<init>(Socket.java:385)
   java.net.Socket.<init>(Socket.java:199)
   sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:34)
   sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:140)
   sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:607)
   sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:210)
   sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:196)
   sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
   com.creamtec.ajaxswing.ClientAgentImpl_Stub.getUserLocale(Unknown Source)
   com.creamtec.ajaxswing.ServletHelper.handleRequestException(ServletHelper.java:330)
   com.creamtec.ajaxswing.ServletHelper.processHttpRequest(ServletHelper.java:277)
   com.creamtec.ajaxswing.AjaxSwingRouter.doPost(AjaxSwingRouter.java:141)
   com.creamtec.ajaxswing.AjaxSwingRouter.doGet(AjaxSwingRouter.java:120)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   com.creamtec.ajaxswing.AjaxSwingRouter.service(AjaxSwingRouter.java:106)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.35 logs.
********************************************

Other applications continue to work fine. My question is: Is there a way to restart the app without restarting Tomcat. A web server restart will immediately kill many active sessions in all client terminals, a situation we need to avoid.

Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
Re: App crash and restart
« Reply #1 on: July 17, 2012, 06:40:18 AM »
Currently there's no way to restart the session, but user that is getting ConnectionException can close his browser, open it again and he'll get new session.

ConnectException by itself doesn't mean anything, this exception happens in AjaxSwing servlet when it's not able to connect to JVM that is running the application, the questions in this case is why it's not able to connect. You can search over the forum as there were many cases already discussed here. Most of the time it means that JVM with your application crashed, due to out of PermGen memory, JNI calls or something else.

Check your application folder for hs_***_pid file - it's log that JVM created upon crash, also check is there are any clues in JVM (intf_***.out) log files, it should be in the end of that log.

ushacomm

  • Customer
  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: App crash and restart
« Reply #2 on: July 25, 2012, 01:43:58 AM »
We are discussing the crash reason in a separate thread.
But once the crash has happened, there's no way to restart the INTF application without a web server restart. We had set a long session timeout in INTF conf. Is that the reason? There should be a way to easily recover from a app crash, and web server restart may not be the right choice.

Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
Re: App crash and restart
« Reply #3 on: July 25, 2012, 11:55:14 AM »
When user opens INTF in his browser he gets a session with INTF instance assigned, if assigned INTF instance crashes this session can not be recovered. Web server restart is not required in this case, but user will be required to restart his browser to get new session assigned.