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

Misleading exception when SDO does not find definition for specific column

    XMLWordPrintableJSON

Details

    Description

      While working on Bigbank, was getting the following exception :

      Exception in thread "main" java.lang.NullPointerException
      at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDerivedStructuralFeatureID(BasicEObjectImpl.java:1072)
      at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet (BasicEObjectImpl.java:650)
      at org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:140)
      at org.apache.tuscany.das.rdb.graphbuilder.impl.DataObjectMaker.createAndAddDataObject(DataObjectMaker.java :90)
      at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.addRowToGraph(ResultSetProcessor.java:126)
      at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet(ResultSetProcessor.java :97)
      at org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults(ResultSetProcessor.java:81)
      at org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(ReadCommandImpl.java:92)
      at org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(ReadCommandImpl.java:61)
      at bigbank.account.services.accountdb.AccountDBInit.testStrockPurchaseThroughDAS(AccountDBInit.java:271)
      at bigbank.account.services.accountdb.AccountDBInit.main (AccountDBInit.java:466)

      This was due to a mismatch between data returned from the query and the
      generated DataObject model. The query in this case is doing "select *
      from stocks", which will return columns ID, Symbol, Quantity,
      purchasePrice, purchaseDate, and purchaseLotNumber. The wsdl used to
      generated the SDO model doesn't have an ID column. Looking at
      AccountDBInit, it looks like ID is supposed to identify a customer.
      Nothing in the StockSummary type in the wsdl looks like it corresponds
      to this.

      Regardless, we need to return a meaningful exception for this rather
      than the NPE from SDO.

      See discussion thread for details : http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg08177.html

      Attachments

        Activity

          People

            bdaniel Brent Daniel
            lresende Luciano Resende
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: