jmeter-server fails to start due to 127.0.1.1-binding

Bug #589042 reported by Linus Widströmer
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
jakarta-jmeter (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Description: Ubuntu 10.04 LTS
Release: 10.04
jmeter:
  Installed: 2.3.4-2ubuntu1

Jmetet-server uses InetAddress.getLocalHost() to determine a valid IP address for the host it is running on. It then performs a isLoopbackAddress() on the returned object and fails hard if that is the case.

The problem occurs when a server is configured to use DHCP since, in that case, InetAddress.getLocalHost() returns 127.0.1.1. For RMI the property "java.rmi.server.hostname" can be used but that only resolves half of the problem.

I am attaching a patch which resolved this issue by replacing the trivial InetAddress.getLocalHost() with a method getLocalAddress() which does a more thorough attempt to find a non-loopback address to use.
1) If java.rmi.server.hostname is defined it us used
2) InetAddress.getLocalHost() is attempted
3) Enumerate all network interfaces until a non-loopback ipv4 is found

This patch should be combined with a java.rmi.server.hostname in the jmeter-server script.

Tags: patch
Revision history for this message
Linus Widströmer (linus-widstromer) wrote :
Revision history for this message
Linus Widströmer (linus-widstromer) wrote :
tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in jakarta-jmeter (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.