You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jan Šílený <ja...@gmail.com> on 2013/02/25 18:38:12 UTC

commons daemon weird behaviour

Dear mailing list,
I have run into a strange behavior while using procrun to wrap my java
application as a Windows service. This issue is linked to DatagramSocket,
which is created and bound to local port inside the "service". So, what is
going on: If I run the application as a service, the DatagramSocket stops
receiving any datagrams after lets say five minutes of proper work. On the
other hand, if I run my jar simply as a java application (via java -jar
xxx.jar) everything works fine whole time without this issue. I have used
tcpdump on the router which is source of these datagrams and the network
traffic is correct, what more, I also used jpcap to see if these packets
arrive on the local port and yes, they arrive. Next strange thing is, that
if I send some datagram out trough this socket, it starts to work again,
but only for lets say next five minutes, after this time, situation repeats
and nothing else gets received from this time on, even though I see data
arrived in the network dumps. There is probably everything fine in my code,
I am trying to solve this for several days, so I have triple checked
everything in my code.
Important configurations of my service, machine and software versions are
as follows:
commons-daemon-1.0.13,
OS Windows XP, firewall off.
default JVM, which version is 1.7.0_13-b20
memory pools and thread stack size are not set up - left blank,
startup and shutdown mode are set to jvm.
Well, I dont know if I described my problem in a good way, so if you need
some other info about my configuration or even some test case, let me know,
I can probably prepare it. I hope it will be some simple problem.

Have a nice day and thanks for your time,
Jan

Re: commons daemon weird behaviour

Posted by Mladen Turk <mt...@apache.org>.
On 02/25/2013 06:38 PM, Jan Šílený wrote:
> Dear mailing list,
> I have run into a strange behavior while using procrun to wrap my java
> application as a Windows service. This issue is linked to DatagramSocket,
> which is created and bound to local port inside the "service". So, what is
> going on: If I run the application as a service, the DatagramSocket stops
> receiving any datagrams after lets say five minutes of proper work. On the
> other hand, if I run my jar simply as a java application (via java -jar
> xxx.jar) everything works fine whole time without this issue.

First thing I would try is to run the service with the same
user account used when running from console. Running under LOCAL_SERVICE
account might introduce some different network settings.

Regards
-- 
^TM

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[daemon] Re: commons daemon weird behaviour

Posted by Adam <ad...@fanello.net>.
That certainly sounds strange. All I can offer is that I send and receive on a 
MulticastSocket (inherits from DatagramSocket), and it works for me in the same 
environment.

- Adam

Jan Šílený spoke on 02/25/2013 09:38 AM thusly:
> Dear mailing list,
> I have run into a strange behavior while using procrun to wrap my java
> application as a Windows service. This issue is linked to DatagramSocket,
> which is created and bound to local port inside the "service". So, what is
> going on: If I run the application as a service, the DatagramSocket stops
> receiving any datagrams after lets say five minutes of proper work. On the
> other hand, if I run my jar simply as a java application (via java -jar
> xxx.jar) everything works fine whole time without this issue. I have used
> tcpdump on the router which is source of these datagrams and the network
> traffic is correct, what more, I also used jpcap to see if these packets
> arrive on the local port and yes, they arrive. Next strange thing is, that
> if I send some datagram out trough this socket, it starts to work again,
> but only for lets say next five minutes, after this time, situation repeats
> and nothing else gets received from this time on, even though I see data
> arrived in the network dumps. There is probably everything fine in my code,
> I am trying to solve this for several days, so I have triple checked
> everything in my code.
> Important configurations of my service, machine and software versions are
> as follows:
> commons-daemon-1.0.13,
> OS Windows XP, firewall off.
> default JVM, which version is 1.7.0_13-b20
> memory pools and thread stack size are not set up - left blank,
> startup and shutdown mode are set to jvm.
> Well, I dont know if I described my problem in a good way, so if you need
> some other info about my configuration or even some test case, let me know,
> I can probably prepare it. I hope it will be some simple problem.
>
> Have a nice day and thanks for your time,
> Jan
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org