You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by john70 <jo...@mail.ru> on 2012/01/30 09:00:43 UTC

Jetty Support

Hi all,

are there any plans to add support for Jetty?
I mean similar distribution as TomEE but with Jetty as Servlet-container.
I'm personally would prefer to use Jetty instead of Tomcat.

Thanks in advance!

Best regards,
John.

--
View this message in context: http://openejb.979440.n4.nabble.com/Jetty-Support-tp4340294p4340294.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jetty Support

Posted by David Blevins <da...@gmail.com>.
On Feb 8, 2012, at 4:53 AM, john70 wrote:

> Hi David,
> 
> thank you again for taking time!
> 
> 
> 
> David Blevins-2 wrote
>> 
>> The part that has historically been missing in Jetty terms is the
>> injection support of various Java EE things into Servlets, Filters, etc. 
>> I.e. wiring the things that Jetty controls into the overall server.  Jan
>> and I have chatted a couple times on that part.
>> 
> 
> I don't need  the injection support for Servlets, Filters, etc. So if it is
> still missed, it is OK for me.

If that's the case, it sounds like you don't need really any "integration".  Both OpenEJB and Jetty have very expressive APIs for building things up in code. I wouldn't recommend this to just anyone, but it sounds like you might get a little giggle out of the possibilities.

   http://svn.apache.org/repos/asf/openejb/trunk/sandbox/jettyfun/src/test/java/org/superbiz/jettyfun/JettyIntegrationTest.java

There isn't really a "test" there, I just started playing -- I tend to use tests rather than main classes for prototyping.

Just a little proof of concept.  There are numerous ways that could be tweaked, changed, or expanded.  The idea was just to get the creative juices flowing.

So note on the "if (proxied)" statement.  One approach just has OpenEJB build the actual instance and hand it over bare to Jetty.  This approach will get you a fully injected instance, but none of the container managed services that are setup prior to calls being made; jndi, transactions, interceptors, locking, cdi request scope.  The other approach get's you all that extra stuff.

I would note that when you have the kind of control shown in that simple little example, you can easily make that decision however you want.  For example, that if block could be:

    if (beanContext.getBeanClass().isAnnotationPresent(Proxied.class)) {
        // Interceptors, transactions, CDI scope management all will be enabled
        servlet = (Servlet) beanContext.getBusinessLocalHome().create();
    } else {
        // Here we just take the raw injected instance and use it directly
        final InstanceContext instanceContext = beanContext.newInstance();
        servlet = (Servlet) instanceContext.getBean();
    }

Where 'Proxied' is some annotation you made up and apply where you want it.

As well the line that uses the ejbName as the path could just as easily use some other annotation of your design to set the path -- you could even reuse the @WebServlet annotation if you wanted.

Most people aren't used to thinking like an app server developer and so these things aren't obvious, but with the right mindset you can have all sorts of wicked fun.


-David


Re: Jetty Support

Posted by john70 <jo...@mail.ru>.
Hi David,

thank you again for taking time!



David Blevins-2 wrote
> 
> The part that has historically been missing in Jetty terms is the
> injection support of various Java EE things into Servlets, Filters, etc. 
> I.e. wiring the things that Jetty controls into the overall server.  Jan
> and I have chatted a couple times on that part.
> 

I don't need  the injection support for Servlets, Filters, etc. So if it is
still missed, it is OK for me.


David Blevins-2 wrote
> 
> Give me the weekend to look over all that code and see what the story is. 
> Also let me know which major version of Jetty you want -- I assume the
> latest.
> 

Yes, the latest major version of Jetty. Currently it is Jetty 8.1.0 (7.6.0
is also OK).

Thanks!

Best regards,
John

--
View this message in context: http://openejb.979440.n4.nabble.com/Jetty-Support-tp4340294p4369328.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jetty Support

Posted by David Blevins <da...@gmail.com>.
On Feb 3, 2012, at 3:41 AM, john70 wrote:

