You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Milisic Aleksandar <ac...@yahoo.com.au> on 2010/07/28 04:12:30 UTC

Problems understanding the standalone Jetty configuration

Hi,

I've already once asked a similar question but am still a bit unclear of how the 
standalone Jetty configuration actually works.

The documentation I have found suggests that in the Spring context we can 
configure the Jetty instance with many options including the port.

What I have noticed is that if I start a "server" which loads an application 
context that has just the jetty configuration (and just the port), the Jetty 
instance does not actually start?!
It seems to start *only* when I use the JaxWsServerFactoryBean interface to 
publish a service. If that service happens to include a different port in the 
address, the jetty instance that starts
will listen to that port and not the port configured in the original application 
context!

 If I publish several services which use a different port, new Jetty instances 
are created.

To me this rings alarm bells because it means:

1. I am probably not using the standalone jetty configuration properly.

2. If it seems to disregard the initial jetty configuration in terms of port 
number, it will probably ignore everything else such as security and thread pool 
settings? 



I know I haven't specified a particular question above, but more an attempt to 
explain what is unclear to me and can't find in the documentation, hoping 
someone can clear that up.


My best scenario would be as following:

1. I have an application context which loads all the jetty configuration, 
including port number.

2. Whenever a new service is to be published, we publish it but *without* the 
port number since it should automatically be published to the port number Jetty 
is listening on. I have tried doing this, but I get a permission 

denied on the socket exception since it automatically tries to publish to port 
80.


Has anybody done this, or is there a concrete example somewhere in the 
documentation?

Cheers!



      

Re: Problems understanding the standalone Jetty configuration

Posted by Milisic Aleksandar <ac...@yahoo.com.au>.
Sorry, yes, I mean the embedded Jetty. And thanks for the example!




----- Original Message ----
From: Glen Mazza <gl...@gmail.com>
To: users@cxf.apache.org
Sent: Wed, 28 July, 2010 10:35:14 PM
Subject: Re: Problems understanding the standalone Jetty configuration



Milisic Aleksandar wrote:
> 
> Hi,
> 
> I've already once asked a similar question but am still a bit unclear of
> how the 
> standalone Jetty configuration actually works.
> 

Just to clarify, you mean *embedded* Jetty, the servlet container behind the
scenes that CXF uses to implement the Endpoint interface, correct? 
Standalone to me means you download Jetty and dump a WAR archive holding the
web service in its /webapps folder (or whatever the folder called in
Jetty-speak).


Milisic Aleksandar wrote:
> 
> 2. Whenever a new service is to be published, we publish it but *without*
> the 
> port number since it should automatically be published to the port number
> Jetty 
> is listening on. I have tried doing this, but I get a permission 
> 
> denied on the socket exception since it automatically tries to publish to
> port 
> 80.
> 

I think it's just using 80 by default because you haven't specified the
port.  I would think Jetty does not listen on a particular port, it listens
on the port that you tell it to listen to when you publish the Endpoint.


Milisic Aleksandar wrote:
> 
> Has anybody done this, or is there a concrete example somewhere in the 
> documentation?
> 
> Cheers!
> 

It needs a bit of updating--and high on my list to do so--but my embedded
Jetty example may be of help for you:
http://www.jroller.com/gmazza/entry/writing_junit_test_cases_for#testjt

Glen
-- 
View this message in context: 
http://cxf.547215.n5.nabble.com/Problems-understanding-the-standalone-Jetty-configuration-tp2256625p2256675.html

Sent from the cxf-user mailing list archive at Nabble.com.



      

Re: Problems understanding the standalone Jetty configuration

Posted by Benson Margulies <bi...@gmail.com>.
We do not default to port 80. Nohow.

In general, we don't launch the server until it is needed for an
endpoint, but we respect the server options you specify when we do
that.

I don't know a way offhand to ask us to launch sooner.

