I am using the Apache Aries in karaf. I have setup my homepage in a separate bundle. The problem is that when i stop the 'web-home' bundle of mine, I see the apache aries default page.
In the karaf-logs I see the default page is always called anyway.
"WARN JAXRSUtils - Both org.apache.aries.jax.rs.whiteboard.internal.DefaultWeb#home and my.packet.Home#home are equal candidates for handling the current request which can lead to unpredictable results"
This is how my Home.java
looks like:
@Path("/")
@Component(
property = {
JaxrsWhiteboardConstants.JAX_RS_APPLICATION_SELECT + "=(osgi.jaxrs.name=.default)",
JaxrsWhiteboardConstants.JAX_RS_RESOURCE + "=true"
},
service = Home.class
)
public class Home {...
So, how does one configure the Aries to shut its homepage off, or otherwise just prevent this potentially unpredictable result?
I'd be happy to clarify further necessary details if asked. Thanks in advance.
it looks like the DefaultWeb is created by a configuration called default.web at the WhiteBoard class right here:
return OSGi.register(
Application.class,
() -> new DefaultApplication() {
@Override
public Set<Object> getSingletons() {
Object defaultApplication = _configurationMap.get(
"default.web");
if (defaultApplication == null ||
Boolean.parseBoolean(defaultApplication.toString())) {
return Collections.singleton(new DefaultWeb());
}
else {
return Collections.emptySet();
}
}
},
Looking at the bundle activator it looks like that if you set the configuration default.web to false it will disable the Default page.
In order to do that, create or find this file:
.../etc/org.apache.aries.jax.rs.whiteboard.default.cfg
(Which is the default config file of this bundle. As a general rule, the default config file is: ../etc/<Persistent ID of Bundel.cfg)
and add / set this line:
default.web=false