Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Server side NPE when executing request in SQLSelectClause.java

    Hi Isomorphic,

    as a one-off I just noticed an NPE in my server logs that seems to come from your code. I'm using v12.1p_2022-08-10 and this is the stack trace:

    Code:
    Caused by: java.lang.NullPointerException
        at com.isomorphic.sql.SQLSelectClause.addSQLForJoinedFields(SQLSelectClause.java:517)
        at com.isomorphic.sql.SQLSelectClause.getSQLString(SQLSelectClause.java:436)
        at com.isomorphic.sql.SQLSelectClause.getSQLString(SQLSelectClause.java:173)
        at com.isomorphic.sql.SQLDataSource.getClausesContext(SQLDataSource.java:3329)
        at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1774)
        at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:449)
        at com.isomorphic.sql.SQLDataSource.executeFetch(SQLDataSource.java:394)
        at com.lmscompany.lms.server.LMSSQLDataSource.executeFetch(LMSSQLDataSource.java:182)
        at com.isomorphic.datasource.DataSource.execute(DataSource.java:2529)
        at com.lmscompany.lms.server.LMSSQLDataSource.execute(LMSSQLDataSource.java:161)
        ... 77 more
    Could you have a look if you can spot something obvious in SQLSelectClause.java:517?

    Thank you & Best regards
    Blama

    #2
    The NPE could occur in two scenarios:

    #1 There might be a concurrency issue where some resources are freed, but the application still attempts to use them. Can you consistently reproduce this issue in a relatively isolated environment?

    #2 The dataSource may not be initialized properly, leading to the absence of some internals that are expected to always be present. In such cases, an error should be logged during initialization. Specifically for your case, could you check if the following error is logged?

    Code:
    ERROR SQLDataSource - The following stacktrace is setting 'table' to null for SQLDataSource '1226463442' java.lang.Exception
        at com.isomorphic.sql.SQLDataSource.setTable(SQLDataSource.java:175)
        at com.isomorphic.sql.SQLDataSource.init(SQLDataSource.java:300)
        at com.isomorphic.datasource.DataSource.initialize(DataSource.java:1120)
        ...
    Depending on your feedback, we may need a way to reproduce this issue, so a standalone use case would be ideal. Additionally, if there's a misconfiguration or incorrect usage, please let us know. We might want to address this in a more informative manner.

    Comment


      #3
      Hi Blama, in the past I had an error which may or may not be similar:
      https://forums.smartclient.com/forum...-with-queueing

      with SmartClient versions older than yours it was pretty frequent.

      With more recent versions, it seems disappeared.

      BUT, with the same version as yours (v12.1p_2022-08-10), I had just an handful of cases, and I just noticed that it was at the same time with this ORACLE error:

      Code:
      Unable to obtain initial connection: Cannot create PoolableConnectionFactory (ORA-04031: unable to allocate 12312 bytes of shared memory ("shared pool","unknown object","KKSSP^6308","kglseshtTable"))
      see also: https://forums.smartclient.com/forum...with-oracle-db

      I really don't know if those handful of the "addSQLForJoinedFields" error could actually be related to this "shared pool" error, but are you noticing some issue with shared memory by chance?

      Comment


        #4
        Hi Isomorphic,

        sorry for the delay in the reply. No, as written in #1 this was a one-off.
        But here are some more details:
        1. We run our application on three Tomcats with HAProxy loadbalancing for HA and sticky sessions.
          All the errors in the log (11.03.24 - 14.03.24 16:21) are all from one Tomcat, the other two don't show the symptom
        2. We run our application war in ~10 <host> entries in server.xml
          All the errors are only from one of those <host> entries
        3. After a server stop/start of that Tomcat the errors are no longer appearing
        The error occurred 29 times in the logs and in those three days there where ~50000 IDACall requests in total for that Tomcat and host.
        This makes me think that it is a plain JRE issue.

        To your second question:
        I don't have any hits for LoggerName:com.isomorphic.sql.SQLDataSource AND Severity:ERROR in my logs and four (correct) ones for WARN.

        So thank you very much for willing to look into this, but I assume everything is correct on your end.

        Best regards
        Blama

        Comment

        Working...
        X