You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stefan Bischof (JIRA)" <ji...@apache.org> on 2018/10/16 21:32:00 UTC
[jira] [Updated] (FELIX-5966) NPE at RuntimeDTOBuilder.java:74
[ https://issues.apache.org/jira/browse/FELIX-5966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Bischof updated FELIX-5966:
----------------------------------
Description:
Got a Nullpointer when asking for runtimeDTO of the second HttpServiceRuntime
{code:java}
@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){code}
if i wait a second the serviceReference is set
{code:java}
@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) { // TODO Auto-generated catch block e.printStackTrace(); } RuntimeDTO dto = rt.getRuntimeDTO(); System.out.println(rt.getRuntimeDTO()); System.out.println(dto); } }).start(); }
{code}
regards
was:
Got a Nullpointer when asking for runtimeDTO of the second HttpServiceRuntime
{code:java}
@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){code}
regards
> NPE at RuntimeDTOBuilder.java:74
> --------------------------------
>
> Key: FELIX-5966
> URL: https://issues.apache.org/jira/browse/FELIX-5966
> Project: Felix
> Issue Type: Bug
> Components: HTTP Service
> Affects Versions: http.jetty-4.0.6
> Reporter: Stefan Bischof
> Priority: Major
>
> Got a Nullpointer when asking for runtimeDTO of the second HttpServiceRuntime
>
> {code:java}
> @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){code}
>
> if i wait a second the serviceReference is set
> {code:java}
> @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) { // TODO Auto-generated catch block e.printStackTrace(); } RuntimeDTO dto = rt.getRuntimeDTO(); System.out.println(rt.getRuntimeDTO()); System.out.println(dto); } }).start(); }
> {code}
> regards
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)