|
From: <San...@DM...> - 2003-05-06 17:18:57
|
I have test code below with the default test application and works fine= . Then I think there is something wrong in my code. Now I know that there is possible pinging a service. Thanks a lot. Santiago Mart=EDn Pascual Email: san...@dm.... Tel=E9fono: 91 567 94 00. Fax: 91 567 94 01. DMR Consulting. Paseo de la Castellana, 141 Edificio Cuzco IV, planta 9. 28046 Madrid. Espa=F1a. http://www.spain.dmr.com = = =20 Leif Mortenson = = =20 <le...@ta...> To: wr= app...@li... = =20 Sent by: cc: = = =20 wra...@li... Subject: Re= : [Wrapper-user] Checking if service is alive = =20 ceforge.net = = =20 = = =20 = = =20 06/05/2003 10:42 = = =20 Please respond to = = =20 wrapper-user = = =20 = = =20 = = =20 There is nothing specific to the Wrapper that should be causing any problems with the creation of sockets. Can you answer a few questions?= 1) What platform / version of java are using? 2) What version of the Wrapper? 3) What is the exception you are getting? (full stack trace) Your cod= e does not display the stack trace. I would modify it to look for one or= more specific exception rather than any exception as that code will mask unrelated problems such as NullPointerExceptions etc. If your p_host variable was null for example you would get a message: "not responding"= 4) Is the code below running in a JVM controlled by the Wrapper, or is the remote machine controlled by the JVM? The only socket related difference between running with and without the= Wrapper is the socket that is being allocated to communicate between the JVM and the Wrapper. It is configured using the wrapper.port property in the wrapper.conf file. Cheers, Leif San...@DM... wrote: >I have a service that launch a java app, sometimes this app could cras= h, >then the service goes down. > >I have another java service that check if some services are alive. Thi= s >service runs code below to check services status: > > private boolean ping(String p_host, String p_port) > { > int count =3D 0; > int portInt =3D Integer.parseInt(p_port); > > m_log.log(m_sCabeceraLogs,"Pinging "+ p_port+ " ..."); > > while (count < 10) { > try { > Socket s1 =3D new Socket(p_host, portInt); > s1.close(); > m_log.log(m_sCabeceraLogs,p_port+ " is running= !"); > break; > } catch (Exception e) { > m_log.log(m_sCabeceraLogs,p_port+ " not respon= ding >.. retrying"); > count++; > } > try { > Thread.currentThread().sleep(1000); > } catch (Exception e) {}; > } > > if (count =3D=3D 10) { > return false; > }else > { > return true; > } > } > >This code works fine this other services, but with services that uses >wrapper, sentence "Socket s1 =3D new Socket(p_host, portInt);" throws = a >exception. > >How can I tell wrapper that accepts this calls? > > > > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Wrapper-user mailing list >Wra...@li... >https://lists.sourceforge.net/lists/listinfo/wrapper-user > > > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Wrapper-user mailing list Wra...@li... https://lists.sourceforge.net/lists/listinfo/wrapper-user = |