Again,
What this is saying to me is " alias requests to '/ as '/image.png' " -
which may not be what you want.
The more common approach from examples we've worked with, where it's
typical to register aliases to paths where several resources are
located, as opposed to alias every specific resource e.g.
m_httpServ.registerResources("/resource",
"/org/ungoverned/osgi/bundle/httptest/resource", null);
(this is from the httptest bundle that is still available on OBR
at http://oscar-osgi.sourceforge.net/ which has some source if
you want examples)
One thing to be careful of, which is why the alias mechanism exists, is
that the HTTP namespace is global, but multiple bundles may have their
own package/dir namespace - so each bundle needs to be careful that the
aliases it registers map to files in their resource space, and don't
collide with other aliases from other bundles
If image.png is a resource in the root of your bundle, then you may be
able to use following:
http.registerResources("/", "/", null);
(this assumes a getResource("/image.png") for your bundle's context
would locate the required resource)
The trouble here, is that by registering the "root" as an alias, you may
limit/collide with anything other bundles want to register - you'll
effectively be saying go to this bundle for all / resources.
-- Rob
Martin Thelian wrote:
Hi!
Thank you for your answer.
I have not registered an alias and a resource as the same name. The
problem even occurs if I just register a single resource. And it makes
no difference if I register the resource using:
|> http.registerResources("/", "/image.png", null);
I still getting error messages like:
-> WARNING: image.png/
(org.apache.felix.moduleloader.ResourceNotFoundException: image.png/)
Martin
PS.: If you are interested, I can send you a small test-project which
shows the problem.
Rob Walker schrieb:
[...]
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
--
Ascert - Taking systems to the Edge
[EMAIL PROTECTED]
+44 (0)20 7488 3470
www.ascert.com