Trouble going from 2.2 to 2.3

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trouble going from 2.2 to 2.3

Tim Peierls
The default connectors for various editions have changed between 2.2 and 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers HTTP or HTTPS server helpers; JSE still does.

Assuming this was intentional and not an oversight, the change causes problems for me. For several versions now I've been able to maintain one build that works both as a standalone deployment and when embedded in a WAR for deployment in a production server running Tomcat. I've used the JEE edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

(Why use Tomcat at all? There are better connectors for production purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

With this latest change, however, the standalone deployment no longer works. I get message: No available server connector supports the required protocols: 'HTTP' Please add the jar of a matching connector to your classpath.

It's because no HttpServerHelper has been registered in these lines for JEE (the "jee" token was added to the #ifndef list only a few days ago). I'd be happy to add the jar of a matching connector if there was one that the JEE edition supported, but the obvious candidates, Jetty and Simple, don't seem to be available for that edition.

I'd be happy to switch to the JSE edition, but then I wouldn't be able to compile against org.restlet.ext.servlet.

There's an existing issue which is vaguely related:


I'm not filing my own issue yet, because I don't see it as a bug, but I'd like advice on what to do here. I'd prefer not to have to make separate builds -- it was a really nice property that I could run the same code and libraries either standalone or deployed as a WAR.

--tim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble going from 2.2 to 2.3

Thierry Boileau-4
Hi Tim,

I'm afraid I've taken all alone the decision to remove these files as they appeared useless to me. I feel really sorry about that.
I revert back these changes on the 2.3 and master branches: that is to say the JEE edition provides these connectors. However, I wonder if we have to register these connectors by default, what is your thinking about that?

And unfortunately, I won't be able to package a 2.3.1 release soon, I can achieve this on the 29th of December.


Best regards,
Thierry Boileau



2014-12-19 20:34 GMT+01:00 Tim Peierls <[hidden email]>:
The default connectors for various editions have changed between 2.2 and 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers HTTP or HTTPS server helpers; JSE still does.

Assuming this was intentional and not an oversight, the change causes problems for me. For several versions now I've been able to maintain one build that works both as a standalone deployment and when embedded in a WAR for deployment in a production server running Tomcat. I've used the JEE edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

(Why use Tomcat at all? There are better connectors for production purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

With this latest change, however, the standalone deployment no longer works. I get message: No available server connector supports the required protocols: 'HTTP' Please add the jar of a matching connector to your classpath.

It's because no HttpServerHelper has been registered in these lines for JEE (the "jee" token was added to the #ifndef list only a few days ago). I'd be happy to add the jar of a matching connector if there was one that the JEE edition supported, but the obvious candidates, Jetty and Simple, don't seem to be available for that edition.

I'd be happy to switch to the JSE edition, but then I wouldn't be able to compile against org.restlet.ext.servlet.

There's an existing issue which is vaguely related:


I'm not filing my own issue yet, because I don't see it as a bug, but I'd like advice on what to do here. I'd prefer not to have to make separate builds -- it was a really nice property that I could run the same code and libraries either standalone or deployed as a WAR.

--tim



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble going from 2.2 to 2.3

Thierry Boileau-4
wow, I need vacations!
The fix is exactly: register these default connectors.

Best regards,
Thierry Boileau


2014-12-19 21:02 GMT+01:00 Thierry Boileau <[hidden email]>:
Hi Tim,

I'm afraid I've taken all alone the decision to remove these files as they appeared useless to me. I feel really sorry about that.
I revert back these changes on the 2.3 and master branches: that is to say the JEE edition provides these connectors. However, I wonder if we have to register these connectors by default, what is your thinking about that?

And unfortunately, I won't be able to package a 2.3.1 release soon, I can achieve this on the 29th of December.


Best regards,
Thierry Boileau



2014-12-19 20:34 GMT+01:00 Tim Peierls <[hidden email]>:
The default connectors for various editions have changed between 2.2 and 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers HTTP or HTTPS server helpers; JSE still does.

Assuming this was intentional and not an oversight, the change causes problems for me. For several versions now I've been able to maintain one build that works both as a standalone deployment and when embedded in a WAR for deployment in a production server running Tomcat. I've used the JEE edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

(Why use Tomcat at all? There are better connectors for production purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

With this latest change, however, the standalone deployment no longer works. I get message: No available server connector supports the required protocols: 'HTTP' Please add the jar of a matching connector to your classpath.

It's because no HttpServerHelper has been registered in these lines for JEE (the "jee" token was added to the #ifndef list only a few days ago). I'd be happy to add the jar of a matching connector if there was one that the JEE edition supported, but the obvious candidates, Jetty and Simple, don't seem to be available for that edition.

I'd be happy to switch to the JSE edition, but then I wouldn't be able to compile against org.restlet.ext.servlet.

There's an existing issue which is vaguely related:


I'm not filing my own issue yet, because I don't see it as a bug, but I'd like advice on what to do here. I'd prefer not to have to make separate builds -- it was a really nice property that I could run the same code and libraries either standalone or deployed as a WAR.

--tim



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble going from 2.2 to 2.3

Tim Peierls
I tried adding this line:

Engine.getInstance().getRegisteredServers().add(
                new org.restlet.engine.connector.HttpServerHelper(null));

but it didn't seem to work -- maybe I didn't call it early enough. As far as you know, though, that's all I should have to do?

On Fri, Dec 19, 2014 at 3:08 PM, Thierry Boileau <[hidden email]> wrote:
wow, I need vacations!
The fix is exactly: register these default connectors.

Best regards,
Thierry Boileau


2014-12-19 21:02 GMT+01:00 Thierry Boileau <[hidden email]>:
Hi Tim,

I'm afraid I've taken all alone the decision to remove these files as they appeared useless to me. I feel really sorry about that.
I revert back these changes on the 2.3 and master branches: that is to say the JEE edition provides these connectors. However, I wonder if we have to register these connectors by default, what is your thinking about that?

And unfortunately, I won't be able to package a 2.3.1 release soon, I can achieve this on the 29th of December.


Best regards,
Thierry Boileau



2014-12-19 20:34 GMT+01:00 Tim Peierls <[hidden email]>:
The default connectors for various editions have changed between 2.2 and 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers HTTP or HTTPS server helpers; JSE still does.

Assuming this was intentional and not an oversight, the change causes problems for me. For several versions now I've been able to maintain one build that works both as a standalone deployment and when embedded in a WAR for deployment in a production server running Tomcat. I've used the JEE edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

(Why use Tomcat at all? There are better connectors for production purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

With this latest change, however, the standalone deployment no longer works. I get message: No available server connector supports the required protocols: 'HTTP' Please add the jar of a matching connector to your classpath.

It's because no HttpServerHelper has been registered in these lines for JEE (the "jee" token was added to the #ifndef list only a few days ago). I'd be happy to add the jar of a matching connector if there was one that the JEE edition supported, but the obvious candidates, Jetty and Simple, don't seem to be available for that edition.

I'd be happy to switch to the JSE edition, but then I wouldn't be able to compile against org.restlet.ext.servlet.

There's an existing issue which is vaguely related:


I'm not filing my own issue yet, because I don't see it as a bug, but I'd like advice on what to do here. I'd prefer not to have to make separate builds -- it was a really nice property that I could run the same code and libraries either standalone or deployed as a WAR.

--tim



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble going from 2.2 to 2.3

Thierry Boileau-4
Hi Tim,

I think it is not called early enough. It should be done before the Component.getServers() method is called.

--
Thierry Boileau

2014-12-19 21:10 GMT+01:00 Tim Peierls <[hidden email]>:
I tried adding this line:

Engine.getInstance().getRegisteredServers().add(
                new org.restlet.engine.connector.HttpServerHelper(null));

but it didn't seem to work -- maybe I didn't call it early enough. As far as you know, though, that's all I should have to do?

On Fri, Dec 19, 2014 at 3:08 PM, Thierry Boileau <[hidden email]> wrote:
wow, I need vacations!
The fix is exactly: register these default connectors.

Best regards,
Thierry Boileau


2014-12-19 21:02 GMT+01:00 Thierry Boileau <[hidden email]>:
Hi Tim,

I'm afraid I've taken all alone the decision to remove these files as they appeared useless to me. I feel really sorry about that.
I revert back these changes on the 2.3 and master branches: that is to say the JEE edition provides these connectors. However, I wonder if we have to register these connectors by default, what is your thinking about that?

And unfortunately, I won't be able to package a 2.3.1 release soon, I can achieve this on the 29th of December.


Best regards,
Thierry Boileau



2014-12-19 20:34 GMT+01:00 Tim Peierls <[hidden email]>:
The default connectors for various editions have changed between 2.2 and 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers HTTP or HTTPS server helpers; JSE still does.

Assuming this was intentional and not an oversight, the change causes problems for me. For several versions now I've been able to maintain one build that works both as a standalone deployment and when embedded in a WAR for deployment in a production server running Tomcat. I've used the JEE edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

(Why use Tomcat at all? There are better connectors for production purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

With this latest change, however, the standalone deployment no longer works. I get message: No available server connector supports the required protocols: 'HTTP' Please add the jar of a matching connector to your classpath.

It's because no HttpServerHelper has been registered in these lines for JEE (the "jee" token was added to the #ifndef list only a few days ago). I'd be happy to add the jar of a matching connector if there was one that the JEE edition supported, but the obvious candidates, Jetty and Simple, don't seem to be available for that edition.

I'd be happy to switch to the JSE edition, but then I wouldn't be able to compile against org.restlet.ext.servlet.

There's an existing issue which is vaguely related:


I'm not filing my own issue yet, because I don't see it as a bug, but I'd like advice on what to do here. I'd prefer not to have to make separate builds -- it was a really nice property that I could run the same code and libraries either standalone or deployed as a WAR.

--tim



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble going from 2.2 to 2.3

Tim Peierls
It worked, thanks!

And for those out there wanting to have JUnit tests that involve HTTP service with Restlet 2.3.x JEE edition, here's a handy trick:

Stick the following code in your test classes, either in each concrete class or in a common abstract base:

    @BeforeClass 
    public static void ensureHttpServer() {
        org.restlet.engine.Engine.getInstance().getRegisteredServers().add(
            new org.restlet.engine.connector.HttpServerHelper(null));
    }

The key is that you only want to do this once, which is why it's annotated @BeforeClass rather than just @Before. Then you can create and start your Restlet Component and Application(s) with @Before and stop them and tear them down in @After. I like to make the test class extend Application, but there are a number of other patterns that work here.

Of course you could just run your tests with the JSE edition, but I'm happier running my tests against the same exact jars that I deploy with.

--tim

On Fri, Dec 19, 2014 at 3:23 PM, Thierry Boileau <[hidden email]> wrote:
Hi Tim,

I think it is not called early enough. It should be done before the Component.getServers() method is called.

--
Thierry Boileau

2014-12-19 21:10 GMT+01:00 Tim Peierls <[hidden email]>:
I tried adding this line:

Engine.getInstance().getRegisteredServers().add(
                new org.restlet.engine.connector.HttpServerHelper(null));

but it didn't seem to work -- maybe I didn't call it early enough. As far as you know, though, that's all I should have to do?

On Fri, Dec 19, 2014 at 3:08 PM, Thierry Boileau <[hidden email]> wrote:
wow, I need vacations!
The fix is exactly: register these default connectors.

Best regards,
Thierry Boileau


2014-12-19 21:02 GMT+01:00 Thierry Boileau <[hidden email]>:
Hi Tim,

I'm afraid I've taken all alone the decision to remove these files as they appeared useless to me. I feel really sorry about that.
I revert back these changes on the 2.3 and master branches: that is to say the JEE edition provides these connectors. However, I wonder if we have to register these connectors by default, what is your thinking about that?

And unfortunately, I won't be able to package a 2.3.1 release soon, I can achieve this on the 29th of December.


Best regards,
Thierry Boileau



2014-12-19 20:34 GMT+01:00 Tim Peierls <[hidden email]>:
The default connectors for various editions have changed between 2.2 and 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers HTTP or HTTPS server helpers; JSE still does.

Assuming this was intentional and not an oversight, the change causes problems for me. For several versions now I've been able to maintain one build that works both as a standalone deployment and when embedded in a WAR for deployment in a production server running Tomcat. I've used the JEE edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

(Why use Tomcat at all? There are better connectors for production purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

With this latest change, however, the standalone deployment no longer works. I get message: No available server connector supports the required protocols: 'HTTP' Please add the jar of a matching connector to your classpath.

It's because no HttpServerHelper has been registered in these lines for JEE (the "jee" token was added to the #ifndef list only a few days ago). I'd be happy to add the jar of a matching connector if there was one that the JEE edition supported, but the obvious candidates, Jetty and Simple, don't seem to be available for that edition.

I'd be happy to switch to the JSE edition, but then I wouldn't be able to compile against org.restlet.ext.servlet.

There's an existing issue which is vaguely related:


I'm not filing my own issue yet, because I don't see it as a bug, but I'd like advice on what to do here. I'd prefer not to have to make separate builds -- it was a really nice property that I could run the same code and libraries either standalone or deployed as a WAR.

--tim



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France
Loading...