3 Replies Latest reply: Apr 9, 2013 3:48 PM by Arie Morgenstern RSS

    Works fine with Integrated WLS, NPE when deployed

    Arie Morgenstern
      I have an application that runs fine on my Integrated WLS.
      But, when I deploy it to our production environment, I get a Null Point Exception.
              DCBindingContainer bc =
                  (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
              DCIteratorBinding sItr = bc.findIteratorBinding("Empmaster1Iterator");
              Row currentRow = sItr.getCurrentRow();
              String fName = (String)currentRow.getAttribute("FirstName");
      Curiously, the NPE occurs on the VERY first retrieval of data from the database (the same database I am using in Integrated WLS).
      The NPE occurs on the last line in the above code snippet.

      Can anyone point me in the correct direction to troubleshoot this?

      JDeveloper:
      Studio Edition Version 11.1.1.6.0
      Weblogic 10.3

      production environ:
      WebLogic Server Version: 10.3.6.0

      Thanks,
      Arie
        • 1. Re: Works fine with Integrated WLS, NPE when deployed
          Timo Hahn
          Arie,
          as you got a NPE at
          String fName = (String)currentRow.getAttribute("FirstName");
          means that at the time you run this code there is no current row defined for the 'Empmaster1Iterator'.
          The question now is why don't you have a current row?
          One reason can be that the iterator simply doesn't have a row. With the information provided we can only guess. However, you should check if you get a row before using the row. If you get null you have to decide what to do,

          Timo
          • 2. Re: Works fine with Integrated WLS, NPE when deployed
            Arie Morgenstern
            That makes sense Timo.
            My problem is that when I query the database outside of JDev I have the row, when I run the app in the Integrated WLS I have the row, when I run the app on the production WLS, I get NPE.
            And no doubt I can handle the NPE, by returning a dialog message. But, that doesn't identify why this is happening.

            Knowing that the record exists in the database, what is my next course of action?

            Thanks for all your help Timo.

            Arie
            • 3. Re: Works fine with Integrated WLS, NPE when deployed
              Arie Morgenstern
              After digging further, I found another message that was somehow suppressed by the NPE message.
              ORA-01005: null password given; logon denied

              After that, it all fell into place.
              I changed my AM >> Configurations >> Edit from JDBC URL to JDBC Datasource.