Not sure why I didn't get this one direct - maybe i'm only on the Dev list.
This could be a possible possible bug - or undesirable facet of Jetty
behaviour, something to do with either Http or Jetty is assuming the
alias will be used as a part of a path, and hence the '/'.
This might be a dumb question, but is there a reason for registering an
alias and a resource as the same name?
If you try changing this and registering "/" - then does your
"http://localhost/image.png" work?
-- Rob
Richard S. Hall wrote:
Rob? ;-)
-> richard
-------- Original Message --------
Subject: HttpService.registerResources
Date: Sat, 23 Feb 2008 11:45:25 +0100
From: Martin Thelian <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Hi,
I have problems registering resources via the HttpService in Apache
Felix. I'm using Apache Felix Version 1.0.3 and the HttpService-Bundle
org.apache.felix.http.jetty-0.8.0-SNAPSHOT.jar.
My Problem is that:
|> http.registerResources("/image.png", "/image.png", null);
does not work. It seems that the HttpService-Bundle internally
registers the resource as "image.png/" because I'm getting the
following error message in the console:
|> WARNING: image.png/
(org.apache.felix.moduleloader.ResourceNotFoundException: image.png/)
And my browser is always redirected from "/image.png" to "/image.png/":
|> ~$ telnet localhost 8080
|> Trying 127.0.0.1...
|> Connected to localhost.
|> Escape character is '^]'.
|> GET /image.png HTTP/1.0
|> Host: localhost
|> |> HTTP/1.1 302 Moved Temporarily
|> Date: Fri, 22 Feb 2008 13:51:09 GMT
|> Server: Jetty/4.2.x (Linux/2.6.20-16-generic i386 java/1.5.0_11)
|> Location: http://localhost/image.png/
|> Connection: close
If I start felix in debugging-mode, put a breakpoint into
org.apache.felix.http.jetty.OsgiResourceHandler function "handle(
String pathInContext,...)" and change the value of the requested
resource name from "/image.png/" back to "/image.png" it works fine.
I've also tested my bundle with knopflerfish where it works without a
problem. What can I do to get it to run with Apache felix? Thanks.
Regards,
Martin
--
Ascert - Taking systems to the Edge
[EMAIL PROTECTED]
+44 (0)20 7488 3470
www.ascert.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]