Hello Paolo,
thanks for your test code it helps us to find a bug regarding the
Restlet attached with the "attachDefault" method to virtual hosts. That
bug was part of your problem. The fix is available in the svn repository.
Now, let me explain the other part that is is due to some changes that
have been made with RC1, regarding configuration of servlet [1] and
management of context [2].
There are several ways to refactor your code and web.xml file:
1/ use the component by default and specify only the application in the
web.xml (i.e. remove the "org.restlet.component" parameter). This is
called "mode 3" in [1]
2/ use your custom component. This is called "mode 2" in [1]. In this case:
a/ remove there "org.restlet.application" parameter from the
web.xml because it is useless.
b/ let the constructor with the context of the TestApplication
class since you need some customization. In this case, the context that
is passed to the constructor is no more the parent context, but a
"child" context. That is to say, in your TestComponent#init method you
must change the way you instantiate the TestApplication class:
testApplication = new
TestApplication(this.getContext().createChildContext());
I hope that my explanations are clear enough. Do not hesitate to ask
more questions.
[1]
http://www.restlet.org/documentation/1.1/ext/com/noelios/restlet/ext/servlet/ServerServlet.html
[2] Here is an excerpt of the changes log of the 1.1M5
(http://www.restlet.org/documentation/1.1/changes)
The handling of Context has been significantly refactored in
this release. A new Context#createChildContext() method has
been added to create a new isolated child context from a
parent component's context. Application(Context) constructor
doesn't wrap the given context anymore. Attach methods on
virtual hosts and internal component router now automatically
set the child context on the target application is a null
context is detected.
Hi Jerome, Thierry,
I didn't get Thierry's message so I didn't reply before, sorry about
that.
Attached you find a very stripped down (a Component, an Application and
a Resource) testcase that shows my problem.
The test case can be either run standalone (there is a main in
TestComponent which takes a directory path and the port as arguments) or
inside tomcat.
If you run the test case with M4 jars, both the standalone version and
tomcat version are accessible respectively at
http://localhost:8080/stuff/lala and
http://localhost:8080/test/stuff/lala ("test" is the root context added
by tomcat).
If you instead use RC1 jars the standalone version still works but the
tomcat version gives 404.
Thanks in advance,
Paolo
Note: I removed the jars from the testcase to send a smaller attachment,
they were placed at the following location:
./WebContent/WEB-INF/lib/com.noelios.restlet.ext.servlet_2.5.jar
./WebContent/WEB-INF/lib/com.noelios.restlet.jar
./WebContent/WEB-INF/lib/org.restlet.jar
On mar, 2008-09-16 at 11:30 +0200, Jerome Louvel wrote:
Hi Paolo,
I confirm that this message has no impact at runtime for the Servlet
extension.
However, the message is annoying and confusing so I lowered its level from
WARNING to FINE so it shouldn't appear by default in logs anymore.
Change checked in SVN trunk.
Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com
-----Message d'origine-----
De : Thierry Boileau [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 21 août 2008 15:17
ÃEUR : [email protected]
Objet : Re: RC1: connector with no protocols
Hello Paolo,
to my mind, this message is not the sign of a problem. I get it when I
run the "first steps" code
(http://www.restlet.org/documentation/1.1/firstSteps).
Could you send us a sample test application or give more details about
the way you define your application's routes, web.xml, etc?
best regards,
Thierry Boileau
Hi,
I am trying to upgrade from M4 to RC1, and I think I made the fixes
related to Context-handling needed to get it up and running.
In fact if I run it with the built in server things seem to work.
However I am facing a problem when running inside Tomcat: Restlet tells
me that the connector has been instanciated with no protocols:
...
21-ago-2008 11.18.05 org.apache.catalina.startup.Catalina start
INFO: Server startup in 439 ms
21-ago-2008 11.18.15 org.restlet.Connector <init>
AVVERTENZA: The connector has been instantiated without any protocol.
...
And I cannot access any of the resources.
Any suggestions? Do I need to make further changes beside using
createChildContext etc?
Thanks in advance
Paolo