You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ruben Q L (Jira)" <ji...@apache.org> on 2020/11/24 08:54:00 UTC

[jira] [Resolved] (CALCITE-4393) ExceptionInInitializerError due to NPE in SqlCallBinding caused by circular dependency

     [ https://issues.apache.org/jira/browse/CALCITE-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruben Q L resolved CALCITE-4393.
--------------------------------
    Resolution: Fixed

Fixed via https://github.com/apache/calcite/commit/fbe69824ffb13f847d1db6e26f0030ddec7b0e8c

> ExceptionInInitializerError due to NPE in SqlCallBinding caused by circular dependency
> --------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4393
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4393
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.27.0
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> See discussion here: https://lists.apache.org/thread.html/red0fc146f78a196af6fdaa5393b2c0906e0a49361a1734a850185777%40%3Cdev.calcite.apache.org%3E
> {{ExceptionInInitializerError}} on WebSphere 9 (on Ubuntu) when trying to start an application that uses Calcite (shaded) library. The exception message reads:
> {noformat}
>  **         error [-]: Unexpected error.
>  **               ...
>  **               Caused by: java.lang.BootstrapMethodError: java.lang.ExceptionInInitializerError
>  **               com.onwbp.org.apache.calcite.sql.type.InferTypes.<clinit>(InferTypes.java:41)
>  **               com.onwbp.org.apache.calcite.sql.fun.SqlMultisetSetOperator.<init>(SqlMultisetSetOperator.java:43)
>  **               com.onwbp.org.apache.calcite.sql.fun.SqlStdOperatorTable.<clinit>(SqlStdOperatorTable.java:118)
>  **               com.onwbp.org.apache.calcite.adapter.enumerable.RexToLixTranslator.<clinit>(RexToLixTranslator.java:93)
>  **               java.lang.Class.forNameImpl(Native Method)
>  **               java.lang.Class.forName(Class.java:348)
>  **               java.lang.invoke.MethodType.nonPrimitiveClassFromString(MethodType.java:311)
>  **               java.lang.invoke.MethodType.parseIntoClasses(MethodType.java:373)
>  **               java.lang.invoke.MethodType.fromMethodDescriptorString(MethodType.java:286)
>  **               java.lang.invoke.MethodHandle.getCPMethodTypeAt(Native Method)
>  **               java.lang.invoke.MethodHandle.resolveInvokeDynamic(MethodHandle.java:849)
>  **               ... 74 more
>  **               Caused by: java.lang.ExceptionInInitializerError
>  **               java.lang.J9VMInternals.ensureError(J9VMInternals.java:141)
>  **               java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:130)
>  **               java.lang.Class.forNameImpl(Native Method)
>  **               java.lang.Class.forName(Class.java:348)
>  **               java.lang.invoke.MethodType.nonPrimitiveClassFromString(MethodType.java:311)
>  **               java.lang.invoke.MethodType.parseIntoClasses(MethodType.java:373)
>  **               java.lang.invoke.MethodType.fromMethodDescriptorString(MethodType.java:286)
>  **               java.lang.invoke.MethodHandle.getCPMethodTypeAt(Native Method)
>  **               java.lang.invoke.MethodHandle.resolveInvokeDynamic(MethodHandle.java:849)
>  **               ... 85 more
>  **               Caused by: java.lang.NullPointerException
>  **               com.onwbp.org.apache.calcite.sql.SqlCallBinding.<clinit>(SqlCallBinding.java:60)
>  **               ... 92 more
>  ****** 1 errors, 5 infos. 
> {noformat}
> As we can see there is a NPE in [SqlCallBinding:60|https://github.com/apache/calcite/blob/2e9edae7fc57ab9c9c7c097008724ac99a1791a3/core/src/main/java/org/apache/calcite/sql/SqlCallBinding.java#L60], when it tries to call a method on {{SqlStdOperatorTable.DEFAULT}}, which seems to be null.
> According to the logs, what I think is happening is a circular dependency issue when classes get loaded (more details in first comment).
> However, so far I have only seen this error in WebSphere, in other environments the same application is correctly initialized and launched, and this exception does not happen.
> Since WebSphere uses IBM's own JVM, my hypothesis is that its class loader follows a different (and unlucky) order to load Calcite classes.
> So far I have not been able to reproduce the issue with a unit test, neither on [Github CI|https://github.com/apache/calcite/pull/2251], nor in a local environment.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)