Does Authorize.net support have of graalVM? - java

Does anyone have information about Authorize.net support GraalVm or not?
We are moving our project to Native Image and getting following exception in creating native image:
Error: Unsupported features in 2 methods
Detailed message:
Error: Detected a MBean server in the image heap. This is currently not supported, but could be changed in the future. Management beans are registered in many global caches that would
need to be cleared and properly re-built at image build time. Class of disallowed object: com.sun.jmx.mbeanserver.JmxMBeanServer To see how this object got instantiated use --trace-ob
ject-instantiation=com.sun.jmx.mbeanserver.JmxMBeanServer. The object was probably created by a class initializer and is reachable from a static field. You can request class initializa
tion at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by
indexing into array
constant java.lang.Object[]#7504af74 reached by
reading field java.util.ArrayList.elementData of
constant java.util.ArrayList#24b75efc reached by
scanning method javax.management.MBeanServerFactory.addMBeanServer(MBeanServerFactory.java:418)
Call path from entry point to javax.management.MBeanServerFactory.addMBeanServer(MBeanServer):
at javax.management.MBeanServerFactory.addMBeanServer(MBeanServerFactory.java:418)
at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:232)
at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:192)
at com.oracle.svm.core.jdk.management.ManagementSupport.getPlatformMBeanServer(ManagementSupport.java:257)
at com.oracle.svm.core.jdk.management.Target_java_lang_management_ManagementFactory.getPlatformMBeanServer(Target_java_lang_management_ManagementFactory.java:45)
at org.apache.logging.log4j.core.jmx.Server.unregisterLoggerContext(Server.java:248)
at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:379)
at org.apache.logging.log4j.core.LoggerContext$1.run(LoggerContext.java:320)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:600)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
Error: type is not available in this platform: org.graalvm.compiler.hotspot.management.AggregatedMemoryPoolBean
Trace: Object was reached by
reading field java.lang.ref.Reference.referent of
constant java.util.WeakHashMap$Entry#5e4acddb reached by
indexing into array
constant java.util.WeakHashMap$Entry[]#5eed71e9 reached by
reading field java.util.WeakHashMap.table of
constant com.sun.jmx.mbeanserver.MBeanIntrospector$MBeanInfoMap#33ac075d reached by
scanning method com.sun.jmx.mbeanserver.MXBeanIntrospector.getMBeanInfoMap(MXBeanIntrospector.java:68)
Call path from entry point to com.sun.jmx.mbeanserver.MXBeanIntrospector.getMBeanInfoMap():
at com.sun.jmx.mbeanserver.MXBeanIntrospector.getMBeanInfoMap(MXBeanIntrospector.java:68)
at com.sun.jmx.mbeanserver.MBeanIntrospector.getClassMBeanInfo(MBeanIntrospector.java:416)
at com.sun.jmx.mbeanserver.MBeanIntrospector.getMBeanInfo(MBeanIntrospector.java:392)
at com.sun.jmx.mbeanserver.MBeanSupport.<init>(MBeanSupport.java:139)
at com.sun.jmx.mbeanserver.MXBeanSupport.<init>(MXBeanSupport.java:66)
at com.sun.jmx.mbeanserver.Introspector.makeDynamicMBean(Introspector.java:203)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:888)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:320)
at com.sun.jmx.mbeanserver.JmxMBeanServer$2.run(JmxMBeanServer.java:1225)
at com.oracle.svm.core.jdk.Target_java_security_AccessController.doPrivileged(SecuritySubstitutions.java:123)
at java.util.ServiceLoader.loadProvider(ServiceLoader.java:859)
at java.util.ServiceLoader$LayerLookupIterator.hasNext(ServiceLoader.java:952)
at sun.java2d.SunGraphics2D.setRenderingHints(SunGraphics2D.java:1370)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS_SunGraphics2D_setRenderingHints_8d5833c6be813de16ff61d40a14ac79dc4dda89c(generated:0)
The issue does not explicitly points to Authorize.net SDK, but it resolved when the following dependency is removed:
<dependency>
<groupId>net.authorize</groupId>
<artifactId>anet-java-sdk</artifactId>
<version>LATEST</version>
</dependency>
I have also tried adding --initialize-at-run-time=com.sun.jmx.mbeanserver.JmxMBeanServer, but the issue still persists
Java version "11.0.10" 2021-01-19 LTS
Quarkus version : 2.5.0.Final
GraalVM: 21.3
Maven version: Apache Maven 3.8.1

Related

Error in mvn test : jvm_gc_pause_seconds_count is already in use by another Collector of type MicrometerCollector

I am running Java8 unit tests using the command mvn test -DskipITs=true on the multi-module maven project.
I am using this maven configuration
export MAVEN_OPTS="-Xmx4096M -Xss768M -XX:MetaspaceSize=640M -XX:MaxMetaspaceSize=2048M -XX:+CMSClassUnloadingEnabled"
prometheus:simpleclient:0.16.0
spring-boot:1.2.1.RELEASE
Since there are a lot of UTs, after an hour it starts throwing the below exception in between of UTs and after sometime, it keeps on throwing the exception and gets stuck:
java.lang.IllegalArgumentException: Failed to register Collector of type MicrometerCollector: jvm_gc_pause_seconds_count is already in use by another Collector of type MicrometerCollector
at io.prometheus.client.CollectorRegistry.register(CollectorRegistry.java:57)
at io.prometheus.client.Collector.register(Collector.java:307)
at io.micrometer.prometheus.PrometheusMeterRegistry.lambda$applyToCollector$17(PrometheusMeterRegistry.java:561)
at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
at io.micrometer.prometheus.PrometheusMeterRegistry.applyToCollector(PrometheusMeterRegistry.java:556)
at io.micrometer.prometheus.PrometheusMeterRegistry.newTimer(PrometheusMeterRegistry.java:322)
at io.micrometer.core.instrument.MeterRegistry.lambda$timer$2(MeterRegistry.java:318)
at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:618)
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:570)
at io.micrometer.core.instrument.MeterRegistry.timer(MeterRegistry.java:316)
at io.micrometer.core.instrument.Timer$Builder.register(Timer.java:399)
at io.micrometer.core.instrument.composite.CompositeTimer.registerNewMeter(CompositeTimer.java:151)
at io.micrometer.core.instrument.composite.CompositeTimer.registerNewMeter(CompositeTimer.java:31)
at io.micrometer.core.instrument.composite.AbstractCompositeMeter.add(AbstractCompositeMeter.java:68)
at java.lang.Iterable.forEach(Iterable.java:75)
at java.util.Collections$SetFromMap.forEach(Collections.java:5530)
at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lambda$new$0(CompositeMeterRegistry.java:67)
at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lock(CompositeMeterRegistry.java:189)
at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lambda$new$1(CompositeMeterRegistry.java:67)
at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:627)
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:570)
at io.micrometer.core.instrument.MeterRegistry.timer(MeterRegistry.java:316)
at io.micrometer.core.instrument.Timer$Builder.register(Timer.java:399)
at io.micrometer.core.instrument.binder.jvm.JvmGcMetrics$GcMetricsNotificationListener.handleNotification(JvmGcMetrics.java:184)
at sun.management.NotificationEmitterSupport.sendNotification(NotificationEmitterSupport.java:156)
at sun.management.GarbageCollectorImpl.createGCNotification(GarbageCollectorImpl.java:143)

PrestoDB JDBC GraalVM native mode build fails and query throws exception only when run in native mode

if I want to build my Quarkus 2.7.3.Final application with GraalVM CE 22.0.0.2 in native mode, I get a build error caused by the PrestoDB JDBC driver.
Also, I get the following exceptions when I make a SQL query on PrestoDB 0.270 and it only occurs if I run the application in native mode.
With the Quarkus JVM mode, the query just works fine.
Docker build image: quay.io/quarkus/ubi-quarkus-native-image:22.0.0-java17
I'm using JDBC driver com.facebook.presto:presto-jdbc:0.270 with a custom agroal connection and driver class com.facebook.presto.jdbc.PrestoDriver
GraalVM build error:
/opt/graalvm/bin/native-image -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--enable-preview --initialize-at-run-time=oracle.xml.util.UnicodeUtil --trace-object-instantiation=java.security.SecureRandom -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -J-Djava.awt.headless=true -H:FallbackThreshold=0 --allow-incomplete-classpath -H:+ReportExceptionStackTraces -J-Xmx8g -H:+AddAllCharsets -H:EnableURLProtocols=http,https -H:NativeLinkerOption=-no-pie -H:+AllowVMInspection -H:-UseServiceLoaderFeature -H:+StackTrace -H:DashboardDump=api-4.3.17_dashboard.dump -H:+DashboardAll --exclude-config .*com\.oracle\.database\.jdbc.* /META-INF/native-image/(?:native-image\.properties|reflect-config\.json) api-4.3.17-runner -jar api-4.3.17-runner.jar
========================================================================================================================
GraalVM Native Image: Generating 'api-4.3.17-runner'...
========================================================================================================================
[1/7] Initializing... (10.7s # 0.24GB)
# Printing Dashboard BGV dump header to: /code/build/api-4.3.17-native-image-source-jar/api-4.3.17_dashboard.dump.bgv
Version info: 'GraalVM 22.0.0.2 Java 17 CE'
4 user-provided feature(s)
- com.oracle.svm.thirdparty.gson.GsonFeature
- io.quarkus.runner.AutoFeature
- io.quarkus.runtime.graal.ResourcesFeature
- oracle.nativeimage.NativeImageFeature
The bundle named: com/sun/rowset/RowSetResourceBundle, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise verify the bundle path is accessible in the classpath.
[2/7] Performing analysis... [**********] (159.1s # 3.41GB)
10:27:46,716 INFO [org.jbo.threads] JBoss Threads version 3.4.2.Final
28,036 (96.99%) of 28,905 classes reachable
45,951 (70.09%) of 65,556 fields reachable
163,540 (83.39%) of 196,125 methods reachable
865 classes, 2,527 fields, and 13,784 methods registered for reflection
71 classes, 98 fields, and 56 methods registered for JNI access
# Printing Dashboard PointsTo analysis BGV dump to: /code/build/api-4.3.17-native-image-source-jar/api-4.3.17_dashboard.dump.bgv
Print of Dashboard dump output ended.
Error: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected. Object has been initialized by the com.facebook.presto.jdbc.PrestoDriver class initializer with a trace:
at java.security.SecureRandom.<init>(SecureRandom.java:224)
at sun.security.ssl.SSLContextImpl.engineInit(SSLContextImpl.java:103)
at javax.net.ssl.SSLContext.init(SSLContext.java:314)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.systemDefaultSslSocketFactory(OkHttpClient.java:299)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.<init>(OkHttpClient.java:253)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:919)
at com.facebook.presto.jdbc.PrestoDriver.<init>(PrestoDriver.java:48)
at com.facebook.presto.jdbc.PrestoDriver.<clinit>(PrestoDriver.java:65)
. Try avoiding to initialize the class that caused initialization of the object. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Detailed message:
Trace: Object was reached by
reading field sun.security.ssl.SSLContextImpl.secureRandom of
constant sun.security.ssl.SSLContextImpl$TLSContext#44080492 reached by
reading field sun.security.ssl.SSLSocketFactoryImpl.context of
constant sun.security.ssl.SSLSocketFactoryImpl#36d3ab49 reached by
reading field com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.sslSocketFactory of
constant com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient#49ecd0c8 reached by
reading field com.facebook.presto.jdbc.PrestoDriver.httpClient of
constant com.facebook.presto.jdbc.PrestoDriver#6d0a2e53 reached by
reading field java.sql.DriverInfo.driver of
constant java.sql.DriverInfo#6fdaa47 reached by
indexing into array
constant java.lang.Object[]#d8e2fa6 reached by
reading field java.util.concurrent.CopyOnWriteArrayList.array of
constant java.util.concurrent.CopyOnWriteArrayList#7ff98a2e reached by
scanning method java.sql.DriverManager.getDriver(DriverManager.java:278)
------------------------------------------------------------------------------------------------------------------------
28.5s (13.8% of total time) in 67 GCs | Peak RSS: 6.86GB | CPU load: 3.36
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
/code/build/api-4.3.17-native-image-source-jar/api-4.3.17-runner.build_artifacts.txt
========================================================================================================================
Failed generating 'api-4.3.17-runner' after 3m 25s.
Call path from entry point to java.sql.DriverManager.getDriver(String):
at java.sql.DriverManager.getDriver(DriverManager.java:270)
at io.agroal.pool.ConnectionFactory.newDriver(ConnectionFactory.java:112)
at io.agroal.pool.ConnectionFactory.<init>(ConnectionFactory.java:68)
at io.agroal.pool.Poolless.<init>(Poolless.java:86)
at io.agroal.pool.DataSource.<init>(DataSource.java:35)
at io.quarkus.agroal.runtime.DataSources.doCreateDataSource(DataSources.java:192)
at io.quarkus.agroal.runtime.DataSources$1.apply(DataSources.java:112)
at io.quarkus.agroal.runtime.DataSources$1.apply(DataSources.java:109)
at sun.security.ec.ParametersMap$1.get(ParametersMap.java:78)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:169)
at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:318)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS_System_getProperty_deeeaa72a006d330408a3b7d002c7533e108bc28(generated:0)
com.oracle.svm.core.util.UserError$UserException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected. Object has been initialized by the com.facebook.presto.jdbc.PrestoDriver class initializer with a trace:
at java.security.SecureRandom.<init>(SecureRandom.java:224)
at sun.security.ssl.SSLContextImpl.engineInit(SSLContextImpl.java:103)
at javax.net.ssl.SSLContext.init(SSLContext.java:314)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.systemDefaultSslSocketFactory(OkHttpClient.java:299)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.<init>(OkHttpClient.java:253)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:919)
at com.facebook.presto.jdbc.PrestoDriver.<init>(PrestoDriver.java:48)
at com.facebook.presto.jdbc.PrestoDriver.<clinit>(PrestoDriver.java:65)
. Try avoiding to initialize the class that caused initialization of the object. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Detailed message:
Trace: Object was reached by
reading field sun.security.ssl.SSLContextImpl.secureRandom of
constant sun.security.ssl.SSLContextImpl$TLSContext#44080492 reached by
reading field sun.security.ssl.SSLSocketFactoryImpl.context of
constant sun.security.ssl.SSLSocketFactoryImpl#36d3ab49 reached by
reading field com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.sslSocketFactory of
constant com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient#49ecd0c8 reached by
reading field com.facebook.presto.jdbc.PrestoDriver.httpClient of
constant com.facebook.presto.jdbc.PrestoDriver#6d0a2e53 reached by
reading field java.sql.DriverInfo.driver of
constant java.sql.DriverInfo#6fdaa47 reached by
indexing into array
constant java.lang.Object[]#d8e2fa6 reached by
reading field java.util.concurrent.CopyOnWriteArrayList.array of
constant java.util.concurrent.CopyOnWriteArrayList#7ff98a2e reached by
scanning method java.sql.DriverManager.getDriver(DriverManager.java:278)
Call path from entry point to java.sql.DriverManager.getDriver(String):
at java.sql.DriverManager.getDriver(DriverManager.java:270)
at io.agroal.pool.ConnectionFactory.newDriver(ConnectionFactory.java:112)
at io.agroal.pool.ConnectionFactory.<init>(ConnectionFactory.java:68)
at io.agroal.pool.Poolless.<init>(Poolless.java:86)
at io.agroal.pool.DataSource.<init>(DataSource.java:35)
at io.quarkus.agroal.runtime.DataSources.doCreateDataSource(DataSources.java:192)
at io.quarkus.agroal.runtime.DataSources$1.apply(DataSources.java:112)
at io.quarkus.agroal.runtime.DataSources$1.apply(DataSources.java:109)
at sun.security.ec.ParametersMap$1.get(ParametersMap.java:78)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:169)
at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:318)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS_System_getProperty_deeeaa72a006d330408a3b7d002c7533e108bc28(generated:0)
at com.oracle.svm.core.util.UserError.abort(UserError.java:87)
at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:233)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:731)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:537)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:494)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:426)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:587)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:126)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:617)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected. Object has been initialized by the com.facebook.presto.jdbc.PrestoDriver class initializer with a trace:
at java.security.SecureRandom.<init>(SecureRandom.java:224)
at sun.security.ssl.SSLContextImpl.engineInit(SSLContextImpl.java:103)
at javax.net.ssl.SSLContext.init(SSLContext.java:314)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.systemDefaultSslSocketFactory(OkHttpClient.java:299)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.<init>(OkHttpClient.java:253)
at com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:919)
at com.facebook.presto.jdbc.PrestoDriver.<init>(PrestoDriver.java:48)
at com.facebook.presto.jdbc.PrestoDriver.<clinit>(PrestoDriver.java:65)
. Try avoiding to initialize the class that caused initialization of the object. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Detailed message:
Trace: Object was reached by
reading field sun.security.ssl.SSLContextImpl.secureRandom of
constant sun.security.ssl.SSLContextImpl$TLSContext#44080492 reached by
reading field sun.security.ssl.SSLSocketFactoryImpl.context of
constant sun.security.ssl.SSLSocketFactoryImpl#36d3ab49 reached by
reading field com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient.sslSocketFactory of
constant com.facebook.presto.jdbc.internal.okhttp3.OkHttpClient#49ecd0c8 reached by
reading field com.facebook.presto.jdbc.PrestoDriver.httpClient of
constant com.facebook.presto.jdbc.PrestoDriver#6d0a2e53 reached by
reading field java.sql.DriverInfo.driver of
constant java.sql.DriverInfo#6fdaa47 reached by
indexing into array
constant java.lang.Object[]#d8e2fa6 reached by
reading field java.util.concurrent.CopyOnWriteArrayList.array of
constant java.util.concurrent.CopyOnWriteArrayList#7ff98a2e reached by
scanning method java.sql.DriverManager.getDriver(DriverManager.java:278)
Call path from entry point to java.sql.DriverManager.getDriver(String):
at java.sql.DriverManager.getDriver(DriverManager.java:270)
at io.agroal.pool.ConnectionFactory.newDriver(ConnectionFactory.java:112)
at io.agroal.pool.ConnectionFactory.<init>(ConnectionFactory.java:68)
at io.agroal.pool.Poolless.<init>(Poolless.java:86)
at io.agroal.pool.DataSource.<init>(DataSource.java:35)
at io.quarkus.agroal.runtime.DataSources.doCreateDataSource(DataSources.java:192)
at io.quarkus.agroal.runtime.DataSources$1.apply(DataSources.java:112)
at io.quarkus.agroal.runtime.DataSources$1.apply(DataSources.java:109)
at sun.security.ec.ParametersMap$1.get(ParametersMap.java:78)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:169)
at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:318)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS_System_getProperty_deeeaa72a006d330408a3b7d002c7533e108bc28(generated:0)
at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:728)
... 6 more
Error: Image build request failed with exit status 1
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:397)
at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:238)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:882)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
at java.base/java.lang.Thread.run(Thread.java:833)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4m 34s
> Task :quarkusBuild FAILED
Watching 126 directories to track changes
Watching 127 directories to track changes
Watching 127 directories to track changes
:quarkusBuild (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 3 mins 34.587 secs.
Exception #1:
Caused by: java.sql.SQLException: Error executing query
at com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:307)
at com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:230)
at com.facebook.presto.jdbc.PrestoPreparedStatement.<init>(PrestoPreparedStatement.java:84)
at com.facebook.presto.jdbc.PrestoConnection.prepareStatement(PrestoConnection.java:142)
at io.agroal.pool.wrapper.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:659)
at org.jooq.impl.ProviderEnabledConnection.prepareStatement(ProviderEnabledConnection.java:109)
at org.jooq.impl.SettingsEnabledConnection.prepareStatement(SettingsEnabledConnection.java:82)
at org.jooq.impl.AbstractResultQuery.prepare(AbstractResultQuery.java:210)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:307)
... 21 more
Caused by: java.lang.RuntimeException: Error starting query at https://presto.company.com/v1/statement returned an invalid response: JsonResponse{statusCode=200, statusMessage=OK, headers={connection=[keep-alive], content-length=[576], content-type=[application/json], date=[Fri, 04 Mar 2022 13:05:20 GMT], strict-transport-security=[max-age=15724800; includeSubDomains], x-content-type-options=[nosniff]}, hasValue=false} [Error: {"id":"20220304_130520_46663_f6dwy","infoUri":"https://presto.company.com/ui/query.html?20220304_130520_46663_f6dwy","nextUri":"https://presto.company.com/v1/statement/queued/20220304_130520_46663_f6dwy/y10055c8764fa947438d032161e4d18444ee5f009/1","stats":{"state":"QUEUED","queued":true,"scheduled":false,"nodes":0,"totalSplits":0,"queuedSplits":0,"runningSplits":0,"completedSplits":0,"cpuTimeMillis":0,"wallTimeMillis":0,"queuedTimeMillis":0,"elapsedTimeMillis":0,"processedRows":0,"processedBytes":0,"physicalInputBytes":0,"peakMemoryBytes":0,"spilledBytes":0},"warnings":[]}
]
at com.facebook.presto.jdbc.internal.client.StatementClientV1.requestFailedException(StatementClientV1.java:497)
at com.facebook.presto.jdbc.internal.client.StatementClientV1.<init>(StatementClientV1.java:138)
at com.facebook.presto.jdbc.internal.client.StatementClientFactory.newStatementClient(StatementClientFactory.java:24)
at com.facebook.presto.jdbc.QueryExecutor.startQuery(QueryExecutor.java:46)
at com.facebook.presto.jdbc.PrestoConnection.startQuery(PrestoConnection.java:768)
at com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:263)
... 29 more
Caused by: java.lang.IllegalArgumentException: Unable to create class com.facebook.presto.jdbc.internal.client.QueryResults from JSON response:
[{"id":"20220304_130520_46663_f6dwy","infoUri":"https://presto.company.com/ui/query.html?20220304_130520_46663_f6dwy","nextUri":"https://presto.company.com/v1/statement/queued/20220304_130520_46663_f6dwy/y10055c8764fa947438d032161e4d18444ee5f009/1","stats":{"state":"QUEUED","queued":true,"scheduled":false,"nodes":0,"totalSplits":0,"queuedSplits":0,"runningSplits":0,"completedSplits":0,"cpuTimeMillis":0,"wallTimeMillis":0,"queuedTimeMillis":0,"elapsedTimeMillis":0,"processedRows":0,"processedBytes":0,"physicalInputBytes":0,"peakMemoryBytes":0,"spilledBytes":0},"warnings":[]}
]
at com.facebook.presto.jdbc.internal.client.JsonResponse.<init>(JsonResponse.java:70)
at com.facebook.presto.jdbc.internal.client.JsonResponse.execute(JsonResponse.java:144)
at com.facebook.presto.jdbc.internal.client.StatementClientV1.<init>(StatementClientV1.java:135)
... 33 more
Caused by: java.lang.IllegalArgumentException: Invalid JSON string for [simple type, class com.facebook.presto.jdbc.internal.client.QueryResults]
at com.facebook.presto.jdbc.internal.com.facebook.airlift.json.JsonCodec.fromJson(JsonCodec.java:140)
at com.facebook.presto.jdbc.internal.client.JsonResponse.<init>(JsonResponse.java:67)
... 35 more
Caused by: com.facebook.presto.jdbc.internal.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.facebook.presto.jdbc.internal.client.QueryResults` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
at [Source: (String)"{"id":"20220304_130520_46663_f6dwy","infoUri":"https://presto.company.com/ui/query.html?20220304_130520_46663_f6dwy","nextUri":"https://presto.company.com/v1/statement/queued/20220304_130520_46663_f6dwy/y10055c8764fa947438d032161e4d18444ee5f009/1","stats":{"state":"QUEUED","queued":true,"scheduled":false,"nodes":0,"totalSplits":0,"queuedSplits":0,"runningSplits":0,"completedSplits":0,"cpuTimeMillis":0,"wallTimeMillis":0,"queuedTimeMillis":0,"elapsedTimeMillis":0,"processedRows":0,"processedBytes":0,"[truncated 76 chars]; line: 1, column: 2]
at com.facebook.presto.jdbc.internal.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1589)
at com.facebook.presto.jdbc.internal.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1055)
at com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1297)
at com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)
at com.facebook.presto.jdbc.internal.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
at com.facebook.presto.jdbc.internal.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1719)
at com.facebook.presto.jdbc.internal.jackson.databind.ObjectReader.readValue(ObjectReader.java:1261)
at com.facebook.presto.jdbc.internal.com.facebook.airlift.json.JsonCodec.fromJson(JsonCodec.java:137)
... 36 more
Exception #N:
....
To fix the GraalVM native build error add the following properties quarkus.native.additional-build-args and quarkus.native.add-all-charsets to src/main/resources/application.properties (standard Quarkus properties):
quarkus.native.add-all-charsets=true
quarkus.native.additional-build-args=--initialize-at-run-time=com.facebook.presto.jdbc.PrestoDriver
or src/main/resources/application.yaml (when extension quarkus-config-yaml is used):
quarkus:
native:
add-all-charsets: true
additional-build-args: --initialize-at-run-time=com.facebook.presto.jdbc.PrestoDriver
To fix the native mode runtime exceptions add an empty class annotated with bean #RegisterForReflection (the name of the class does not matter with the following content.
Basically all classes of Presto DB JDBC package com.facebook.presto.jdbc.internal.client are using Jackson internally and therefore need to be registered for reflection.
package com.company.api.graal;
import io.quarkus.runtime.annotations.RegisterForReflection;
/**
* #author ThoSap
*/
#RegisterForReflection(targets = {
com.facebook.presto.jdbc.internal.client.ClientException.class,
com.facebook.presto.jdbc.internal.client.ClientSession.class,
com.facebook.presto.jdbc.internal.client.ClientTypeSignature.class,
com.facebook.presto.jdbc.internal.client.ClientTypeSignatureParameter.class,
com.facebook.presto.jdbc.internal.client.ClientTypeSignatureParameter.ClientTypeSignatureParameterDeserializer.class,
com.facebook.presto.jdbc.internal.client.Column.class,
com.facebook.presto.jdbc.internal.client.ErrorLocation.class,
com.facebook.presto.jdbc.internal.client.FailureInfo.class,
com.facebook.presto.jdbc.internal.client.GCSOAuthInterceptor.class,
com.facebook.presto.jdbc.internal.client.GCSOAuthScope.class,
com.facebook.presto.jdbc.internal.client.IntervalDayTime.class,
com.facebook.presto.jdbc.internal.client.IntervalYearMonth.class,
com.facebook.presto.jdbc.internal.client.JsonResponse.class,
com.facebook.presto.jdbc.internal.client.KerberosUtil.class,
com.facebook.presto.jdbc.internal.client.NodeVersion.class,
com.facebook.presto.jdbc.internal.client.OkHttpUtil.class,
com.facebook.presto.jdbc.internal.client.OkHttpUtil.NullCallback.class,
com.facebook.presto.jdbc.internal.client.PrestoHeaders.class,
com.facebook.presto.jdbc.internal.client.QueryData.class,
com.facebook.presto.jdbc.internal.client.QueryError.class,
com.facebook.presto.jdbc.internal.client.QueryResults.class,
com.facebook.presto.jdbc.internal.client.QueryStatusInfo.class,
com.facebook.presto.jdbc.internal.client.ServerInfo.class,
com.facebook.presto.jdbc.internal.client.SocketChannelSocketFactory.class,
com.facebook.presto.jdbc.internal.client.SpnegoHandler.class,
com.facebook.presto.jdbc.internal.client.StageStats.class,
com.facebook.presto.jdbc.internal.client.StageStats.Builder.class,
com.facebook.presto.jdbc.internal.client.StatementClient.class,
com.facebook.presto.jdbc.internal.client.StatementClientFactory.class,
com.facebook.presto.jdbc.internal.client.StatementStats.class,
com.facebook.presto.jdbc.internal.client.StatementStats.Builder.class
})
public class PrestoDBReflection {
}

How to fix “The libsDir method has been deprecated.” when it isn't used?

When running our gradle build (using gradle 6.8.3), we get:
> Configure project :buildSrc
The Project.libsDir property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the libsDirectory property instead. See https://docs.gradle.org/6.8.3/dsl/org.gradle.api.Project.html#org.gradle.api.Project:libsDir for more details.
at org.gradle.api.plugins.internal.DefaultBasePluginConvention.getLibsDir(DefaultBasePluginConvention.java:76)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:59)
at org.gradle.internal.extensibility.DefaultConvention$ExtensionsDynamicObject.getProperties(DefaultConvention.java:248)
at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.getProperties(BasicScript.java:116)
at org.gradle.groovy.scripts.BasicScript.getProperties(BasicScript.java:75)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:59)
at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryGetProperty(BasicScript.java:143)
at org.gradle.groovy.scripts.BasicScript.getProperty(BasicScript.java:66)
at ArtifactoryExtensions_76dew9e82ctadr6jidn6q1of1.getGradleProperty(ourstuff/buildSrc/src/main/groovy/ArtifactoryExtensions.groovy:50)
This is the corresponding method in that groovy file.
String getGradleProperty(String key) {
if (properties[key]) { // this is line 50
return properties[key]
}
throw new GradleException("key '$key' is NOT defined in any gradle.properties file!")
}
As you can see: line 50 uses (the project) properties, but not libsDir. I did a git grep libsDir, and that shows zero usages of libsDir in our whole repository.
So: how do I get our build warning-free for warnings that don't relate to my code, at least not in a way that gives any clues how to fix the problem?
Note: I tried to create a mcve, but unfortunately, when just defining+using that method in a standalone build.gradle file, no warnings.
try project.getProperties() instead of properties
the reason of issue that properties tries to get/collect properties on current object that could be task or something else.
project.getProperties() - clearly takes properties on project
object.getProperties() - if object does not contain properties or getProperties() groovy tries to scan all internal object properties and hits deprecated property

JavaDoc - Undeclared Type Variable

I think everybody who has to work with Maven and Java8 knows of this bug that release builds suddenly fail for spelling mistakes in JavaDoc. As a company we decided to let some poor sap (aka me) work all of them out. Now I'm stuck with the following "error":
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.1:javadoc (default-cli) on project org.acme.project.demo: An error has occurred in JavaDocs report generation:
[ERROR] Exit code: 1 - C:\jenkins\workspace\Project 2.0\org.acme.project.demo\src\main\java\org\acme\project\demo\SomeClass.java:36: error: cannot access OtherClass
[ERROR] import org.acme.project.OtherClass;
[ERROR] ^
[ERROR] bad class file: C:\jenkins\workspace\Project 2.0\org.acme.project\target\org.acme.project-2.0.0-SNAPSHOT-v20150128-1503.jar(org/acme/project/OtherClass.class)
[ERROR] undeclared type variable: N
[ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.
I tried to clean it up a bit, but to summarize: Project B throws the exception when it tries to resolve a method call to Project A (yes, while generating JavaDoc!). The method in question looks like that:
public static <N extends Bean> void hookContinousImageFunction(final OtherClass<N> dialog,
final ImageGroup imageGroup, N model, final BiFunction<Image, N, ? extends Image> imageFunction) {
final Image original = imageGroup.getImage();
dialog.setOnCancelClick((notUsed) -> imageGroup.setImage(original));
model.addPropertyChangeListener(new ContinousImageFunctionListener<>(dialog, imageGroup, imageFunction));
dialog.setInitialModel(model);
}
It doesn't even have JavaDoc (not that any of this should matter when the generation of Project A's JavaDoc is already finished, and Maven is trying to generate JavaDoc for Project B).
As of now, we have this bug in multiple projects, about 1 out of 5. Project A (the one with a typed method / class like above) is more often than not in an entirely different build reactor and sometimes completely out of our control.
How do I fix this bug inside a bug?
(As a as a side note, the error occurs on the Jenkin's running with Java 1.8.0_31 and jdk1.8.0_40 or locally with 1.8.0_45, 1.8.0_60, but not locally with 1.8.0_20, but JavaDoc generation hasn't been that reliable, so I can't say for sure it has something to do with the Java version.)
I got the same kind of error message using a central build while having no problems in my local build. (Unfortunately I have no details about the central build environment.)
Adding a '#param ' explanation in the JavaDoc comment for the static method in question solved the issue. Adapted to the given example I did something like this:
/**
* #param <N> This is the class that ...
*/
public static <N extends Bean> void hookContinuousImageFunction(...)
Okay the answer is to a) downgrade Java to 1.8.0_20, or - if that is not possible - b) to use this code in the pom.xml to disable JavaDoc of the project until the Java people feel the need to fix the bug:
<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>

NoSuchMethodError when the method obviously exists

20:15:43 [INFO] macintosh264 issued server command: /sell hand
20:15:43 [INFO] [XYZShop] MacCommand sell executed
20:15:43 [SEVERE] null
org.bukkit.command.CommandException: Unhandled exception executing command 'sell' in plugin XYZShop v0.1.3
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:186)
at org.bukkit.craftbukkit.v1_4_6.CraftServer.dispatchCommand(CraftServer.java:510)
at net.minecraft.server.v1_4_6.PlayerConnection.handleCommand(PlayerConnection.java:979)
at net.minecraft.server.v1_4_6.PlayerConnection.chat(PlayerConnection.java:897)
at net.minecraft.server.v1_4_6.PlayerConnection.a(PlayerConnection.java:852)
at net.minecraft.server.v1_4_6.Packet3Chat.handle(Packet3Chat.java:44)
at net.minecraft.server.v1_4_6.NetworkManager.b(NetworkManager.java:290)
at net.minecraft.server.v1_4_6.PlayerConnection.d(PlayerConnection.java:112)
at net.minecraft.server.v1_4_6.ServerConnection.b(SourceFile:39)
at net.minecraft.server.v1_4_6.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:598)
at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224)
at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:494)
at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
Caused by: java.lang.NoSuchMethodError: dev.xyzcraft.net.database.DatabaseHandler.getItem(IS)Ldev/xyzcraft/net/xyzshop/dataObject/MSItem;
at dev.xyzcraft.net.xyzshop.commands.SellCommand.onCommand(SellCommand.java:63)
at dev.xyzcraft.net.xyzshop.util.MacCommand.onCommand(MacCommand.java:44)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
... 15 more
I get that exception
here's the code:
https://github.com/macintosh264/XYZShop
Lastly, I'm using a Mod API for a popular video game, Minecraft, entitled Bukkit. Here's the JavaDoc, and library
http://dl.bukkit.org/downloads/bukkit/
http://jd.bukkit.org
"I also have this problem with another project that uses MySQL, and the stack trace occurs WHENEVER the mysql class is used. "
Macintosh264
It seems like whatever your trying to execute (i.e.the method that holds the command) isn't reading it properly. Try re-packaging your project, it's happened to me many times and that is usually an easy fix.

Categories