Re: Starting a domain manager on a url including a path?

2007-11-13 Thread Simon Laws
On Nov 13, 2007 4:06 PM, ant elder <[EMAIL PROTECTED]> wrote:

> Trying to run a domain manager node within a webapp and it fails as right
> now you can only use a domain manager url without a path, eg
> http://localhost:8080 not http://localhost:8080/tuscany/domainManager. I'd
> like to try to fix this so a path if supported if no one has any
> objections,
> also if there are any pointers to where in the node and domain code this
> is
> handled that would be great too!
>
>   ...ant
>
No objections from me. It's dealt with in three places..

SCADomainImpl.init() - sets up the domain runtime
SCANodeImpl.init() - sets up the node runtime
SCADomainProxy.start() - sets up a local runtime if no node is provided

The code you are looking for is something like...

// Configure the default server port
int port = URI.create(domainModel.getDomainURI()).getPort();
if (port != -1) {
ServletHostExtensionPoint servletHosts =
domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(
ServletHostExtensionPoint.class);
for (ServletHost servletHost: servletHosts.getServletHosts())
{
servletHost.setDefaultPort(port);
}
}

This is stripping the port out of the provided URL and putting it into the
servlet host. I think we would need to change this interface to allow the
whole base URL to be set on the servlet host.

External web app container - The web app container controls the actual
endpoint and the NodeURL simply tells the tuscany runtime what endpoints to
register. It's seems awkward that we have to provide the URL here but there
doesn't appear to be an easy way round it.
Embedded web app container - The NodeURL should instruct the embedded
container what base URL to use for services.

For the Node URL you must either provide a valid URL or nothing. If nothing
then one will be chosen for you.
For Domain URL (at the node) you must either provide the URL of the domain
or nothing.If nothing then the node will run standalone.

Regards

Simon


Re: Starting a domain manager on a url including a path?

2007-11-16 Thread Simon Laws
On Nov 16, 2007 10:58 AM, ant elder <[EMAIL PROTECTED]> wrote:

> On Nov 13, 2007 4:25 PM, Simon Laws <[EMAIL PROTECTED]> wrote:
>
> > On Nov 13, 2007 4:06 PM, ant elder <[EMAIL PROTECTED]> wrote:
> >
> > > Trying to run a domain manager node within a webapp and it fails as
> > right
> > > now you can only use a domain manager url without a path, eg
> > > http://localhost:8080 not http://localhost:8080/tuscany/domainManager.
> > I'd
> > > like to try to fix this so a path if supported if no one has any
> > > objections,
> > > also if there are any pointers to where in the node and domain code
> this
> >
> > > is
> > > handled that would be great too!
> > >
> > >   ...ant
> > >
> > No objections from me. It's dealt with in three places..
> >
> > SCADomainImpl.init() - sets up the domain runtime
> > SCANodeImpl.init() - sets up the node runtime
> > SCADomainProxy.start() - sets up a local runtime if no node is provided
> >
> > The code you are looking for is something like...
> >
> >// Configure the default server port
> >int port = URI.create(domainModel.getDomainURI()).getPort();
> >if (port != -1) {
> >ServletHostExtensionPoint servletHosts =
> > domainManagementRuntime.getExtensionPointRegistry ().getExtensionPoint(
> > ServletHostExtensionPoint.class);
> >for (ServletHost servletHost:
> servletHosts.getServletHosts
> > ())
> > {
> >servletHost.setDefaultPort(port);
> >}
> >}
> >
> > This is stripping the port out of the provided URL and putting it into
> the
> > servlet host. I think we would need to change this interface to allow
> the
> > whole base URL to be set on the servlet host.
> >
> > External web app container - The web app container controls the actual
> > endpoint and the NodeURL simply tells the tuscany runtime what endpoints
> > to
> > register. It's seems awkward that we have to provide the URL here but
> > there
> > doesn't appear to be an easy way round it.
> > Embedded web app container - The NodeURL should instruct the embedded
> > container what base URL to use for services.
> >
> > For the Node URL you must either provide a valid URL or nothing. If
> > nothing
> > then one will be chosen for you.
> > For Domain URL (at the node) you must either provide the URL of the
> domain
> > or nothing.If nothing then the node will run standalone.
> >
> > Regards
> >
> > Simon
> >
>
> This is working now for the standalone strawman testcase with both the
> domain and node running at a url including a path. There's a problem
> though
> with running it within the same webapp or same Tomcat container (and
> probably the Tuscany Geronimo integration) in that the nodes try to talk
> to
> the domain when they're started but the domain doesn't accept connections
> until after the container is completely up and started, so the node sends
> the register request to the domain and hangs waiting for the domain to
> answer. Not sure whats the best way to get around this, anyone have any
> good
> ideas?
>
>   ...ant
>
In trying to understand the problem here I see two scenarios.

- I want to run my webapp as a standalone SCA application in which case I
don't specify a domain URL and the node doesn't try to connect to the
domain.
- I want to run my webapp as part of an SCA domain. The SCADomain could
include many nodes using different runtimes in different hosting
environments so I think we should expect that it is already available when
the webapp is started.

I accept that it's possible to start the domain manager within the same
webapp but I'm not sure why you would want to. I'm a little more convinced
by wanting to start the domain manager in the same Tomcat container.
Currently the domain and node SCA applications assume remote connections
between each other, hence the problem you are seeing. There are some
solutions of increasing complexity...

- Advise users not to do it. It's very easy to start the domain using the
inbuilt HTTP server. In reality you are likely to want to deploy it as a Web
App to some clustered app server so you need to be careful how this is done
w.r.t the nodes that are started.
- Change the binding used to wire nodes to the domain to be something other
than binding.ws that relies on HTTP
- Enhance the way that nodes register such that they try again when other
API operations are called if they were unsuccessful the first time. Would
fail altogether if it can't connect when you start() the node.
- Change the domain model to be decentralized so that nodes only contact
other nodes. This may still show the problem when more than one node is in
the same container.

Regards

Simon


Re: Starting a domain manager on a url including a path?

2007-11-16 Thread ant elder
On Nov 13, 2007 4:25 PM, Simon Laws <[EMAIL PROTECTED]> wrote:

> On Nov 13, 2007 4:06 PM, ant elder <[EMAIL PROTECTED]> wrote:
>
> > Trying to run a domain manager node within a webapp and it fails as
> right
> > now you can only use a domain manager url without a path, eg
> > http://localhost:8080 not http://localhost:8080/tuscany/domainManager.
> I'd
> > like to try to fix this so a path if supported if no one has any
> > objections,
> > also if there are any pointers to where in the node and domain code this
>
> > is
> > handled that would be great too!
> >
> >   ...ant
> >
> No objections from me. It's dealt with in three places..
>
> SCADomainImpl.init() - sets up the domain runtime
> SCANodeImpl.init() - sets up the node runtime
> SCADomainProxy.start() - sets up a local runtime if no node is provided
>
> The code you are looking for is something like...
>
>// Configure the default server port
>int port = URI.create(domainModel.getDomainURI()).getPort();
>if (port != -1) {
>ServletHostExtensionPoint servletHosts =
> domainManagementRuntime.getExtensionPointRegistry ().getExtensionPoint(
> ServletHostExtensionPoint.class);
>for (ServletHost servletHost: servletHosts.getServletHosts
> ())
> {
>servletHost.setDefaultPort(port);
>}
>}
>
> This is stripping the port out of the provided URL and putting it into the
> servlet host. I think we would need to change this interface to allow the
> whole base URL to be set on the servlet host.
>
> External web app container - The web app container controls the actual
> endpoint and the NodeURL simply tells the tuscany runtime what endpoints
> to
> register. It's seems awkward that we have to provide the URL here but
> there
> doesn't appear to be an easy way round it.
> Embedded web app container - The NodeURL should instruct the embedded
> container what base URL to use for services.
>
> For the Node URL you must either provide a valid URL or nothing. If
> nothing
> then one will be chosen for you.
> For Domain URL (at the node) you must either provide the URL of the domain
> or nothing.If nothing then the node will run standalone.
>
> Regards
>
> Simon
>

This is working now for the standalone strawman testcase with both the
domain and node running at a url including a path. There's a problem though
with running it within the same webapp or same Tomcat container (and
probably the Tuscany Geronimo integration) in that the nodes try to talk to
the domain when they're started but the domain doesn't accept connections
until after the container is completely up and started, so the node sends
the register request to the domain and hangs waiting for the domain to
answer. Not sure whats the best way to get around this, anyone have any good
ideas?

   ...ant


Re: Starting a domain manager on a url including a path?

2007-11-16 Thread Simon Laws
On Nov 16, 2007 11:25 AM, Simon Laws <[EMAIL PROTECTED]> wrote:

