DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43295>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43295

           Summary: Zeroconf always uses default port (4560)
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: chainsaw
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: [EMAIL PROTECTED]


I've just started using Zeroconf in my log4j enabled applications and am having
problems running more than application that uses Zeroconf on the same machine. I
hope this is the appropriate place to report this problem.

I downloaded the latest release of Chainsaw (2006-03-02), and added the provided
jmdns.jar and log4j-zeroconf.jar to my apps' classpath. I then amended my log4j
configuration to use the ZeroConfSocketHubAppender. One of my apps uses
log4j-1.2.8, the other uses the version that ships with JBoss 4.0.4.GA (the Jar
is un-numbered so I'm not sure exactly).

I was able to successfully start one of my apps and receive logging events in
Chainsaw. When I came to start my second app I got:
log4j:ERROR exception setting timeout, shutting down server socket.
java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
        at java.net.ServerSocket.bind(ServerSocket.java:319)
        at java.net.ServerSocket.<init>(ServerSocket.java:185)
        at java.net.ServerSocket.<init>(ServerSocket.java:97)
        at
org.apache.log4j.net.SocketHubAppender$ServerMonitor.run(SocketHubAppender.java:315)
        at java.lang.Thread.run(Thread.java:595)

The application popped up as expected in the Zeroconf tab in Chainsaw, but no
logging events came through, even when they appeared in my console logger. I
note that both my first and second apps had the same address:port value (port
4560) in Chainsaw's Zeroconf tab.

Having had a glance through the latest source in SVN, it seems like
ZeroConfSocketHubAppender always uses SocketHubAppender's default port (4560).
Thus when I start my second app it's unsurprising that it is unable to open a
socket on that port. I guess a fix would involve ZeroConfSocketHubAppender
retrying on a different port (e.g. +1) until it finds a free one.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to