Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
http.jetty-4.0.6, http.base-4.0.4, http.bridge-4.0.4
-
None
Description
Got a Nullpointer when asking for runtimeDTO of the second HttpServiceRuntime
@Reference(policy = ReferencePolicy.DYNAMIC,cardinality=ReferenceCardinality.MULTIPLE)
public void bindHttpServiceRuntime(HttpServiceRuntime rt) {
RuntimeDTO dto = rt.getRuntimeDTO();
}
java.lang.NullPointerException
at org.apache.felix.http.base.internal.runtime.dto.RuntimeDTOBuilder.createServiceDTO(RuntimeDTOBuilder.java:74)
at org.apache.felix.http.base.internal.runtime.dto.RuntimeDTOBuilder.build(RuntimeDTOBuilder.java:56)
at org.apache.felix.http.base.internal.service.HttpServiceRuntimeImpl.getRuntimeDTO(HttpServiceRuntimeImpl.java:92)
if i wait a second the serviceReference is set
@Reference(policy = ReferencePolicy.DYNAMIC,cardinality=ReferenceCardinality.MULTIPLE) public void bindHttpServiceRuntime(HttpServiceRuntime rt) { new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } RuntimeDTO dto = rt.getRuntimeDTO(); } }).start(); }
regards