You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Ali, Haneef" <ha...@hp.com> on 2007/07/18 21:49:02 UTC
Multiple network interface
Hi,
In my machine I have multiple network interface. (i.e) I have installed
vmware so it shows multiple network interfaces. How to make axis2 get
the IP address of the correct intefaces?
Ex: Code from org.apache.axis2.transport.http.sever.HTTPUtils.java
public static String getIpAddress() throws SocketException {
Enumeration e = NetworkInterface.getNetworkInterfaces();
String address = "127.0.0.1";
while (e.hasMoreElements()) {
NetworkInterface netface = (NetworkInterface)
e.nextElement();
Enumeration addresses = netface.getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress ip = (InetAddress) addresses.nextElement();
if (!ip.isLoopbackAddress() &&
isIP(ip.getHostAddress())) {
return ip.getHostAddress();
}
}
}
return address;
}
This code returns the first available intefaces ipaddress which may not
be the desired ip address? Is there a configuration setting to fix this?
You will have the same problem if you have both lan and wireless
connections.
Haneef
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Multiple network interface
Posted by Davanum Srinivas <da...@gmail.com>.
Ali,
Looks like you can edit axis2.xml and specify the "hostname" setting.
this will be picked up . Please try with 1.3 RC2 posted yesterday.
thanks,
dims
On 7/20/07, Davanum Srinivas <da...@gmail.com> wrote:
> Deepal,
>
> IMHO, I think we need to do this for support production servers! in 1.3 itself.
>
> thanks,
> dims
>
> On 7/19/07, Deepal Jayasinghe <de...@opensource.lk> wrote:
> > Hi Ali,
> > We still do not have a way to do that , please create a JIRA so that we
> > will fix that for next release.
> >
> > Thanks
> > Deepal
> > > Hi,
> > >
> > > In my machine I have multiple network interface. (i.e) I have installed
> > > vmware so it shows multiple network interfaces. How to make axis2 get
> > > the IP address of the correct intefaces?
> > >
> > > Ex: Code from org.apache.axis2.transport.http.sever.HTTPUtils.java
> > >
> > > public static String getIpAddress() throws SocketException {
> > > Enumeration e = NetworkInterface.getNetworkInterfaces();
> > > String address = "127.0.0.1";
> > >
> > > while (e.hasMoreElements()) {
> > > NetworkInterface netface = (NetworkInterface)
> > > e.nextElement();
> > > Enumeration addresses = netface.getInetAddresses();
> > >
> > > while (addresses.hasMoreElements()) {
> > > InetAddress ip = (InetAddress) addresses.nextElement();
> > > if (!ip.isLoopbackAddress() &&
> > > isIP(ip.getHostAddress())) {
> > > return ip.getHostAddress();
> > > }
> > > }
> > > }
> > >
> > > return address;
> > > }
> > >
> > >
> > > This code returns the first available intefaces ipaddress which may not
> > > be the desired ip address? Is there a configuration setting to fix this?
> > >
> > > You will have the same problem if you have both lan and wireless
> > > connections.
> > >
> > > H
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
--
Davanum Srinivas :: http://davanum.wordpress.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Multiple network interface
Posted by Davanum Srinivas <da...@gmail.com>.
Deepal,
IMHO, I think we need to do this for support production servers! in 1.3 itself.
thanks,
dims
On 7/19/07, Deepal Jayasinghe <de...@opensource.lk> wrote:
> Hi Ali,
> We still do not have a way to do that , please create a JIRA so that we
> will fix that for next release.
>
> Thanks
> Deepal
> > Hi,
> >
> > In my machine I have multiple network interface. (i.e) I have installed
> > vmware so it shows multiple network interfaces. How to make axis2 get
> > the IP address of the correct intefaces?
> >
> > Ex: Code from org.apache.axis2.transport.http.sever.HTTPUtils.java
> >
> > public static String getIpAddress() throws SocketException {
> > Enumeration e = NetworkInterface.getNetworkInterfaces();
> > String address = "127.0.0.1";
> >
> > while (e.hasMoreElements()) {
> > NetworkInterface netface = (NetworkInterface)
> > e.nextElement();
> > Enumeration addresses = netface.getInetAddresses();
> >
> > while (addresses.hasMoreElements()) {
> > InetAddress ip = (InetAddress) addresses.nextElement();
> > if (!ip.isLoopbackAddress() &&
> > isIP(ip.getHostAddress())) {
> > return ip.getHostAddress();
> > }
> > }
> > }
> >
> > return address;
> > }
> >
> >
> > This code returns the first available intefaces ipaddress which may not
> > be the desired ip address? Is there a configuration setting to fix this?
> >
> > You will have the same problem if you have both lan and wireless
> > connections.
> >
> > H
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Davanum Srinivas :: http://davanum.wordpress.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Multiple network interface
Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Ali,
We still do not have a way to do that , please create a JIRA so that we
will fix that for next release.
Thanks
Deepal
> Hi,
>
> In my machine I have multiple network interface. (i.e) I have installed
> vmware so it shows multiple network interfaces. How to make axis2 get
> the IP address of the correct intefaces?
>
> Ex: Code from org.apache.axis2.transport.http.sever.HTTPUtils.java
>
> public static String getIpAddress() throws SocketException {
> Enumeration e = NetworkInterface.getNetworkInterfaces();
> String address = "127.0.0.1";
>
> while (e.hasMoreElements()) {
> NetworkInterface netface = (NetworkInterface)
> e.nextElement();
> Enumeration addresses = netface.getInetAddresses();
>
> while (addresses.hasMoreElements()) {
> InetAddress ip = (InetAddress) addresses.nextElement();
> if (!ip.isLoopbackAddress() &&
> isIP(ip.getHostAddress())) {
> return ip.getHostAddress();
> }
> }
> }
>
> return address;
> }
>
>
> This code returns the first available intefaces ipaddress which may not
> be the desired ip address? Is there a configuration setting to fix this?
>
> You will have the same problem if you have both lan and wireless
> connections.
>
> H
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org