3 Replies Latest reply: Jan 22, 2013 2:20 PM by BradW RSS

    Bug: NullPointerException generating JHeadstart application

    Dave.Jarvis
      Hi,

      Using JDeveloper 11.1.2.3.0 GENERIC_120914.0223.6276.1 and JHeadstart 11.1.2.1.28. Was following this tutorial: http://download.oracle.com/consulting/jhstutorial1112.pdf

      I think the tutorial is out of date (and there are a number of minor errors).

      The jag-config.xml is at: http://pastebin.com/raw.php?i=LJ8vsyDb and http://pastebin.com/LJ8vsyDb

      The application can no longer be generated. Running jdev.exe from the command line produces:

      INFO: Number of data controls:1
      JagRunnerCommand CONSTRUC
      JHeadstart Debugger: no debug session exists with key: "JAG"
      21-Jan-2013 4:38:53 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
      INFO: Loading XML bean definitions from file [C:\projects\jdev_home\JHeadstartTutorial\ViewController\templates\config\jag-config.xml]
      java.lang.NullPointerException
      at oracle.jheadstart.dt.share.jdev.util.Bc4jUtils.isTopLevelUsage(Bc4jUtils.java:860)
      at oracle.jheadstart.dt.jag.validation.PGModelValidatorImpl.checkTreeProperties(PGModelValidatorImpl.java:1186)
      at oracle.jheadstart.dt.jag.validation.PGModelValidatorImpl.validateGroupAttributes(PGModelValidatorImpl.java:963)
      at oracle.jheadstart.dt.jag.validation.PGModelValidatorImpl.validateGroup(PGModelValidatorImpl.java:428)
      at oracle.jheadstart.dt.jag.validation.PGModelValidatorImpl.validateGroup(PGModelValidatorImpl.java:439)
      at oracle.jheadstart.dt.jag.validation.PGModelValidatorImpl.validateBaseGroups(PGModelValidatorImpl.java:287)
      at oracle.jheadstart.dt.jag.validation.PGModelValidatorImpl.validate(PGModelValidatorImpl.java:224)
      at oracle.jheadstart.dt.jag.JhsApplicationGenerator.generateService(JhsApplicationGenerator.java:365)
      at oracle.jheadstart.dt.jag.JhsApplicationGenerator.generateService(JhsApplicationGenerator.java:350)
      at oracle.jheadstart.dt.jag.jdev.JagRunner$1.run(JagRunner.java:76)
      at java.lang.Thread.run(Thread.java:662)
      Uncaught exception
      java.lang.ArrayIndexOutOfBoundsException: 1
      at org.netbeans.Archive.flushCaches(Archive.java:246)
      at org.netbeans.Stamps$Store.store(Stamps.java:580)
      at org.netbeans.Stamps$Worker.run(Stamps.java:744)
      java.lang.NullPointerException
      at oracle.ideimpl.feedback2.client.FeedbackManagerImpl.showCustomerFeedbackDialog(FeedbackManagerImpl.java:543)
      at oracle.ideimpl.feedback2.client.FeedbackManagerImpl.showFeedbackDialog(FeedbackManagerImpl.java:360)
      at oracle.ideimpl.feedback2.client.FeedbackManagerImpl$2.run(FeedbackManagerImpl.java:238)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
      at java.awt.EventQueue.access$000(EventQueue.java:85)
      at java.awt.EventQueue$1.run(EventQueue.java:603)
      at java.awt.EventQueue$1.run(EventQueue.java:601)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
      at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
      at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
      at java.awt.Dialog$1.run(Dialog.java:1046)
      at java.awt.Dialog$3.run(Dialog.java:1098)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.awt.Dialog.show(Dialog.java:1096)
      at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:853)
      at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:650)
      at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:621)
      at oracle.jheadstart.dt.share.jdev.ide.DialogUtils$1.run(DialogUtils.java:213)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
      at java.awt.EventQueue.access$000(EventQueue.java:85)
      at java.awt.EventQueue$1.run(EventQueue.java:603)
      at java.awt.EventQueue$1.run(EventQueue.java:601)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
      at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
      at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      Any ideas how to fix this?

      Thank you!
        • 1. Re: Bug: NullPointerException generating JHeadstart application
          Steven Davelaar-Oracle
          I looked up the line where the NPE occurs that this suggests a corrupt view link definition in ADF BC.
          Can you zip up the project and send it to idevcoe_nl@oracle.com?

          Thanks,
          Steven Davelaar,
          JHeadstart team.
          • 2. Re: Bug: NullPointerException generating JHeadstart application
            Steven Davelaar-Oracle
            Thanks for the testcase.
            My suspicion was right, when I try to run the tester on the HRModule application module, I get the following error:

            (oracle.jbo.JboException) JBO-26059: Invalid View Link Usage "EmpManagerFkLink3". Either the source "oracle.hr.model.service.HRModule.CreateEmployeesView" or the destination "null" is not defined.

            If you look in the application module XML, you can see the following:

            <ViewLinkUsage
            Name="EmpManagerFkLink3"
            ViewLinkObjectName="oracle.hr.model.queries.EmpManagerFkLink"
            SrcViewUsageName="oracle.hr.model.service.HRModule.CreateEmployeesView"
            Reversed="false"/>
            <ViewLinkUsage
            Name="EmpManagerFkLink2"
            ViewLinkObjectName="oracle.hr.model.queries.EmpManagerFkLink"
            SrcViewUsageName="oracle.hr.model.service.HRModule.CreateEmployeesView"
            DstViewUsageName="oracle.hr.model.service.HRModule.NewSubordinates"
            Reversed="false"/>

            For some reason, the DstViewUsageName property is missing in EmpManagerFkLink3. That should not happen.
            If you add that property, by copying it from EmpManagerFkLink2, then everything will work fine again, and the JHeadstart generator runs OK.

            The tutorial should be up to date, so please report any errors you find in the tutorial so we can fix that.

            Thanks,
            Steven Davelaar,
            JHeadstart Team.
            • 3. Re: Bug: NullPointerException generating JHeadstart application
              BradW
              It turns out it was a BC4J bug. When working with Dave on the issue, we went back to the AM that JHS was using and validated it. On closing the AM, an error was generated. That led us to find a rogue ViewLinkUsage. Once this rogue usage was removed, JHS worked just fine.

              Rule of thumb, always make sure your Business Components are working properly.


              BradW (Dave's co-worker)