On Wed, Jul 28, 2010 at 8:35 AM, Glen Mazza <gl...@gmail.com> wrote:
>
>
> Milisic Aleksandar wrote:
>>
>> Hi,
>>
>> I've already once asked a similar question but am still a bit unclear of
>> how the
>> standalone Jetty configuration actually works.
>>
>
> Just to clarify, you mean *embedded* Jetty, the servlet container behind the
> scenes that CXF uses to implement the Endpoint interface, correct?
> Standalone to me means you download Jetty and dump a WAR archive holding the
> web service in its /webapps folder (or whatever the folder called in
> Jetty-speak).
>
>
> Milisic Aleksandar wrote:
>>
>> 2. Whenever a new service is to be published, we publish it but *without*
>> the
>> port number since it should automatically be published to the port number
>> Jetty
>> is listening on. I have tried doing this, but I get a permission
>>
>> denied on the socket exception since it automatically tries to publish to
>> port
>> 80.
>>
>
> I think it's just using 80 by default because you haven't specified the
> port.  I would think Jetty does not listen on a particular port, it listens
> on the port that you tell it to listen to when you publish the Endpoint.
>
>
> Milisic Aleksandar wrote:
>>
>> Has anybody done this, or is there a concrete example somewhere in the
>> documentation?
>>
>> Cheers!
>>
>
> It needs a bit of updating--and high on my list to do so--but my embedded
> Jetty example may be of help for you:
> http://www.jroller.com/gmazza/entry/writing_junit_test_cases_for#testjt
>
> Glen
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Problems-understanding-the-standalone-Jetty-configuration-tp2256625p2256675.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: Problems understanding the standalone Jetty configuration

Posted by Glen Mazza <gl...@gmail.com>.

Milisic Aleksandar wrote:
> 
> Hi,
> 
> I've already once asked a similar question but am still a bit unclear of
> how the 
> standalone Jetty configuration actually works.
> 

Just to clarify, you mean *embedded* Jetty, the servlet container behind the
scenes that CXF uses to implement the Endpoint interface, correct? 
Standalone to me means you download Jetty and dump a WAR archive holding the
web service in its /webapps folder (or whatever the folder called in
Jetty-speak).


Milisic Aleksandar wrote:
> 
> 2. Whenever a new service is to be published, we publish it but *without*
> the 
> port number since it should automatically be published to the port number
> Jetty 
> is listening on. I have tried doing this, but I get a permission 
> 
> denied on the socket exception since it automatically tries to publish to
> port 
> 80.
> 

I think it's just using 80 by default because you haven't specified the
port.  I would think Jetty does not listen on a particular port, it listens
on the port that you tell it to listen to when you publish the Endpoint.


Milisic Aleksandar wrote:
> 
> Has anybody done this, or is there a concrete example somewhere in the 
> documentation?
> 
> Cheers!
> 

It needs a bit of updating--and high on my list to do so--but my embedded
Jetty example may be of help for you:
http://www.jroller.com/gmazza/entry/writing_junit_test_cases_for#testjt

Glen
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Problems-understanding-the-standalone-Jetty-configuration-tp2256625p2256675.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Problems understanding the standalone Jetty configuration

Posted by Milisic Aleksandar <ac...@yahoo.com.au>.
Thanks, that makes perfect sense!!! 


Regards,

Aleks



----- Original Message ----
From: Daniel Kulp <dk...@apache.org>
To: users@cxf.apache.org
Cc: Milisic Aleksandar <ac...@yahoo.com.au>
Sent: Thu, 29 July, 2010 12:03:35 AM
Subject: Re: Problems understanding the standalone Jetty configuration

On Tuesday 27 July 2010 10:12:30 pm Milisic Aleksandar wrote:
> Hi,
> 
> I've already once asked a similar question but am still a bit unclear of
> how the standalone Jetty configuration actually works.
> 
> The documentation I have found suggests that in the Spring context we can
> configure the Jetty instance with many options including the port.

Well, actually, you aren't really configuring the port.   You are associating 
that configuration with the jetty instance started up on that port.  Subtle 
but important difference.

Basically, when we need to bring up a jetty instance on a particular port, it 
looks at the configuration to find a config that matches that port and uses 
that config to configure how jetty is setup.    The information is really just 
looked at the first time we need to startup a jetty instance on a particular 
port.




Dan



> 
> What I have noticed is that if I start a "server" which loads an
> application context that has just the jetty configuration (and just the
> port), the Jetty instance does not actually start?!
> It seems to start *only* when I use the JaxWsServerFactoryBean interface to
> publish a service. If that service happens to include a different port in
> the address, the jetty instance that starts
> will listen to that port and not the port configured in the original
> application context!
> 
>  If I publish several services which use a different port, new Jetty
> instances are created.
> 
> To me this rings alarm bells because it means:
> 
> 1. I am probably not using the standalone jetty configuration properly.
> 
> 2. If it seems to disregard the initial jetty configuration in terms of
> port number, it will probably ignore everything else such as security and
> thread pool settings?
> 
> 
> 
> I know I haven't specified a particular question above, but more an attempt
> to explain what is unclear to me and can't find in the documentation,
> hoping someone can clear that up.
> 
> 
> My best scenario would be as following:
> 
> 1. I have an application context which loads all the jetty configuration,
> including port number.
> 
> 2. Whenever a new service is to be published, we publish it but *without*
> the port number since it should automatically be published to the port
> number Jetty is listening on. I have tried doing this, but I get a
> permission
> 
> denied on the socket exception since it automatically tries to publish to
> port 80.
> 
> 
> Has anybody done this, or is there a concrete example somewhere in the
> documentation?
> 
> Cheers!

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog



      

Re: Problems understanding the standalone Jetty configuration

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday 27 July 2010 10:12:30 pm Milisic Aleksandar wrote:
> Hi,
> 
> I've already once asked a similar question but am still a bit unclear of
> how the standalone Jetty configuration actually works.
> 
> The documentation I have found suggests that in the Spring context we can
> configure the Jetty instance with many options including the port.

Well, actually, you aren't really configuring the port.   You are associating 
that configuration with the jetty instance started up on that port.  Subtle 
but important difference.

Basically, when we need to bring up a jetty instance on a particular port, it 
looks at the configuration to find a config that matches that port and uses 
that config to configure how jetty is setup.    The information is really just 
looked at the first time we need to startup a jetty instance on a particular 
port.




Dan



> 
> What I have noticed is that if I start a "server" which loads an
> application context that has just the jetty configuration (and just the
> port), the Jetty instance does not actually start?!
> It seems to start *only* when I use the JaxWsServerFactoryBean interface to
> publish a service. If that service happens to include a different port in
> the address, the jetty instance that starts
> will listen to that port and not the port configured in the original
> application context!
> 
>  If I publish several services which use a different port, new Jetty
> instances are created.
> 
> To me this rings alarm bells because it means:
> 
> 1. I am probably not using the standalone jetty configuration properly.
> 
> 2. If it seems to disregard the initial jetty configuration in terms of
> port number, it will probably ignore everything else such as security and
> thread pool settings?
> 
> 
> 
> I know I haven't specified a particular question above, but more an attempt
> to explain what is unclear to me and can't find in the documentation,
> hoping someone can clear that up.
> 
> 
> My best scenario would be as following:
> 
> 1. I have an application context which loads all the jetty configuration,
> including port number.
> 
> 2. Whenever a new service is to be published, we publish it but *without*
> the port number since it should automatically be published to the port
> number Jetty is listening on. I have tried doing this, but I get a
> permission
> 
> denied on the socket exception since it automatically tries to publish to
> port 80.
> 
> 
> Has anybody done this, or is there a concrete example somewhere in the
> documentation?
> 
> Cheers!

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog