Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-441

NullPointerException of retrieveInterfaceFromSUDescriptor in EndpointRegistry.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0-M2
    • 3.0-M2
    • servicemix-core
    • None
    • linux redhat 9

    Description

      I am a member of celtix team and doing integration between celtix and servicemix.
      I just develop my ServiceEngine Component and Service Unit demo and try to develop it into ServiceMix. I am using the latest nightly binary kit which is incubating-servicemix-3.0-SNAPSHOT.zip.
      But I get NullPointerException when I try to start service assembly.

      The exception was thrown at line **** *****

      if (services != null) {
      Provides[] provides = services.getProvides();

                            • for (int j = 0; j < provides.length; j++) { *************

      The problem is that variable "provides" was not checked null or not. In fact, this variable would be null always since services.setProvides() method is never called in the whole code base.
      I modify Services.java a little bit which can make my demo works with ServiceMix

      codebase:
      private Provides[] provides;
      private Consumes[] consumes;

      my change:

      private Provides[] provides = new Provides[0];
      private Consumes[] consumes = new Consumes[0];

      Just makesure provides is not null.

      The attachment is Services.java I modified.

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            freeman.fang Freeman Fang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified