What is the jackson compatability for Jooq 3.14.6? - jackson

I am trying to upgrade jackson to 2.13.4 from 2.12.6 due to CVE-2022-42004. I am using jooq 3.14.6.
With jackson 2.13.4 I am getting the below exception
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.exc.StreamWriteException
at java.net.URLClassLoader.findClass (URLClassLoader.java:471)
at java.lang.ClassLoader.loadClass (ClassLoader.java:589)
at java.lang.ClassLoader.loadClass (ClassLoader.java:522)
at java.lang.Class.getDeclaredMethods0 (Native Method)
at java.lang.Class.privateGetDeclaredMethods (Class.java:3166)
at java.lang.Class.getMethodsRecursive (Class.java:3307)
at java.lang.Class.getMethod0 (Class.java:3293)
at java.lang.Class.getMethod (Class.java:2106)
at org.jooq.tools.Convert.<clinit> (Convert.java:198)
at org.jooq.impl.DefaultConverterProvider$1.from (DefaultConverterProvider.java:126)
at org.jooq.impl.AbstractRecord.get (AbstractRecord.java:285)
at org.jooq.impl.AbstractRecord.get (AbstractRecord.java:300)
at org.jooq.meta.h2.H2Database.getTables0 (H2Database.java:468)
at org.jooq.meta.AbstractDatabase$7.run (AbstractDatabase.java:1673)
at org.jooq.meta.AbstractDatabase.onError (AbstractDatabase.java:3094)
at org.jooq.meta.AbstractDatabase.getTables (AbstractDatabase.java:1670)
at org.jooq.meta.AbstractDatabase.getEmbeddables0 (AbstractDatabase.java:1957)
at org.jooq.meta.AbstractDatabase.access$1100 (AbstractDatabase.java:124)
at org.jooq.meta.AbstractDatabase$9.run (AbstractDatabase.java:1915)
at org.jooq.meta.AbstractDatabase.onError (AbstractDatabase.java:3094)
at org.jooq.meta.AbstractDatabase.getEmbeddables (AbstractDatabase.java:1912)
at org.jooq.meta.AbstractDatabase.getEmbeddables (AbstractDatabase.java:1935)
at org.jooq.codegen.JavaGenerator.generateSchemaIfEmpty (JavaGenerator.java:493)
at org.jooq.codegen.JavaGenerator.generateCatalogIfEmpty (JavaGenerator.java:481)
at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:435)
at org.jooq.codegen.GenerationTool.run0 (GenerationTool.java:879)
at org.jooq.codegen.GenerationTool.run (GenerationTool.java:233)
at org.jooq.codegen.GenerationTool.generate (GenerationTool.java:228)
at com.spotnana.analytics.snowflake.JooqBindingsGenerator.generateBindings (JooqBindingsGenerator.java:60)
at com.spotnana.analytics.snowflake.JooqBindingsGenerator.main (JooqBindingsGenerator.java:108)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:829)
Is there any compatibility matrix for Jooq and jackson? What is the minimum Jooq version which works with jackson 2.13.4?

You can check the jooq-parent project to see which version are used:
https://search.maven.org/artifact/org.jooq/jooq-parent/3.17.4/pom
<jackson.version>2.13.3</jackson.version>
jOOQ 3.17.5 supports Jackson 2.13.4

Related

Kotlin java.lang.ArrayIndexOutOfBoundsException:448

I am learning Kotlin but my computer so bad to use Intellij. I downladed VSCODE and I followed all steps. I mean Code Runner, Kotlin Language extension and add to path. But when I run to code any code. Like this
fun fun main(args: Array<String>) {
print("Hello")
}
Vscode return this message
exception: java.lang.ArrayIndexOutOfBoundsException: 448
at org.jetbrains.org.objectweb.asm.ClassReader.readUnsignedShort(ClassReader.java:2464)
at org.jetbrains.org.objectweb.asm.ClassReader.readUTF8(ClassReader.java:2525)
at org.jetbrains.org.objectweb.asm.ClassReader.readModule(ClassReader.java:761)
at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:646)
at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:507)
at org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleInfo$Companion.read(JavaModuleInfo.kt:67)
at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder.findSystemModule(CliJavaModuleFinder.kt:44)
at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder.access$findSystemModule(CliJavaModuleFinder.kt:25)
at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder$systemModules$1.invoke(CliJavaModuleFinder.kt:37)
at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder$systemModules$1.invoke(CliJavaModuleFinder.kt:25)
at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:149)
at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:109)
at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:133)
at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:254)
at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:241)
at kotlin.sequences.SequencesKt___SequencesKt.none(_Sequences.kt:1239)
at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.addModularRoots(ClasspathRootsResolver.kt:227)
at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.computeRoots(ClasspathRootsResolver.kt:124)
at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.convertClasspathRoots(ClasspathRootsResolver.kt:79)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:230)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:114)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:409)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:286)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createEnvironmentWithScriptingSupport(K2JVMCompiler.kt:276)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:196)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:63)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:109)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:53)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:92)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:70)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:36)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:157)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:148)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:343)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.jetbrains.kotlin.preloading.Preloader.run(Preloader.java:81)
at org.jetbrains.kotlin.preloading.Preloader.main(Preloader.java:43)
What Java version do you use? Try java -version to see that. You may probably need Java 11 (or 8). Also, I see fun fun in the code snippet, probably a typoe
I found that related issue for that
https://youtrack.jetbrains.com/issue/KT-21303
Try using the fresh version of Kotlin compiler, e.g. 1.3.21
You can try updating your kotlin version. I had the same issue with the error below using Intellij. I updated Kotlin plugin from a version 1.2. something to 1.3.11 and the hello world code was able to run.
Error:Kotlin: [Internal Error] java.lang.ArrayIndexOutOfBoundsException: 10883
at org.jetbrains.org.objectweb.asm.ClassReader.readUnsignedShort
(ClassReader.java:2464)
at org.jetbrains.org.objectweb.asm.ClassReader.readUTF8(ClassReader.java:2525)
at org.jetbrains.org.objectweb.asm.ClassReader.readModule(ClassReader.java:761)
.......

