This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm trying to use SimpleSocketServet but keep getting the following messages: INFO [Thread-6] (SocketNode.java:86) - Caught java.io.EOFException closing conneciton. INFO [Thread-7] (SocketNode.java:88) - Caught java.net.SocketException closing conneciton.
If anybody managed to use SocketAppender, please help. Couldn't do it with Chainsaw either.
I'm getting errors when sending messages to the server. When I launch the server, here is what I've got: INFO [main] (SimpleSocketServer.java:59) - Listening on port 6000 INFO [main] (SimpleSocketServer.java:62) - Waiting to accept a new client.
Ok. But when I execute the client, the following errors are displayed : INFO [main] (SimpleSocketServer.java:64) - Connected to client at /127.0.0.1 INFO [main] (SimpleSocketServer.java:65) - Starting new socket node. INFO [main] (SimpleSocketServer.java:62) - Waiting to accept a new client. INFO [main] (SimpleSocketServer.java:64) - Connected to client at /127.0.0.1 INFO [Thread-0] (SocketNode.java:86) - Caught java.io.EOFException closing conn eciton. INFO [main] (SimpleSocketServer.java:65) - Starting new socket node. INFO [main] (SimpleSocketServer.java:62) - Waiting to accept a new client. INFO [Thread-1] (SocketNode.java:88) - Caught java.net.SocketException closing conneciton.
I don't know what's happening. Both server and client are on localhost, but I don't think this is the problem. Maybe I've got some configuration problems. Here's my server's property file :
For the client, I use the following appender :
Joined: Oct 10, 2000
The error says it's an exception when closing the connection so it doesn't really sound like it's having the problem when sending messages (not that is proof or anything).
The example client configuration looks like yours. It does also have one more param, but when I removed that param it still worked for me: <param name="ReconnectionDelay" value="30000"/>
I am running on windows xp with two cmd windows open, also using localhost/6000 for the client host/port settings.
So, what is the server appender attached to? What level is it set for and what level are you logging at? What is your client doing? Post some more config and code sample.
The example client I'm using sets up a loop asking for input and does a logger.debug for each line entered until a 'q' is entered to quit. So, I can really see the difference between a log message and a disconnect.
I've been using log4j versions 1.2.9 and 1.2.14, how about you?
I've managed to output the messages on the server side by correcting my client appender, and to remove the SocketException by calling LogManager.shutdown(), as written in the API.
I'm still getting the EOFException though. Could you show me your config for the server ? If I set the following line, the exception is not output : log4j.category.org.apache.log4j.net.SocketNode=ERROR
Joined: Oct 10, 2000
OK, that makes sense since the exception is printed out at INFO level.
There isn't anything special in the server1.xml file used to configure the server's output, nothing to show you really (The config file is associated with the book "The complete log4j manual", by Ceki Gulcu.):
<!-- This config file is intended to be used by a SocketServer that logs --> <!-- events received from various clients on the console and to a file --> <!-- that is rolled over when appropriate. The interesting point to note --> <!-- is that it is a configuration file like any other. -->
It defines the root logger with two appenders. [ October 27, 2006: Message edited by: Carol Enderlin ]
you're referring to a 2.5 years old thread, which I don't even remember
I really can't remember, sorry.
Joined: Jul 24, 2009
Ihave found the solution.
I had several problem with log4j in Glassfish. I use SocketAppender to send logs to a Remote Socket.
The solution was to change my Glassfish version. The error was:
INFO [Thread-0] (SocketNode.java:86) - Caught java.io.EOFException closing conneciton.
With my new version i don't have any more this problem.
see yo soon