>
>
> On Nov 16, 2007 10:58 AM, ant elder <[EMAIL PROTECTED]> wrote:
>
> > On Nov 13, 2007 4:25 PM, Simon Laws <[EMAIL PROTECTED]> wrote:
> >
> > > On Nov 13, 2007 4:06 PM, ant elder < [EMAIL PROTECTED]> wrote:
> > >
> > > > Trying to run a domain manager node within a webapp and it fails as
> > > right
> > > > now you can only use a domain manager url without a path, eg
> > > > http://localhost:8080 not
> > http://localhost:8080/tuscany/domainManager.
> > > I'd
> > > > like to try to fix this so a path if supported if no one has any
> > > > objections,
> > > > also if there are any pointers to where in the node and domain code
> > this
> > >
> > > > is
> > > > handled that would be great too!
> > > >
> > > >   ...ant
> > > >
> > > No objections from me. It's dealt with in three places..
> > >
> > > SCADomainImpl.init() - sets up the domain runtime
> > > SCANodeImpl.init() - sets up the node runtime
> > > SCADomainProxy.start() - sets up a local runtime if no node is
> > provided
> > >
> > > The code you are looking for is something like...
> > >
> > >// Configure the default server port
> > >int port = URI.create(domainModel.getDomainURI
> > ()).getPort();
> > >if (port != -1) {
> > >ServletHostExtensionPoint servletHosts =
> > > domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(
> > > ServletHostExtensionPoint.class);
> > >for (ServletHost servletHost:
> > servletHosts.getServletHosts
> > > ())
> > > {
> > >servletHost.setDefaultPort(port);
> > >}
> > >}
> > >
> > > This is stripping the port out of the provided URL and putting it into
> > the
> > > servlet host. I think we would need to change this interface to allow
> > the
> > > whole base URL to be set on the servlet host.
> > >
> > > External web app container - The web app container controls the actual
> >
> > > endpoint and the NodeURL simply tells the tuscany runtime what
> > endpoints
> > > to
> > > register. It's seems awkward that we have to provide the URL here but
> > > there
> > > doesn't appear to be an easy way round it.
> > > Embedded web app container - The NodeURL should instruct the embedded
> > > container what base URL to use for services.
> > >
> > > For the Node URL you must either provide a valid URL or nothing. If
> > > nothing
> > > then one will be chosen for you.
> > > For Domain URL (at the node) you must either provide the URL of the
> > domain
> > > or nothing.If nothing then the node will run standalone.
> > >
> > > Regards
> > >
> > > Simon
> > >
> >
> > This is working now for the standalone strawman testcase with both the
> > domain and node running at a url including a path. There's a problem
> > though
> > with running it within the same webapp or same Tomcat container (and
> > probably the Tuscany Geronimo integration) in that the nodes try to talk
> > to
> > the domain when they're started but the domain doesn't accept
> > connections
> > until after the container is completely up and started, so the node
> > sends
> > the register request to the domain and hangs waiting for the domain to
> > answer. Not sure whats the best way to get around this, anyone have any
> > good
> > ideas?
> >
> >   ...ant
> >
> In trying to understand the problem here I see two scenarios.
>
> - I want to run my webapp as a standalone SCA application in which case I
> don't specify a domain URL and the node doesn't try to connect to the
> domain.
> - I want to run my webapp as part of an SCA domain. The SCADomain could
> include many nodes using different runtimes in different hosting
> environments so I think we should expect that it is already available when
> the webapp is started.
>
> I accept that it's possible to start the domain manager within the same
> webapp but I'm not sure why you would want to. I'm a little more convinced
> by wanting to start the domain manager in the same Tomcat container.
> Currently the domain and node SCA applications assume remote connections
> between each other, hence the problem you are seeing. There are some
> solutions of increasing complexity...
>
> - Advise users not to do it. It's very easy to start the domain using the
> inbuilt HTTP server. In reality you are likely to want to deploy it as a Web
> App to some clustered app server so you need to be careful how this is done
> w.r.t the nodes that are started.
> - Change the binding used to wire nodes to the domain to be something
> other than binding.ws that relies on HTTP
> - Enhance the way that nodes register such that they try again when other
> API operations are called if they were unsuccessful the first time. Would
> fail altogether if it can't connect when you start() the node.
> - Change the domain model to be decentralized so that nodes only contact
> other nodes. This may still show the problem when more than one node is in
> the same co

Re: Starting a domain manager on a url including a path?

2007-11-16 Thread ant elder
On Nov 16, 2007 11:25 AM, Simon Laws <[EMAIL PROTECTED]> wrote:

>
>
> On Nov 16, 2007 10:58 AM, ant elder <[EMAIL PROTECTED]> wrote:
>
> > On Nov 13, 2007 4:25 PM, Simon Laws <[EMAIL PROTECTED]> wrote:
> >
> > > On Nov 13, 2007 4:06 PM, ant elder < [EMAIL PROTECTED]> wrote:
> > >
> > > > Trying to run a domain manager node within a webapp and it fails as
> > > right
> > > > now you can only use a domain manager url without a path, eg
> > > > http://localhost:8080 not
> > http://localhost:8080/tuscany/domainManager.
> > > I'd
> > > > like to try to fix this so a path if supported if no one has any
> > > > objections,
> > > > also if there are any pointers to where in the node and domain code
> > this
> > >
> > > > is
> > > > handled that would be great too!
> > > >
> > > >   ...ant
> > > >
> > > No objections from me. It's dealt with in three places..
> > >
> > > SCADomainImpl.init() - sets up the domain runtime
> > > SCANodeImpl.init() - sets up the node runtime
> > > SCADomainProxy.start() - sets up a local runtime if no node is
> > provided
> > >
> > > The code you are looking for is something like...
> > >
> > >// Configure the default server port
> > >int port = URI.create(domainModel.getDomainURI
> > ()).getPort();
> > >if (port != -1) {
> > >ServletHostExtensionPoint servletHosts =
> > > domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(
> > > ServletHostExtensionPoint.class);
> > >for (ServletHost servletHost:
> > servletHosts.getServletHosts
> > > ())
> > > {
> > >servletHost.setDefaultPort(port);
> > >}
> > >}
> > >
> > > This is stripping the port out of the provided URL and putting it into
> > the
> > > servlet host. I think we would need to change this interface to allow
> > the
> > > whole base URL to be set on the servlet host.
> > >
> > > External web app container - The web app container controls the actual
> >
> > > endpoint and the NodeURL simply tells the tuscany runtime what
> > endpoints
> > > to
> > > register. It's seems awkward that we have to provide the URL here but
> > > there
> > > doesn't appear to be an easy way round it.
> > > Embedded web app container - The NodeURL should instruct the embedded
> > > container what base URL to use for services.
> > >
> > > For the Node URL you must either provide a valid URL or nothing. If
> > > nothing
> > > then one will be chosen for you.
> > > For Domain URL (at the node) you must either provide the URL of the
> > domain
> > > or nothing.If nothing then the node will run standalone.
> > >
> > > Regards
> > >
> > > Simon
> > >
> >
> > This is working now for the standalone strawman testcase with both the
> > domain and node running at a url including a path. There's a problem
> > though
> > with running it within the same webapp or same Tomcat container (and
> > probably the Tuscany Geronimo integration) in that the nodes try to talk
> > to
> > the domain when they're started but the domain doesn't accept
> > connections
> > until after the container is completely up and started, so the node
> > sends
> > the register request to the domain and hangs waiting for the domain to
> > answer. Not sure whats the best way to get around this, anyone have any
> > good
> > ideas?
> >
> >   ...ant
> >
> In trying to understand the problem here I see two scenarios.
>
> - I want to run my webapp as a standalone SCA application in which case I
> don't specify a domain URL and the node doesn't try to connect to the
> domain.
> - I want to run my webapp as part of an SCA domain. The SCADomain could
> include many nodes using different runtimes in different hosting
> environments so I think we should expect that it is already available when
> the webapp is started.
>
> I accept that it's possible to start the domain manager within the same
> webapp but I'm not sure why you would want to. I'm a little more convinced
> by wanting to start the domain manager in the same Tomcat container.
> Currently the domain and node SCA applications assume remote connections
> between each other, hence the problem you are seeing. There are some
> solutions of increasing complexity...
>
> - Advise users not to do it. It's very easy to start the domain using the
> inbuilt HTTP server. In reality you are likely to want to deploy it as a Web
> App to some clustered app server so you need to be careful how this is done
> w.r.t the nodes that are started.
> - Change the binding used to wire nodes to the domain to be something
> other than binding.ws that relies on HTTP
> - Enhance the way that nodes register such that they try again when other
> API operations are called if they were unsuccessful the first time. Would
> fail altogether if it can't connect when you start() the node.
> - Change the domain model to be decentralized so that nodes only contact
> other nodes. This may still show the problem when more than one node is in
> the same co

Re: Starting a domain manager on a url including a path?

2007-11-16 Thread Simon Laws
On Nov 16, 2007 11:41 AM, Simon Laws <[EMAIL PROTECTED]> wrote:

>
>
> On Nov 16, 2007 11:25 AM, Simon Laws <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > On Nov 16, 2007 10:58 AM, ant elder <[EMAIL PROTECTED]> wrote:
> >
> > > On Nov 13, 2007 4:25 PM, Simon Laws <[EMAIL PROTECTED]> wrote:
> > >
> > > > On Nov 13, 2007 4:06 PM, ant elder < [EMAIL PROTECTED]> wrote:
> > > >
> > > > > Trying to run a domain manager node within a webapp and it fails
> > > as
> > > > right
> > > > > now you can only use a domain manager url without a path, eg
> > > > > http://localhost:8080 not
> > > http://localhost:8080/tuscany/domainManager.
> > > > I'd
> > > > > like to try to fix this so a path if supported if no one has any
> > > > > objections,
> > > > > also if there are any pointers to where in the node and domain
> > > code this
> > > >
> > > > > is
> > > > > handled that would be great too!
> > > > >
> > > > >   ...ant
> > > > >
> > > > No objections from me. It's dealt with in three places..
> > > >
> > > > SCADomainImpl.init() - sets up the domain runtime
> > > > SCANodeImpl.init() - sets up the node runtime
> > > > SCADomainProxy.start() - sets up a local runtime if no node is
> > > provided
> > > >
> > > > The code you are looking for is something like...
> > > >
> > > >// Configure the default server port
> > > >int port = URI.create(domainModel.getDomainURI
> > > ()).getPort();
> > > >if (port != -1) {
> > > >ServletHostExtensionPoint servletHosts =
> > > > domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(
> > > > ServletHostExtensionPoint.class);
> > > >for (ServletHost servletHost:
> > > servletHosts.getServletHosts
> > > > ())
> > > > {
> > > >servletHost.setDefaultPort(port);
> > > >}
> > > >}
> > > >
> > > > This is stripping the port out of the provided URL and putting it
> > > into the
> > > > servlet host. I think we would need to change this interface to
> > > allow the
> > > > whole base URL to be set on the servlet host.
> > > >
> > > > External web app container - The web app container controls the
> > > actual
> > > > endpoint and the NodeURL simply tells the tuscany runtime what
> > > endpoints
> > > > to
> > > > register. It's seems awkward that we have to provide the URL here
> > > but
> > > > there
> > > > doesn't appear to be an easy way round it.
> > > > Embedded web app container - The NodeURL should instruct the
> > > embedded
> > > > container what base URL to use for services.
> > > >
> > > > For the Node URL you must either provide a valid URL or nothing. If
> > > > nothing
> > > > then one will be chosen for you.
> > > > For Domain URL (at the node) you must either provide the URL of the
> > > domain
> > > > or nothing.If nothing then the node will run standalone.
> > > >
> > > > Regards
> > > >
> > > > Simon
> > > >
> > >
> > > This is working now for the standalone strawman testcase with both the
> > > domain and node running at a url including a path. There's a problem
> > > though
> > > with running it within the same webapp or same Tomcat container (and
> > > probably the Tuscany Geronimo integration) in that the nodes try to
> > > talk to
> > > the domain when they're started but the domain doesn't accept
> > > connections
> > > until after the container is completely up and started, so the node
> > > sends
> > > the register request to the domain and hangs waiting for the domain to
> > > answer. Not sure whats the best way to get around this, anyone have
> > > any good
> > > ideas?
> > >
> > >   ...ant
> > >
> >  In trying to understand the problem here I see two scenarios.
> >
> > - I want to run my webapp as a standalone SCA application in which case
> > I don't specify a domain URL and the node doesn't try to connect to the
> > domain.
> > - I want to run my webapp as part of an SCA domain. The SCADomain could
> > include many nodes using different runtimes in different hosting
> > environments so I think we should expect that it is already available when
> > the webapp is started.
> >
> > I accept that it's possible to start the domain manager within the same
> > webapp but I'm not sure why you would want to. I'm a little more convinced
> > by wanting to start the domain manager in the same Tomcat container.
> > Currently the domain and node SCA applications assume remote connections
> > between each other, hence the problem you are seeing. There are some
> > solutions of increasing complexity...
> >
> > - Advise users not to do it. It's very easy to start the domain using
> > the inbuilt HTTP server. In reality you are likely to want to deploy it as a
> > Web App to some clustered app server so you need to be careful how this is
> > done w.r.t the nodes that are started.
> > - Change the binding used to wire nodes to the domain to be something
> > other than binding.ws that relies on HTTP
> > - Enhance the way that nodes register such that they 

Re: Starting a domain manager on a url including a path?

2007-11-16 Thread Simon Laws
On Nov 16, 2007 11:52 AM, Simon Laws <[EMAIL PROTECTED]> wrote:

>
>
> On Nov 16, 2007 11:41 AM, Simon Laws <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > On Nov 16, 2007 11:25 AM, Simon Laws <[EMAIL PROTECTED]> wrote:
> >
> > >
> > >
> > > On Nov 16, 2007 10:58 AM, ant elder <[EMAIL PROTECTED]> wrote:
> > >
> > > > On Nov 13, 2007 4:25 PM, Simon Laws <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > On Nov 13, 2007 4:06 PM, ant elder < [EMAIL PROTECTED]> wrote:
> > > > >
> > > > > > Trying to run a domain manager node within a webapp and it fails
> > > > as
> > > > > right
> > > > > > now you can only use a domain manager url without a path, eg
> > > > > > http://localhost:8080 not
> > > > http://localhost:8080/tuscany/domainManager.
> > > > > I'd
> > > > > > like to try to fix this so a path if supported if no one has any
> > > >
> > > > > > objections,
> > > > > > also if there are any pointers to where in the node and domain
> > > > code this
> > > > >
> > > > > > is
> > > > > > handled that would be great too!
> > > > > >
> > > > > >   ...ant
> > > > > >
> > > > > No objections from me. It's dealt with in three places..
> > > > >
> > > > > SCADomainImpl.init() - sets up the domain runtime
> > > > > SCANodeImpl.init() - sets up the node runtime
> > > > > SCADomainProxy.start() - sets up a local runtime if no node is
> > > > provided
> > > > >
> > > > > The code you are looking for is something like...
> > > > >
> > > > >// Configure the default server port
> > > > >int port = URI.create(domainModel.getDomainURI
> > > > ()).getPort();
> > > > >if (port != -1) {
> > > > >ServletHostExtensionPoint servletHosts =
> > > > > domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(
> > > > > ServletHostExtensionPoint.class);
> > > > >for (ServletHost servletHost:
> > > > servletHosts.getServletHosts
> > > > > ())
> > > > > {
> > > > >servletHost.setDefaultPort(port);
> > > > >}
> > > > >}
> > > > >
> > > > > This is stripping the port out of the provided URL and putting it
> > > > into the
> > > > > servlet host. I think we would need to change this interface to
> > > > allow the
> > > > > whole base URL to be set on the servlet host.
> > > > >
> > > > > External web app container - The web app container controls the
> > > > actual
> > > > > endpoint and the NodeURL simply tells the tuscany runtime what
> > > > endpoints
> > > > > to
> > > > > register. It's seems awkward that we have to provide the URL here
> > > > but
> > > > > there
> > > > > doesn't appear to be an easy way round it.
> > > > > Embedded web app container - The NodeURL should instruct the
> > > > embedded
> > > > > container what base URL to use for services.
> > > > >
> > > > > For the Node URL you must either provide a valid URL or nothing.
> > > > If
> > > > > nothing
> > > > > then one will be chosen for you.
> > > > > For Domain URL (at the node) you must either provide the URL of
> > > > the domain
> > > > > or nothing.If nothing then the node will run standalone.
> > > > >
> > > > > Regards
> > > > >
> > > > > Simon
> > > > >
> > > >
> > > > This is working now for the standalone strawman testcase with both
> > > > the
> > > > domain and node running at a url including a path. There's a problem
> > > > though
> > > > with running it within the same webapp or same Tomcat container (and
> > > >
> > > > probably the Tuscany Geronimo integration) in that the nodes try to
> > > > talk to
> > > > the domain when they're started but the domain doesn't accept
> > > > connections
> > > > until after the container is completely up and started, so the node
> > > > sends
> > > > the register request to the domain and hangs waiting for the domain
> > > > to
> > > > answer. Not sure whats the best way to get around this, anyone have
> > > > any good
> > > > ideas?
> > > >
> > > >   ...ant
> > > >
> > >  In trying to understand the problem here I see two scenarios.
> > >
> > > - I want to run my webapp as a standalone SCA application in which
> > > case I don't specify a domain URL and the node doesn't try to connect to 
> > > the
> > > domain.
> > > - I want to run my webapp as part of an SCA domain. The SCADomain
> > > could include many nodes using different runtimes in different hosting
> > > environments so I think we should expect that it is already available when
> > > the webapp is started.
> > >
> > > I accept that it's possible to start the domain manager within the
> > > same webapp but I'm not sure why you would want to. I'm a little more
> > > convinced by wanting to start the domain manager in the same Tomcat
> > > container. Currently the domain and node SCA applications assume remote
> > > connections between each other, hence the problem you are seeing. There 
> > > are
> > > some solutions of increasing complexity...
> > >
> > > - Advise users not to do it. It's very easy to start the domain using
> > > th

Re: Starting a domain manager on a url including a path?

2007-11-16 Thread ant elder
On Nov 16, 2007 11:41 AM, Simon Laws <[EMAIL PROTECTED]> wrote:

>
>
> On Nov 16, 2007 11:25 AM, Simon Laws <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > On Nov 16, 2007 10:58 AM, ant elder <[EMAIL PROTECTED]> wrote:
> >
> > > On Nov 13, 2007 4:25 PM, Simon Laws <[EMAIL PROTECTED]> wrote:
> > >
> > > > On Nov 13, 2007 4:06 PM, ant elder < [EMAIL PROTECTED]> wrote:
> > > >
> > > > > Trying to run a domain manager node within a webapp and it fails
> > > as
> > > > right
> > > > > now you can only use a domain manager url without a path, eg
> > > > > http://localhost:8080 not
> > > http://localhost:8080/tuscany/domainManager.
> > > > I'd
> > > > > like to try to fix this so a path if supported if no one has any
> > > > > objections,
> > > > > also if there are any pointers to where in the node and domain
> > > code this
> > > >
> > > > > is
> > > > > handled that would be great too!
> > > > >
> > > > >   ...ant
> > > > >
> > > > No objections from me. It's dealt with in three places..
> > > >
> > > > SCADomainImpl.init() - sets up the domain runtime
> > > > SCANodeImpl.init() - sets up the node runtime
> > > > SCADomainProxy.start() - sets up a local runtime if no node is
> > > provided
> > > >
> > > > The code you are looking for is something like...
> > > >
> > > >// Configure the default server port
> > > >int port = URI.create(domainModel.getDomainURI
> > > ()).getPort();
> > > >if (port != -1) {
> > > >ServletHostExtensionPoint servletHosts =
> > > > domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(
> > > > ServletHostExtensionPoint.class);
> > > >for (ServletHost servletHost:
> > > servletHosts.getServletHosts
> > > > ())
> > > > {
> > > >servletHost.setDefaultPort(port);
> > > >}
> > > >}
> > > >
> > > > This is stripping the port out of the provided URL and putting it
> > > into the
> > > > servlet host. I think we would need to change this interface to
> > > allow the
> > > > whole base URL to be set on the servlet host.
> > > >
> > > > External web app container - The web app container controls the
> > > actual
> > > > endpoint and the NodeURL simply tells the tuscany runtime what
> > > endpoints
> > > > to
> > > > register. It's seems awkward that we have to provide the URL here
> > > but
> > > > there
> > > > doesn't appear to be an easy way round it.
> > > > Embedded web app container - The NodeURL should instruct the
> > > embedded
> > > > container what base URL to use for services.
> > > >
> > > > For the Node URL you must either provide a valid URL or nothing. If
> > > > nothing
> > > > then one will be chosen for you.
> > > > For Domain URL (at the node) you must either provide the URL of the
> > > domain
> > > > or nothing.If nothing then the node will run standalone.
> > > >
> > > > Regards
> > > >
> > > > Simon
> > > >
> > >
> > > This is working now for the standalone strawman testcase with both the
> > > domain and node running at a url including a path. There's a problem
> > > though
> > > with running it within the same webapp or same Tomcat container (and
> > > probably the Tuscany Geronimo integration) in that the nodes try to
> > > talk to
> > > the domain when they're started but the domain doesn't accept
> > > connections
> > > until after the container is completely up and started, so the node
> > > sends
> > > the register request to the domain and hangs waiting for the domain to
> > > answer. Not sure whats the best way to get around this, anyone have
> > > any good
> > > ideas?
> > >
> > >   ...ant
> > >
> >  In trying to understand the problem here I see two scenarios.
> >
> > - I want to run my webapp as a standalone SCA application in which case
> > I don't specify a domain URL and the node doesn't try to connect to the
> > domain.
> > - I want to run my webapp as part of an SCA domain. The SCADomain could
> > include many nodes using different runtimes in different hosting
> > environments so I think we should expect that it is already available when
> > the webapp is started.
> >
> > I accept that it's possible to start the domain manager within the same
> > webapp but I'm not sure why you would want to. I'm a little more convinced
> > by wanting to start the domain manager in the same Tomcat container.
> > Currently the domain and node SCA applications assume remote connections
> > between each other, hence the problem you are seeing. There are some
> > solutions of increasing complexity...
> >
> > - Advise users not to do it. It's very easy to start the domain using
> > the inbuilt HTTP server. In reality you are likely to want to deploy it as a
> > Web App to some clustered app server so you need to be careful how this is
> > done w.r.t the nodes that are started.
> > - Change the binding used to wire nodes to the domain to be something
> > other than binding.ws that relies on HTTP
> > - Enhance the way that nodes register such that they 