How can I register classes to Kryo Serializer in Apache Spark?

I am using Spark 1.6.1 and Python. How can I enable Kryo serialization when working with PySpark?
I have the following settings in the spark-default.conf file:
spark.eventLog.enabled true
spark.eventLog.dir //local_drive/sparkLogs
spark.default.parallelism 8
spark.locality.wait.node 5s
spark.executor.extraJavaOptions -XX:+UseCompressedOops
spark.serializer org.apache.spark.serializer.KryoSerializer
spark.kryo.classesToRegister Timing, Join, Select, Predicate, Timeliness, Project, Query2, ScanSelect
spark.shuffle.compress true
And the following error:
py4j.protocol.Py4JJavaError: An error occurred while calling o35.load.
: org.apache.spark.SparkException: Failed to register classes with Kryo
at org.apache.spark.serializer.KryoSerializer.newKryo(KryoSerializer.scala:128)
at org.apache.spark.serializer.KryoSerializerInstance.borrowKryo(KryoSerializer.scala:273)
at org.apache.spark.serializer.KryoSerializerInstance.<init>(KryoSerializer.scala:258)
at org.apache.spark.serializer.KryoSerializer.newInstance(KryoSerializer.scala:174)
Caused by: java.lang.ClassNotFoundException: Timing
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.spark.serializer.KryoSerializer$$anonfun$newKryo$4.apply(KryoSerializer.scala:120)
at org.apache.spark.serializer.KryoSerializer$$anonfun$newKryo$4.apply(KryoSerializer.scala:120)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at org.apache.spark.serializer.KryoSerializer.newKryo(KryoSerializer.scala:120)
The main class contains (Query2.py):
from Timing import Timing
from Predicate import Predicate
from Join import Join
from ScanSelect import ScanSelect
from Select import Select
from Timeliness import Timeliness
from Project import Project
conf = SparkConf().setMaster(master).setAppName(sys.argv[1]).setSparkHome("$SPARK_HOME")
sc = SparkContext(conf=conf)
conf.set("spark.kryo.registrationRequired", "true")
sqlContext = SQLContext(sc)
I know that "Kryo won’t make a major impact on PySpark because it just stores data as byte[] objects, which are fast to serialize even with Java. But it may be worth a try to set spark.serializer and not try to register any classes"(Matei Zaharia, 2014). However, I need to register the classes.
Thanks in advance.
It is not possible. Kryo is a Java (JVM) serialization framework. It cannot be used with Python classes. To serialize Python object PySpark is using Python serialization tools including standard pickle module and improved version of coludpickle. You can find some additional information about PySpark serialization in Tips for properly using large broadcast variables?.
Sp while you can enable Kryo serialization when working with PySpark, this won't affect the way how Python objects are serialized. It will be used only for serialization of Java or Scala objects.

HSQLDB throws Asset failed exception and file io error on db.script.new file during Checkpoint

Our application is a Java based desktop application which will download the binary data from the source, parses it and add it to HSQLDB database. When downloading from the sources individually, application works perfectly. But when doing the same from multiple sources simultaneously with each source in an individual thread, I am getting an error of
java.sql.SQLException: Assert failed: java.lang.ArrayIndexOutOfBoundsException: 23 in statement [CHECKPOINT]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.execute(Unknown Source)
or sometimes,
java.sql.SQLException: Assert failed: java.lang.ArrayIndexOutOfBoundsException: 1016 in statement [CHECKPOINT]
followed by
java.sql.SQLException: File input/output error: C:\ProgramData\test\data\database\db.script.new in statement [CHECKPOINT]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.execute(Unknown Source)
Java: 1.8;
HSQL version: 1.8.10
We are not in the position to migrate the HSQLDB to latest version because of various reasons.
HSQL Properties:
hsqldb.script_format=0
runtime.gc_interval=0
sql.enforce_strict_size=false
hsqldb.cache_size_scale=8
readonly=false
hsqldb.nio_data_file=true
hsqldb.cache_scale=14
version=1.8.0
hsqldb.default_table_type=memory
hsqldb.cache_file_scale=1
hsqldb.log_size=200
modified=yes
hsqldb.cache_version=1.7.0
hsqldb.original_version=1.8.0
hsqldb.compatible_version=1.8.0
Any help or hint will be appreciated.
This is an 7 year old version which is not ideal for multi-threaded usage.
The simple solution is to perform the database updates with a single thread. You can retrofit your multi-threaded application with a synchronized block over a singleton object around the code that performs the database update.

