Announcement

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

    com.isomorphic.sql.SQLSelectClause class with method addSQLForJoinedFields: NullPointerException

    Hi,

    SmartGWT version being used is 12.1-p20201118

    Getting NullPointerException intermittently at addSQLForJoinedFields method of SQLSelectClause at line 517 which means either relatedDS is null or relatedDS.getTable() is null which is causing NullPointerException.

    String tableName = relatedDS.getTable().getNameQuotedIfNecessary(relatedDS);

    So what can be the case of this issue?

    DS being fetched is as below:
    Code:
    <DataSource ID="LineSQL"
                serverType="sql"
                tableName="line"/>
        <fields>
            <field name="line_id" type="sequence" primaryKey="true" hidden="true"/>
            <field name="group_id" type="integer" foreignKey="GroupSQL.group_id" hidden="true" joinType="outer"/>
            <field name="groupType" type="text" length="100" includeFrom="GroupSQL.name"/>
            <field name="notes_id" type="integer" foreignKey="NotesSQL.notes_id" hidden="true" joinType="outer" relatedTableAlias="n"/>
            <field name="notes" type="text" length="100" includeFrom="NotesSQL.description"/>
        </fields>
    </DataSource>
    and GroupSQL is as
    Code:
    <DataSource ID="GroupSQL"
                serverType="sql"
                tableName="group"
                quoteTableName="true"
                dropExtraFields="false"
                xmlns:fmt="WEB-INF/">
        <fields>
            <field name="group_id" type="sequence" primaryKey="true" hidden="true"/>
            <field name="name" type="text" length="100"/>
        </fields>
    </DataSource>
    and NotesSQL is as
    Code:
    <DataSource ID="NotesSQL"
                serverType="sql"
                tableName="notes"
                dropExtraFields="false"
                xmlns:fmt="WEB-INF/">
        <fields>
            <field name="notes_id" type="sequence" primaryKey="true" hidden="true"/>
            <field name="description" type="text" length="100"/>
        </fields>
    </DataSource>

    #2
    These DataSources appear to have been edited before posting - we can tell because the first one is malformed and would not have been parseable at all.

    If you're actually using that file right now in your project, maybe what you did is edit the file on disk to be invalid, and did not restart the server (always required), thus broke things that way.

    Other than that invalid use, we can't imagine a cause - your error appears to be impossible and has never been reported by any other user.

    We would need some way of reproducing the problem to look further.

    Comment


      #3
      Yes DataSources have been edited.

      Main concern is 1st DS join with 2 other DS. 1 via relatedTableAlias and other DS has table name as group which is SQL keyword using quotesTableName as true.

      What is the cause behind null pointer exception?

      Comment


        #4
        As we stated earlier, there does not appear to be any plausible cause for an NPE at that line. It implies the related DataSource cannot be found, but that problem cannot be reproduced with your DataSources, and we gave you the only cause we could think of.

        This is just yet another claimed issue from your organization that makes no sense and can’t be reproduced. Our best guess at why you and only you report so many issues is that you have some kind of fundamentally broken development tools in use, eg, part of your IDE or JVM.

        Comment

        Working...
        X