Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1662

NullpointerException if reference name in composite file needs to match exactly what is defined in java file

    XMLWordPrintableJSON

Details

    Description

      Reference name in composite file needs to match exactly what is defined in java file : example : in java reference :

      @Reference
      public void setPricechgLoggingWSService (PricechgLoggingWSService pricechgLoggingWSService)

      { this.pricechgLoggingWSService = pricechgLoggingWSService; }

      in composite file : <reference name="pricechgLoggingWSService">

      If the mismatch occurred, NPE will be generated when composite starts

      java.lang.NullPointerException
      at org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.createWires
      (CompositeActivatorImpl.java:328)
      at org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.createRuntimeWires
      (CompositeActivatorImpl.java:269)
      at org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.activate
      (CompositeActivatorImpl.java:578)

      I'm not sure if the stack trace would be the same, but besides the error where you have a typing mismatch you get the same net result if your @Reference is not placed on a method/field with public or protected access (i.e. if you use a private or pkg (dflt) modifier). Might as well tackle @Property at the same time.. probably the same state of affairs there.

      Attachments

        Activity

          People

            rfeng Zhaohui Feng
            rashmihunt Rashmi Hunt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: