View | Details | Raw Unified | Return to bug 41028
Collapse All | Expand All

(-)src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java (-4 / +10 lines)
Lines 51-63 Link Here
51
		log.debug("This = " + this);
51
		log.debug("This = " + this);
52
		try {
52
		try {
53
			Registry reg = LocateRegistry.getRegistry(port);
53
			Registry reg = LocateRegistry.getRegistry(port);
54
			backingEngine = new StandardJMeterEngine(InetAddress.getLocalHost().getHostName());
54
			final InetAddress localHost = java.net.InetAddress.getLocalHost();
55
			if (localHost.isLoopbackAddress()) {
56
				throw new RuntimeException("java.net.InetAddress.getLocalHost() returned a loopback address, we can bind to the registry but the server will not be accessible. If you are running on linux check sun bug id (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4665037) for solutions to this problem");
57
			}
58
			final String hostName = localHost.getHostName();
59
			backingEngine = new StandardJMeterEngine(hostName);
60
			log.info("this: " + this);
55
			reg.rebind("JMeterEngine", this); // $NON-NLS-1$
61
			reg.rebind("JMeterEngine", this); // $NON-NLS-1$
56
			log.info("Bound to registry on port " + port);
62
			log.info("Bound to registry on port " + port + " with hostname " + hostName);
57
		} catch (Exception ex) {
63
		} catch (Exception ex) {
58
			log.error("rmiregistry needs to be running to start JMeter in server " + "mode\n\t" + ex.toString());
64
			log.error("rmiregistry needs to be running to start JMeter in server " + "mode\n\t", ex);
59
			// Throw an Exception to ensure caller knows ...
65
			// Throw an Exception to ensure caller knows ...
60
			throw new RemoteException("Cannot start. See server log file.");
66
			throw new RemoteException("Cannot start. See server log file.",ex);
61
		}
67
		}
62
	}
68
	}
63
69

Return to bug 41028