> Hi all,
> 
> I know you are very busy. But my question is still not answered.
> Are you planning (I mean real planning and not a hypothetical one) to add
> Jetty support or not?

Had a partial response crafted, but not finished.  The "who cares about certification" response was perfect -- thank you.  Any other response would have been a clear no in terms of Jetty support.  Taking certification off the table, we've used Jetty ourselves for years in our build.  Primarily for JAX-RS and JAX-WS endpoints as well as the ability to run our EJBd protocol over HTTP via Jetty.  So that part is easy and simply having Jetty "there" is easy.  There've been people who've used them together by just booting Jetty in code and OpenEJB in code (both are really better embeddable) and then just having the servlets lookup the EJBs via global JNDI over the LocalInitialContextFactory.

The part that has historically been missing in Jetty terms is the injection support of various Java EE things into Servlets, Filters, etc.  I.e. wiring the things that Jetty controls into the overall server.  Jan and I have chatted a couple times on that part.

We definitely have everything else on that list.  In fact, it sounds a lot like what Andy Gumbrecht is using, minus Jetty of course (or if he is using it, it's news to me).

Give me the weekend to look over all that code and see what the story is.  Also let me know which major version of Jetty you want -- I assume the latest.


-David


Re: Jetty Support

Posted by john70 <jo...@mail.ru>.
Hi all,

I know you are very busy. But my question is still not answered.
Are you planning (I mean real planning and not a hypothetical one) to add
Jetty support or not?

Especially after reading this article:

http://java.dzone.com/articles/cost-high-availability

I have much more interest in Jetty. ;-)

Thanks in advance!

Best regards,
John

--
View this message in context: http://openejb.979440.n4.nabble.com/Jetty-Support-tp4340294p4354361.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jetty Support

Posted by john70 <jo...@mail.ru>.
Hi David,


David Blevins-2 wrote
> 
> The big question is if you need it to be Java EE 6 certified.  Restoring
> the Jetty module is fairly easy, Java EE 6 certifying it would take a
> couple months.
> 

Does it really matter whether it is certified or not?
I mean, my customers does not care whether we run our product on a certified
or on a not certified application server. What matter for my customers is
stability and high performance. For me personally it is important, that the
application server consumes as less resources as possible. What also
important for me is the support for following technologies:
- JCA 1.6
- JTA 1.1 with full XA support
- JMS provided by a resource adapter (we have already an established network
of MQ servers)
- EJB 3.1
- JPA2 provided by Hibernate (we need Hibernate as we use Hibernate Search
in our product)
- JavaMail

Best regards,
John


--
View this message in context: http://openejb.979440.n4.nabble.com/Jetty-Support-tp4340294p4343805.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jetty Support

Posted by David Blevins <da...@gmail.com>.
On Jan 30, 2012, at 2:13 AM, john70 wrote:

> Hi Romain,
> 
> Thank you very much for response!
> 
> 
> Romain Manni-Bucau wrote
>> 
>> Why do you prefer jetty? You can run tomee in a test, you can use
>> arquillian, you can run it from your pom too. Do you prefer jetty because
>> of jetty or because of something missing to tomcat/tomee?
>> 
> 
> First because of Jetty and second because Jetty has full and rock solid
> support for WebSockets protocol. I know that JEE7 will add WebSockets
> support later this year to the Servlet specification. But for me it is not
> clear when Tomcat will add support for WebSockets. And if Tomcat developers
> add support for WebSockets, they will need time to make it bug-free and rock
> solid. And Jetty developers (especially Greg Wilkins) have participated in
> the development process of WebSockets protocol and have a working
> implementation for at least one year.
> 
> Currently we are using JBoss 4.2 with Jetty and it works very well. But
> JBoss 4.2 is really old and we would like to replace it with something new.
> We are looking currently at all application servers and one option was/is to
> use Jetty with OpenEJB. But if you don't have support for Jetty or do not
> plan to add support for Jetty, than we can remove OpenEJB from out
> candidates list.