Re: Starting a domain manager on a url including a path?

2007-11-19 Thread Simon Laws
On Nov 16, 2007 12:06 PM, Simon Laws <[EMAIL PROTECTED]> wrote:

>
>
> On Nov 16, 2007 11:59 AM, ant elder <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > On Nov 16, 2007 11:25 AM, Simon Laws <[EMAIL PROTECTED]> wrote:
> >
> > >
> > >
> > > On Nov 16, 2007 10:58 AM, ant elder <[EMAIL PROTECTED]> wrote:
> > >
> > > > On Nov 13, 2007 4:25 PM, Simon Laws <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > On Nov 13, 2007 4:06 PM, ant elder < [EMAIL PROTECTED]> wrote:
> > > > >
> > > > > > Trying to run a domain manager node within a webapp and it fails
> > > > as
> > > > > right
> > > > > > now you can only use a domain manager url without a path, eg
> > > > > > http://localhost:8080 not
> > > > http://localhost:8080/tuscany/domainManager.
> > > > > I'd
> > > > > > like to try to fix this so a path if supported if no one has any
> > > >
> > > > > > objections,
> > > > > > also if there are any pointers to where in the node and domain
> > > > code this
> > > > >
> > > > > > is
> > > > > > handled that would be great too!
> > > > > >
> > > > > >   ...ant
> > > > > >
> > > > > No objections from me. It's dealt with in three places..
> > > > >
> > > > > SCADomainImpl.init() - sets up the domain runtime
> > > > > SCANodeImpl.init() - sets up the node runtime
> > > > > SCADomainProxy.start() - sets up a local runtime if no node is
> > > > provided
> > > > >
> > > > > The code you are looking for is something like...
> > > > >
> > > > >// Configure the default server port
> > > > >int port = URI.create(domainModel.getDomainURI
> > > > ()).getPort();
> > > > >if (port != -1) {
> > > > >ServletHostExtensionPoint servletHosts =
> > > > > domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(
> > > > > ServletHostExtensionPoint.class);
> > > > >for (ServletHost servletHost:
> > > > servletHosts.getServletHosts
> > > > > ())
> > > > > {
> > > > >servletHost.setDefaultPort(port);
> > > > >}
> > > > >}
> > > > >
> > > > > This is stripping the port out of the provided URL and putting it
> > > > into the
> > > > > servlet host. I think we would need to change this interface to
> > > > allow the
> > > > > whole base URL to be set on the servlet host.
> > > > >
> > > > > External web app container - The web app container controls the
> > > > actual
> > > > > endpoint and the NodeURL simply tells the tuscany runtime what
> > > > endpoints
> > > > > to
> > > > > register. It's seems awkward that we have to provide the URL here
> > > > but
> > > > > there
> > > > > doesn't appear to be an easy way round it.
> > > > > Embedded web app container - The NodeURL should instruct the
> > > > embedded
> > > > > container what base URL to use for services.
> > > > >
> > > > > For the Node URL you must either provide a valid URL or nothing.
> > > > If
> > > > > nothing
> > > > > then one will be chosen for you.
> > > > > For Domain URL (at the node) you must either provide the URL of
> > > > the domain
> > > > > or nothing.If nothing then the node will run standalone.
> > > > >
> > > > > Regards
> > > > >
> > > > > Simon
> > > > >
> > > >
> > > > This is working now for the standalone strawman testcase with both
> > > > the
> > > > domain and node running at a url including a path. There's a problem
> > > > though
> > > > with running it within the same webapp or same Tomcat container (and
> > > >
> > > > probably the Tuscany Geronimo integration) in that the nodes try to
> > > > talk to
> > > > the domain when they're started but the domain doesn't accept
> > > > connections
> > > > until after the container is completely up and started, so the node
> > > > sends
> > > > the register request to the domain and hangs waiting for the domain
> > > > to
> > > > answer. Not sure whats the best way to get around this, anyone have
> > > > any good
> > > > ideas?
> > > >
> > > >   ...ant
> > > >
> > >  In trying to understand the problem here I see two scenarios.
> > >
> > > - I want to run my webapp as a standalone SCA application in which
> > > case I don't specify a domain URL and the node doesn't try to connect to 
> > > the
> > > domain.
> > > - I want to run my webapp as part of an SCA domain. The SCADomain
> > > could include many nodes using different runtimes in different hosting
> > > environments so I think we should expect that it is already available when
> > > the webapp is started.
> > >
> > > I accept that it's possible to start the domain manager within the
> > > same webapp but I'm not sure why you would want to. I'm a little more
> > > convinced by wanting to start the domain manager in the same Tomcat
> > > container. Currently the domain and node SCA applications assume remote
> > > connections between each other, hence the problem you are seeing. There 
> > > are
> > > some solutions of increasing complexity...
> > >
> > > - Advise users not to do it. It's very easy to start the domain using
> > > the

Re: URLs in servlet containers was: Starting a domain manager on a url including a path?

2007-11-19 Thread ant elder
On Nov 19, 2007 10:22 AM, Simon Laws <[EMAIL PROTECTED]> wrote:

> I've just committed changes to the Jetty and Tomcat host containers.
> (r596243 and r596246) to ensure that URLs are formed correctly when
> context
> is included in the Node URI, e.g.
>
> http://localhost:8080/somecontext
>
> is combined with
>
> mycomponent/myservice
>
> to give
>
> http://localhost:8080/somecontext/mycomponent/myservice
>
> Tomcat was working OK in most circumstances but the original changes to
> jetty meant it was exposing services as
>
> http://localhost:8080/somecontext/somecontext/mycomponent/myservice
>
> I've reverted the original changes so that the context is not set on the
> server but is added to the servlet path in getURLMapping(String)  as it
> needs to be set back into the binding uri. If we want to set the context
> to
> the server we will have tomake more changes so that the binding can
> manipulate the complete URL and not get it confused with the context when
> the servlet is registered.
>

After this the calculator-distributed sample no longer works for me nor
Tomcat using nodes with paths in the urls. Whats the reasons we can't get
Jetty to work with the context path on the http server?  I'm  wondering if
that might be easier, it also has to be the way the webapp host works as we
can't change the context path of the webapp, but i don't want to go off
looking at this if you've already tried it and hit blocking issues?

   ...ant


Re: URLs in servlet containers was: Starting a domain manager on a url including a path?

2007-11-19 Thread Simon Laws
On Nov 19, 2007 11:29 AM, ant elder <[EMAIL PROTECTED]> wrote:

> On Nov 19, 2007 10:22 AM, Simon Laws <[EMAIL PROTECTED]> wrote:
>
> > I've just committed changes to the Jetty and Tomcat host containers.
> > (r596243 and r596246) to ensure that URLs are formed correctly when
> > context
> > is included in the Node URI, e.g.
> >
> > http://localhost:8080/somecontext
> >
> > is combined with
> >
> > mycomponent/myservice
> >
> > to give
> >
> > http://localhost:8080/somecontext/mycomponent/myservice
> >
> > Tomcat was working OK in most circumstances but the original changes to
> > jetty meant it was exposing services as
> >
> > http://localhost:8080/somecontext/somecontext/mycomponent/myservice
> >
> > I've reverted the original changes so that the context is not set on the
> > server but is added to the servlet path in getURLMapping(String)  as it
> > needs to be set back into the binding uri. If we want to set the context
> > to
> > the server we will have tomake more changes so that the binding can
> > manipulate the complete URL and not get it confused with the context
> when
> > the servlet is registered.
> >
>
> After this the calculator-distributed sample no longer works for me nor
> Tomcat using nodes with paths in the urls. Whats the reasons we can't get
> Jetty to work with the context path on the http server?  I'm  wondering if
> that might be easier, it also has to be the way the webapp host works as
> we
> can't change the context path of the webapp, but i don't want to go off
> looking at this if you've already tried it and hit blocking issues?
>
>   ...ant
>
I'm seeing the calculator-distributed issue too. I've not hit a blocking
issue. To make contexts work as intended we need to be a bit smarter at the
way the URL is resolved as we need to resolve the URL provided by the
servler with the default URL that the server now has. If you want to look
into that that would be great as I haven't got back to it yet.

Simon


Re: URLs in servlet containers was: Starting a domain manager on a url including a path?

2007-11-19 Thread Simon Laws
On Nov 19, 2007 11:44 AM, Simon Laws <[EMAIL PROTECTED]> wrote:

>
>
> On Nov 19, 2007 11:29 AM, ant elder <[EMAIL PROTECTED]> wrote:
>
> > On Nov 19, 2007 10:22 AM, Simon Laws <[EMAIL PROTECTED]> wrote:
> >
> > > I've just committed changes to the Jetty and Tomcat host containers.
> > > (r596243 and r596246) to ensure that URLs are formed correctly when
> > > context
> > > is included in the Node URI, e.g.
> > >
> > > http://localhost:8080/somecontext
> > >
> > > is combined with
> > >
> > > mycomponent/myservice
> > >
> > > to give
> > >
> > > http://localhost:8080/somecontext/mycomponent/myservice
> > >
> > > Tomcat was working OK in most circumstances but the original changes
> > to
> > > jetty meant it was exposing services as
> > >
> > > http://localhost:8080/somecontext/somecontext/mycomponent/myservice
> > >
> > > I've reverted the original changes so that the context is not set on
> > the
> > > server but is added to the servlet path in getURLMapping(String)  as
> > it
> > > needs to be set back into the binding uri. If we want to set the
> > context
> > > to
> > > the server we will have tomake more changes so that the binding can
> > > manipulate the complete URL and not get it confused with the context
> > when
> > > the servlet is registered.
> > >
> >
> > After this the calculator-distributed sample no longer works for me nor
> > Tomcat using nodes with paths in the urls. Whats the reasons we can't
> > get
> > Jetty to work with the context path on the http server?  I'm  wondering
> > if
> > that might be easier, it also has to be the way the webapp host works as
> > we
> > can't change the context path of the webapp, but i don't want to go off
> > looking at this if you've already tried it and hit blocking issues?
> >
> >   ...ant
> >
> I'm seeing the calculator-distributed issue too. I've not hit a blocking
> issue. To make contexts work as intended we need to be a bit smarter at the
> way the URL is resolved as we need to resolve the URL provided by the
> servler with the default URL that the server now has. If you want to look
> into that that would be great as I haven't got back to it yet.
>
> Simon
>
I have a fix for the calculator-distributed problem. It's unrelated to the
jetty problem and it to do with accidentally having loaded a composite
twice. Need a test to prevent that. Just doing a full build now.

Simon

Simon