java.lang.VerifyError: JVMVRFY007 final method overridden; class=com/google/common/collect/NullsLastOrdering

I am in the process of migrating an application from WAS 7 to WAS 8.5. I get the following error during application start up. The error is regarding guava library and the project is using guava-1.5.jar. I am not sure if its an issue with the particular version I am using. I would be glad if someone could throw some light on this issue.
Caused by: java.lang.VerifyError: JVMVRFY007 final method overridden; class=com/google/common/collect/NullsLastOrdering, method=reverse()Lcom/google/common/collect/Ordering;, pc=0
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:262)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:853)
at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:763)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:586)
at java.lang.ClassLoader.loadClass(ClassLoader.java:627)
at com.ibm.ws.webbeans.services.ScannerServiceImpl.convertClassNamesToClass(ScannerServiceImpl.java:490)
at com.ibm.ws.webbeans.services.ScannerServiceImpl.ecsScan(ScannerServiceImpl.java:422)
at com.ibm.ws.webbeans.services.ScannerServiceImpl.populateBeans(ScannerServiceImpl.java:231)
at com.ibm.ws.webbeans.services.ScannerServiceImpl.populateBeans(ScannerServiceImpl.java:241)
at com.ibm.ws.webbeans.services.JCDIComponentImpl.populateOneDeployedObject(JCDIComponentImpl.java:331)
at com.ibm.ws.webbeans.services.JCDIComponentImpl.isJCDIEnabled(JCDIComponentImpl.java:835)
at com.ibm.ws.jaxrs.metadata.JAXRSServerMetaDataBuilder.buildJAXRSMetaData(JAXRSServerMetaDataBuilder.java:72)
at com.ibm.ws.jaxrs.component.JAXRSComponentImpl.stateChanged(JAXRSComponentImpl.java:269)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1118)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1353)
at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:248)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:636)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
... 62 more
Guava's Ordering#reverse method has never been final in any Guava release. It's only been final in a very, very old version of Google Collections: https://code.google.com/p/google-collections/source/diff?r=98&old=92&path=/trunk/src/com/google/common/collect/Ordering.java
So you should look for google-collect*.jar in your classpath and get rid of it. It really has no purpose for existence any more.

EclipseLink static weaved entities breaks remove of an entity operation

I successfully performed static weaving in EclipseLink-2.4.0 with eclipselink-staticweave-maven-plugin 1.0.3 , but when I also run integration tests. going through all layers in the system, they breaks. In startUp() method I create it's created an User entity which it's committed in the test DB. But in tearDown() method where I clear the DB state that entity (already weaved) could not be removed by same EntityManager.
The test goes without errors when entities are not weaved. What do you think the problem could be here ?
Here the exception status also:
java.lang.AbstractMethodError: nl.innovity.youbank.core.entity.user.User._persistence_setCacheKey(Lorg/eclipse/persistence/internal/identitymaps/CacheKey;)V
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.updateCachedAttributes(ObjectBuilder.java:3790)
at org.eclipse.persistence.internal.sessions.MergeManager.mergeChangesOfWorkingCopyIntoOriginal(MergeManager.java:871)
at org.eclipse.persistence.internal.sessions.MergeManager.mergeChangesOfWorkingCopyIntoOriginal(MergeManager.java:687)
at org.eclipse.persistence.internal.sessions.MergeManager.mergeChanges(MergeManager.java:307)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.mergeChangesIntoParent(UnitOfWorkImpl.java:3260)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.mergeChangesIntoParent(RepeatableWriteUnitOfWork.java:369)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:283)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1147)
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
at nl.innovity.youbank.core.dao.DBManager.reinitDB(DBManager.java:510)
at nl.innovity.youbank.core.integration.IntegrationTest.tearDown(IntegrationTest.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Thanks in advance,
Simeon
It looks like a problem with the configuratoin of the maven static weaving - it is using a different EclipseLink version than 2.4 version you are running against. Looking at the doc you linked, it is set by default to use EclipseLink 2.3.2: I believe EclipseLink 2.4 changed to add the _persistence_setCacheKey method to the PersistenceEntity used in weaving. This method will be missing if you weaving using EclipseLink 2.3.2.
You will need to change the dependencies list to point to EclipseLink 2.4 as the doc you linked to described (where it refers to using 2.3.X versions other than 2.3.2).