The big question is if you need it to be Java EE 6 certified.  Restoring the Jetty module is fairly easy, Java EE 6 certifying it would take a couple months.


-David


Re: Jetty Support

Posted by Romain Manni-Bucau <rm...@gmail.com>.
I'm not enough familiar with jetty to say you we will not have it at all
(wait a day or two i think you'll have better answer ;))

I know tomcat starts to implement Websockets and i want to switch our
tomcat version as soon as it will work.

- Romain


2012/1/30 john70 <jo...@mail.ru>

> Hi Romain,
>
> Thank you very much for response!
>
>
> Romain Manni-Bucau wrote
> >
> > Why do you prefer jetty? You can run tomee in a test, you can use
> > arquillian, you can run it from your pom too. Do you prefer jetty because
> > of jetty or because of something missing to tomcat/tomee?
> >
>
> First because of Jetty and second because Jetty has full and rock solid
> support for WebSockets protocol. I know that JEE7 will add WebSockets
> support later this year to the Servlet specification. But for me it is not
> clear when Tomcat will add support for WebSockets. And if Tomcat developers
> add support for WebSockets, they will need time to make it bug-free and
> rock
> solid. And Jetty developers (especially Greg Wilkins) have participated in
> the development process of WebSockets protocol and have a working
> implementation for at least one year.
>
> Currently we are using JBoss 4.2 with Jetty and it works very well. But
> JBoss 4.2 is really old and we would like to replace it with something new.
> We are looking currently at all application servers and one option was/is
> to
> use Jetty with OpenEJB. But if you don't have support for Jetty or do not
> plan to add support for Jetty, than we can remove OpenEJB from out
> candidates list.
>
> Best regards,
> John
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Jetty-Support-tp4340294p4340539.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Jetty Support

Posted by john70 <jo...@mail.ru>.
Hi Romain,

Thank you very much for response!


Romain Manni-Bucau wrote
> 
> Why do you prefer jetty? You can run tomee in a test, you can use
> arquillian, you can run it from your pom too. Do you prefer jetty because
> of jetty or because of something missing to tomcat/tomee?
> 

First because of Jetty and second because Jetty has full and rock solid
support for WebSockets protocol. I know that JEE7 will add WebSockets
support later this year to the Servlet specification. But for me it is not
clear when Tomcat will add support for WebSockets. And if Tomcat developers
add support for WebSockets, they will need time to make it bug-free and rock
solid. And Jetty developers (especially Greg Wilkins) have participated in
the development process of WebSockets protocol and have a working
implementation for at least one year.

Currently we are using JBoss 4.2 with Jetty and it works very well. But
JBoss 4.2 is really old and we would like to replace it with something new.
We are looking currently at all application servers and one option was/is to
use Jetty with OpenEJB. But if you don't have support for Jetty or do not
plan to add support for Jetty, than we can remove OpenEJB from out
candidates list.

Best regards,
John

--
View this message in context: http://openejb.979440.n4.nabble.com/Jetty-Support-tp4340294p4340539.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jetty Support

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi John,

some work was started then remove from active trunk:
https://svn.apache.org/repos/asf/openejb/trunk/sandbox/inactive/openejb-jetty/

The issue is mainly TomEE needed a lot of work and i'm not sure we could do
it again.

Why do you prefer jetty? You can run tomee in a test, you can use
arquillian, you can run it from your pom too. Do you prefer jetty because
of jetty or because of something missing to tomcat/tomee?

- Romain


2012/1/30 john70 <jo...@mail.ru>

> Hi all,
>
> are there any plans to add support for Jetty?
> I mean similar distribution as TomEE but with Jetty as Servlet-container.
> I'm personally would prefer to use Jetty instead of Tomcat.
>
> Thanks in advance!
>
> Best regards,
> John.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Jetty-Support-tp4340294p4340294.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>