Index: src/main/java/org/ow2/petals/binding/soap/listener/incoming/SoapExternalListenerManager.java
===================================================================
--- src/main/java/org/ow2/petals/binding/soap/listener/incoming/SoapExternalListenerManager.java (revision 16332)
+++ src/main/java/org/ow2/petals/binding/soap/listener/incoming/SoapExternalListenerManager.java (working copy)
@@ -260,14 +261,21 @@
}
- if (NetworkUtil.isLocalAddress(address)) {
- - config.addAddress(address);
- config.setRestrict(true);
+ if (address != null) {
+ if (NetworkUtil.isLocalAddress(address)) {
+ + config.addAddress(address);
+ config.setRestrict(true);
+ } else {
+ logger.warning(address + " is not a valid local address, using the wildcard one");
+ + + config.setRestrict(false);
+ config.addAddresses(NetworkUtil.getAllIPv4InetAddresses());
+ }
} else {
- logger.warning(address + " is not a valid local address, using the wildcard one");
- - + logger.warning("Unable to get the IP adress associated to the host '" + host + "'.");
+ logger.warning("All available local adresses are used to listen incoming requests.");
config.setRestrict(false);
config.addAddresses(NetworkUtil.getAllIPv4InetAddresses());
}
Index: src/main/java/org/ow2/petals/binding/soap/util/NetworkUtil.java
===================================================================
--- src/main/java/org/ow2/petals/binding/soap/util/NetworkUtil.java (revision 16332)
+++ src/main/java/org/ow2/petals/binding/soap/util/NetworkUtil.java (working copy)
@@ -122,29 +122,27 @@
}
/**
- * Returns true if the given address is not null and is one of the local
- * host address including the loopback address
+ * Returns true if the given address is not null and is one of the local host address including the loopback address
*
* @param address
+ * The {@link InetAddress} to check as local adress. Must be non null.
* @return
+ * @throws SocketException
+ * An error occurs getting local network interfaces.
*/
- public static boolean isLocalAddress(InetAddress address) {
- boolean result = false;
- if (address != null) {
- try {
- Enumeration<NetworkInterface> itfs = NetworkInterface.getNetworkInterfaces();
- while (itfs.hasMoreElements()) {
- NetworkInterface itf = itfs.nextElement();
- Enumeration<InetAddress> iaenum = itf.getInetAddresses();
- while (iaenum.hasMoreElements() && !result) {
- InetAddress ia = iaenum.nextElement();
- result = ia.equals(address);
- }
+ public static boolean isLocalAddress(InetAddress address) throws SocketException {
+ final Enumeration<NetworkInterface> itfs = NetworkInterface.getNetworkInterfaces();
+ while (itfs.hasMoreElements()) {
+ final NetworkInterface itf = itfs.nextElement();
+ final Enumeration<InetAddress> iaenum = itf.getInetAddresses();
+ while (iaenum.hasMoreElements()) {
+ final InetAddress ia = iaenum.nextElement();
+ if (ia.equals(address)) {
+ return true;
}
- } catch (SocketException e) {
}
}
- return result;
+ return false;
}
/**
The existing algorithmic must be fixed. It's urgent.
The new algorithm is not urgent. If the init/start of the component is stopped because of misconfiguration, you forget all SA deployment link to this component. In an operating point of view, it's better to be able to continue the deployment and after to fix the configuration. My previous proposition permits to fix the misconfiguration after to have deploy all SAs.