Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5966

NPE at RuntimeDTOBuilder.java:74

    XMLWordPrintableJSON

Details

    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

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            bischofs@jena.de Stefan Bischof
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: