java.lang.NullPointerException

Zulqarnain
2006-07-28
2013-05-02
  • Zulqarnain
    Zulqarnain
    2006-07-28

    I am using Compiere 2.5.3b

    I have added two new tables. (TEACHERS and TEACHER_ATTENDENCE)

    Created a new window

    First added first table in one tab

    Ran the window. Works perfect.

    Then added second table which is the child of first in another tab

    Ran the window.

    When I press new record button on 2nd tab, a message comes 'Error java.lang.NullPointerException'

    I press ok and enter and save the record

    The record gets saved I have verified from SQL Plus.

    I debug window following message comes

    -----------> M_Table.getPO: (id) - Class not found for TEACHER_ATTENDENCE [11]
    -----------> MTable.dataSave: TEACHER_ATTENDENCE - No Persistent Object [11]

    Please help; I am a little new to Compiere

     
    • Carlos Ruiz
      Carlos Ruiz
      2006-07-28

      Hello, have you defined the link column on the 2nd tab?

      You see the error "No Persistent Object" because you haven't generated the persistence class with GenerateModel.java

      _______________________
      Carlos Ruiz - globalqss
      http://globalqss.com

       
    • Zulqarnain
      Zulqarnain
      2006-07-29

      Thanks for reply.

      I am a little new to Compiere.

      I'll be grateful to you if you guide me the process of generating persistence class.

      And why does not the error comes when there is only one tab.

      If there is some manual/document available for Compiere developers, please let me know.

       
    • Hi Zulqarnain,

      I suppose that you have something like:

      Table: Teachers
      Column : Teachers_ID (Primary Key)

      Table: Teachers_Attendence
      Column: Teachers_Attendence_ID (could be that not exist, or could be the primary key)
      Column: Teachers_ID (foreign key to Teachers Table)

      Then, in Compire, logged as System:
      In Table’s Window select Teachers_Attendance Table.
      In the Column’s Tab you must have in the Teachers_ID column checked the “Parent Link column” checkbox.

      In the Window, Tab & Field you must have set Tab Level as 1 for the Second Tab.

      Important: The Column Names are case sensitive. Isn't equal Teachers_ID that TEACHERS_ID.

      I hope that this help you.

      Regards

      Alejandro

       
    • Zulqarnain
      Zulqarnain
      2006-08-01

      Thanks Alejandro

      All steps you mentioned in your message were followed except the Tab Level.

      I have changed the Tab Level to 1. But the problem I was facing is still there.

      I need your further help to know the process of generating persistence class.

      And why does not the error comes when there was only one tab.

      If there is some manual/document available for Compiere developers, please let me know.

      Thanks again

       
    • Zulqarnain
      Zulqarnain
      2006-08-01

      I am getting another error in the Java window
      ORA-01401: inserted value too large
      for column

      May be this is the reason for  java.lang.NullPointerException

      *** 2006-08-01 10:47:09.654 Compiere Log (CLogConsole) ***
      10:47:09.654 Compiere.startup: Compiere(r) Release 2.5.3b_2006-01-20 - Smart ERP
      & CRM - (c) 1999-2006 Compiere (r); Implementation: 2.5.3b 20060211-1822 - ComP
      iere Inc. (C) 1999-2005 Jorg Janke
      10:47:09.654 Compiere.startup: C:\Compiere2 - Java HotSpot(TM) Client VM 1.5.0_0
      5-b05 - Windows XP 5.1 Service Pack 2
      10:47:23.836 Ini.loadProperties: C:\Documents and Settings\Zulqar\Compiere.prope
      rties #28
      -----------> CConnection.queryAppsServerInfo: jnp://MyAppsServer:1099
      - javax.naming.CommunicationException: Receive timed out [Root exception is jav
      a.net.SocketTimeoutException: Receive timed out]
      - {java.naming.provider.url=jnp://MyAppsServer:1099, java.naming.factory.initia
      l=org.jnp.interfaces.NamingContextFactory, jnp.discoveryTimeout=5000, jnp.timeou
      t=5000, java.naming.factory.url.pkgs=org.jboss.naming.client, jnp.sotimeout=5000
      }
      ===========> MLookupFactory.getLookup_TableDir: No Identifier records found: TEA
      CHERS_ID [11]
      ===========> MLookupFactory.getLookupInfo: No SQL - TEACHERS_ID [11]
      ===========> MField.loadLookup: (TEACHERS_ID) - No LookupInfo [11]
      ===========> DB.executeUpdate: INSERT INTO AD_Issue (AD_Client_ID,AD_Issue_ID,AD
      _Org_ID,Created,CreatedBy,DBAddress,DatabaseInfo,ErrorTrace,IsActive,IssueSummar
      y,JavaInfo,LineNo,Local_Host,LoggerName,Name,OperatingSystemInfo,Processed,Proce
      ssing,ProfileInfo,Record_ID,ReleaseNo,ReleaseTag,SourceClassName,SourceMethodNam
      e,StackTrace,StatisticsInfo,SystemStatus,Updated,UpdatedBy,UserName,Version) VAL
      UES (11,1000960,11,TO_DATE('2006-08-01 11:00:01','YYYY-MM-DD HH24:MI:SS'),100,'j
      dbc:oracle:thin:@//server:1521/orcl','Oracle Database 10g Enterprise Edition Rel
      ease 10.1.0.2.0 - Production
      With the Partitioning, OLAP and Data Mining options;10.1.0.2.0;DS','org.compiere
      .model.MField.validateValue(MField.java:687)
      org.compiere.model.MTab.setCurrentRow(MTab.java:1971)
      org.compiere.model.MTab.dataNew(MTab.java:804)
      org.compiere.apps.APanel.cmd_new(APanel.java:1232)
      org.compiere.apps.APanel.actionPerformed(APanel.java:1133)
      org.compiere.apps.AppsAction.actionPerformed(AppsAction.java:260)
      ','Y','NullPointerException New','Java HotSpot(TM) Client VM 1.5.0_05-b05',687,'
      ZULQARNAIN/192.168.0.121','org.compiere.apps.APanel','?','Windows XP 5.1 Service
      Pack 2','N','N','AliaExports|Apple Media Centre|Systems Automation Limited|Syst
      ems Automation|GardenWorld|SYSTEM|',1,'253b','2.5.3b 20060211-1822','org.compier
      e.model.MField.validateValue','actionPerformed','NullPointerException
              at org.compiere.model.MField.validateValue(MField.java:687)
              at org.compiere.model.MTab.setCurrentRow(MTab.java:1971)
              at org.compiere.model.MTab.dataNew(MTab.java:804)
              at org.compiere.apps.APanel.cmd_new(APanel.java:1232)
              at org.compiere.apps.APanel.actionPerformed(APanel.java:1133)
              at org.compiere.apps.AppsAction.actionPerformed(AppsAction.java:260)
              at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
      49)
              at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
      a:2169)
              at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
      .java:420)
              at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
      )
              at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
      istener.java:234)
              at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:2
      31)
              at java.awt.Component.processMouseEvent(Component.java:5488)
              at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
              at java.awt.Component.processEvent(Component.java:5253)
              at java.awt.Container.processEvent(Container.java:1966)
              at java.awt.Component.dispatchEventImpl(Component.java:3955)
              at java.awt.Container.dispatchEventImpl(Container.java:2024)
              at java.awt.Component.dispatchEvent(Component.java:3803)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212
      )
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)

              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
              at java.awt.Container.dispatchEventImpl(Container.java:2010)
              at java.awt.Window.dispatchEventImpl(Window.java:1774)
              at java.awt.Component.dispatchEvent(Component.java:3803)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
              at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
      read.java:242)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:163)
              at java.awt.EventDispatchThread.pumpEvents(EventDisp','C6U30B41P45I31M70
      ','E',TO_DATE('2006-08-01 11:00:01','YYYY-MM-DD HH24:MI:SS'),100,'?','2006-01-20
      ') [null] [12]
      java.sql.SQLException: ORA-01401: inserted value too large for column
      ; State=23000; ErrorCode=1401
              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
      :125)
              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
              at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
              at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.
      java:181)
              at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedS
      tatement.java:543)
              at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
      nt.java:1028)
              at oracle.jdbc.driver.OracleStatement.doScrollExecuteCommon(OracleStatem
      ent.java:3753)
              at oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate
      (OraclePreparedStatement.java:8829)
              at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep
      aredStatement.java:2886)
              at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
      edStatement.java:2960)
              at org.compiere.util.CPreparedStatement.executeUpdate(CPreparedStatement
      .java:165)
              at org.compiere.util.DB.executeUpdate(DB.java:820)
              at org.compiere.util.DB.executeUpdate(DB.java:730)
              at org.compiere.model.PO.saveNew(PO.java:2175)
              at org.compiere.model.PO.save(PO.java:1714)
              at org.compiere.model.MIssue.create(MIssue.java:48)
              at org.compiere.util.CLogErrorBuffer.publish(CLogErrorBuffer.java:197)
              at java.util.logging.Logger.log(Logger.java:428)
              at java.util.logging.Logger.doLog(Logger.java:450)
              at java.util.logging.Logger.log(Logger.java:539)
              at org.compiere.apps.APanel.actionPerformed(APanel.java:1207)
              at org.compiere.apps.AppsAction.actionPerformed(AppsAction.java:260)

      ===========> DB.saveError: DBExecuteError - ORA-01401: inserted value too large
      for column
      [12]
      -----------> MIssue.saveNew: Not inserted - AD_Issue [12]
      ===========> APanel.actionPerformed: New [12]
      java.lang.NullPointerException
              at org.compiere.model.MField.validateValue(MField.java:687)
              at org.compiere.model.MTab.setCurrentRow(MTab.java:1971)
              at org.compiere.model.MTab.dataNew(MTab.java:804)
              at org.compiere.apps.APanel.cmd_new(APanel.java:1232)
              at org.compiere.apps.APanel.actionPerformed(APanel.java:1133)
              at org.compiere.apps.AppsAction.actionPerformed(AppsAction.java:260)
              at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
      49)
              at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
      a:2169)
              at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
      .java:420)
              at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
      )
              at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
      istener.java:234)
              at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:2
      31)
              at java.awt.Component.processMouseEvent(Component.java:5488)
              at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
              at java.awt.Component.processEvent(Component.java:5253)
              at java.awt.Container.processEvent(Container.java:1966)
              at java.awt.Component.dispatchEventImpl(Component.java:3955)
              at java.awt.Container.dispatchEventImpl(Container.java:2024)
              at java.awt.Component.dispatchEvent(Component.java:3803)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212
      )
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)

       
    • Zulqarnain
      Zulqarnain
      2006-08-05

      Any help please.

       
    • Hi Zulqarnain,

      The error is previous to "ORA-01401: inserted value too large for column"

      I had the same error some time ago with a custom's tables. The problem was the table's names. I changed the names and work fine.

      Please, try with this:

      Rename Table: TEACHERS as X_Teachers.
      Rename Table: TEACHER_ATTENDENCE as X_Teacher_Attendence.

      And Rename Column TEACHERS_ID as X_Teachers_ID
      Rename in both tables. This column is Primary Key for the first table and is Foreign Key for the second.
      Remember to check the “Parent Link column” checkbox for the X_Teachers_ID.

      I hope this help you.

      Regards,
      Alejandro