You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by rgc <re...@gmail.com> on 2012/09/20 14:33:31 UTC
in ubuntu, when i use the following binding, i just get the 127.0.0.1
in deployeduri, how can i change this ip to eth0?
for example, i write the binding uri in my composite file like this:
<service name="DBService" >
<tuscany:binding.jsonrpc uri="/DBComponent/DBService" />
</service>
after i have launched the app, i will print the endpoint as the following:
Endpoint: URI = DBComponent#service-binding(DBService/DBService):
component=DBComponent
service=DBService
isRemote=false
isAsyncInvocation=false
requiredIntents=[]
policySets=[]
binding=org.apache.tuscany.sca.binding.jsonrpc.impl.JSONRPCBindingImpl@176eeb9
deployedUri=http://127.0.1.1
:8080/cn.edu.nju.moon.version-consistency/DBComponent/DBService/
what should i do to change 127.0.1.1 to my eth0 ip address if i do not
change binding uri in my composite file?
in windows, when i launch my app, i can get my ethernet ip in deployedUri,
like this:
deployedUri=http://114.212.84.235:8080/cn.edu.nju.moon.version-
consistency/DBComponent/DBService/
114.212.84.235 is my ethernet ip address in windows, i want get this ip in
ubuntu also, not 127.0.0.1
yours.
Re: in ubuntu, when i use the following binding, i just get the
127.0.0.1 in deployeduri, how can i change this ip to eth0?
Posted by rgc <re...@gmail.com>.
Raymond,
thanks for your help, can you tell me where is node.xml?
Is it in some module of tuscany? Or should i create this file in my app?
If i create node.xml, where should i place it, just in /src/main/resources?
2012/9/20 Raymond Feng <en...@gmail.com>
> Hi,
>
> There is no way to get the hostname/ip address automatically for a
> multi-homed machine. The url you see is informational. You can customize it
> by specifying the baseURIs in node.xml or the NodeConfiguration API. For
> example,
>
> <?xml version="1.0" encoding="UTF-8"?>
> <node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns="
> http://tuscany.apache.org/xmlns/sca/1.1"
> xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" uri="mynode"
> domainRegistry="vm:default"
> domain="default">
>
> <!-- Configure the base URIs for a given binding -->
> <!-- Each base URI is for a protocol supported by the binding -->
> <binding name="sca:binding.ws" baseURIs="http://localhost" />
> <binding name="tuscany:binding.http" baseURIs="http://localhost" />
> <binding name="tuscany:binding.rest" baseURIs="http://localhost" />
> <binding name="tuscany:binding.jsonrpc" baseURIs="http://localhost" />
>
> </node>
>
> On Sep 20, 2012, at 5:33 AM, rgc wrote:
>
> for example, i write the binding uri in my composite file like this:
>
> <service name="DBService" >
> <tuscany:binding.jsonrpc uri="/DBComponent/DBService" />
> </service>
>
> after i have launched the app, i will print the endpoint as the following:
>
> Endpoint: URI = DBComponent#service-binding(DBService/DBService):
> component=DBComponent
> service=DBService
> isRemote=false
> isAsyncInvocation=false
> requiredIntents=[]
> policySets=[]
>
> binding=org.apache.tuscany.sca.binding.jsonrpc.impl.JSONRPCBindingImpl@176eeb9
> deployedUri=http://127.0.1.1
> :8080/cn.edu.nju.moon.version-consistency/DBComponent/DBService/
>
>
> what should i do to change 127.0.1.1 to my eth0 ip address if i do not
> change binding uri in my composite file?
>
> in windows, when i launch my app, i can get my ethernet ip in deployedUri,
> like this:
> deployedUri=http://114.212.84.235:8080/cn.edu.nju.moon.version-
> consistency/DBComponent/DBService/
>
> 114.212.84.235 is my ethernet ip address in windows, i want get this ip
> in ubuntu also, not 127.0.0.1
>
> yours.
>
>
>
Re: in ubuntu, when i use the following binding, i just get the 127.0.0.1 in deployeduri, how can i change this ip to eth0?
Posted by Raymond Feng <en...@gmail.com>.
Hi,
There is no way to get the hostname/ip address automatically for a multi-homed machine. The url you see is informational. You can customize it by specifying the baseURIs in node.xml or the NodeConfiguration API. For example,
<?xml version="1.0" encoding="UTF-8"?>
<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" uri="mynode" domainRegistry="vm:default"
domain="default">
<!-- Configure the base URIs for a given binding -->
<!-- Each base URI is for a protocol supported by the binding -->
<binding name="sca:binding.ws" baseURIs="http://localhost" />
<binding name="tuscany:binding.http" baseURIs="http://localhost" />
<binding name="tuscany:binding.rest" baseURIs="http://localhost" />
<binding name="tuscany:binding.jsonrpc" baseURIs="http://localhost" />
</node>
On Sep 20, 2012, at 5:33 AM, rgc wrote:
> for example, i write the binding uri in my composite file like this:
>
> <service name="DBService" >
> <tuscany:binding.jsonrpc uri="/DBComponent/DBService" />
> </service>
>
> after i have launched the app, i will print the endpoint as the following:
>
> Endpoint: URI = DBComponent#service-binding(DBService/DBService):
> component=DBComponent
> service=DBService
> isRemote=false
> isAsyncInvocation=false
> requiredIntents=[]
> policySets=[]
> binding=org.apache.tuscany.sca.binding.jsonrpc.impl.JSONRPCBindingImpl@176eeb9
> deployedUri=http://127.0.1.1:8080/cn.edu.nju.moon.version-consistency/DBComponent/DBService/
>
>
> what should i do to change 127.0.1.1 to my eth0 ip address if i do not change binding uri in my composite file?
>
> in windows, when i launch my app, i can get my ethernet ip in deployedUri, like this:
> deployedUri=http://114.212.84.235:8080/cn.edu.nju.moon.version-consistency/DBComponent/DBService/
>
> 114.212.84.235 is my ethernet ip address in windows, i want get this ip in ubuntu also, not 127.0.0.1
>
> yours.