Re: [HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-11 Thread Ruben Q L
Unfortunately, so far I have not been able to reproduce the issue with a unit test, neither on Github CI [1] nor in a local environment. In any case, analyzing the code we can see that the risk is in theory present; and my original message shows that it can manifest in practice under certain

Re: [HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-06 Thread Ruben Q L
Thanks for the feedback. FYI, I have been able to workaround the issue in the application by tweaking its code to force some Calcite classes to be loaded at different points. Nevertheless, it's true it would be nice to break the circular dependency on Calcite's side; I'll work on the proposed

Re: [HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-06 Thread Julian Hyde
DEFAULT_CALL could also be converted to a method. There’s no harm if such SqlCall objects are created each time we need them. > On Nov 6, 2020, at 11:05 AM, Vladimir Sitnikov > wrote: > > Just in case, I've added a GitHub job that runs Calcite tests with OpenJ9 > JVM 1.8 in >

Re: [HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-06 Thread Vladimir Sitnikov
Just in case, I've added a GitHub job that runs Calcite tests with OpenJ9 JVM 1.8 in https://github.com/apache/calcite/commit/d226a9456a8cfdb108a50744d702e915b46c7ffa Julian>The problem occurs at InferTypes line 41, which is a lambda I believe lambda/reference is irrelevant since

Re: [HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-05 Thread Julian Hyde
The problem occurs at InferTypes line 41, which is a lambda: public static final SqlOperandTypeInference FIRST_KNOWN = (callBinding, returnType, operandTypes) -> { … }; And the error is to do with method handles, which are related to lambdas. Can you instead convert it

Re: [HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-05 Thread Ruben Q L
Thanks for the answers. Indeed, WebSphere uses IBM's own JVM, and my hypothesis is that its class loader follows a different (and unlucky) order to load Calcite classes. I will continue digging into it, see if I can isolate the problem, and open a Jira if there is in fact something to be addressed

Re: [HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-05 Thread Julian Hyde
As you’re using Websphere, it’s possible you’re using IBM’s Java runtime. Is that so? Julian > On Nov 5, 2020, at 2:23 PM, Stamatis Zampetakis wrote: > > Hi Ruben, > > Since you mentioned WebSphere I am wondering if it is related to some weird > problem in the ClassLoader. > If it was only

Re: [HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-05 Thread Stamatis Zampetakis
Hi Ruben, Since you mentioned WebSphere I am wondering if it is related to some weird problem in the ClassLoader. If it was only a JVM problem I guess it could be reproduced outside of WebSphere just by referencing a few Calcite classes in some specific order. Other than that, it is better to

[HELP] NPE on WebSphere 9 when starting application using calcite library (potential circular dependency in class initialization)

2020-11-05 Thread Ruben Q L
Hello everyone, I'm getting a strange error on WebSphere 9 (on Ubuntu) when trying to start an application that uses Calcite (shaded) library. The exception message says: ** error [-]: Unexpected error. ** ... ** Caused by: java.lang.BootstrapMethodError: