|
From: Leif M. <le...@ta...> - 2003-05-06 08:42:55
|
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 code
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 crash,
>then the service goes down.
>
>I have another java service that check if some services are alive. This
>service runs code below to check services status:
>
> private boolean ping(String p_host, String p_port)
> {
> int count = 0;
> int portInt = Integer.parseInt(p_port);
>
> m_log.log(m_sCabeceraLogs,"Pinging "+ p_port+ " ...");
>
> while (count < 10) {
> try {
> Socket s1 = 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 responding
>.. retrying");
> count++;
> }
> try {
> Thread.currentThread().sleep(1000);
> } catch (Exception e) {};
> }
>
> if (count == 10) {
> return false;
> }else
> {
> return true;
> }
> }
>
>This code works fine this other services, but with services that uses
>wrapper, sentence "Socket s1 = 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
>
>
>
|