Jbpm 6.2.0 Could not instantiate DroolsSpringTransactionManager - java

I am working on getting jbpm 6.2.0 to work with spring-boot and oracle, starting with the example from here: https://github.com/mswiderski/jbpm-examples/tree/master/spring-boot-jbpm
I hit a wall right now and get the error: Could not instantiate DroolsSpringTransactionManager when starting up the app. After some investigation, it seems that this is caused by a RuntimeException in the class org.jbpm.services.task.persistence.TaskTransactionInterceptor (in jbpm-human-task-jpa-6.2.0.Final.jar):
Caused by: java.lang.RuntimeException: Could not instantiate org.kie.container.spring.beans.persistence.DroolsSpringTransactionManager
at org.jbpm.services.task.persistence.TaskTransactionInterceptor.initTransactionManager(TaskTransactionInterceptor.java:164)
at org.jbpm.services.task.persistence.TaskTransactionInterceptor.(TaskTransactionInterceptor.java:41)
... 61 more
I took a look at the code in TaskTransactionInterceptor.java in github, the class is using a factory class called org.drools.persistence.TransactionManagerFactory which does not seem to exist in drools-persistence-jpa-6.2.0.Final.jar... I am at a lost here. Would like to know if there is a work-around or should I go back to an earlier jbpm version? Or am I doing something totally wrong?

Related

Could not initialize class sun.security.jca.ProviderConfig$ProviderLoader

Springboot occassionally occur following errors:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.security.jca.ProviderConfig$ProviderLoader
at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:244)
at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:238)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:238)
at java.base/sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:218)
at java.base/sun.security.jca.ProviderList.getProvider(ProviderList.java:266)
at java.base/sun.security.jca.ProviderList$ServiceList.tryGet(ProviderList.java:511)
at java.base/sun.security.jca.ProviderList$ServiceList$1.hasNext(ProviderList.java:565)
at java.base/javax.crypto.SecretKeyFactory.nextSpi(SecretKeyFactory.java:301)
at java.base/javax.crypto.SecretKeyFactory.<init>(SecretKeyFactory.java:121)
at java.base/javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:168)
at com.kingbase8.shaded.com.ongres.scram.common.ScramMechanisms.saltedPassword(ScramMechanisms.java:155)
at com.kingbase8.shaded.com.ongres.scram.common.ScramFunctions.saltedPassword(ScramFunctions.java:59)
at com.kingbase8.shaded.com.ongres.scram.client.ScramSession$ClientFinalProcessor.<init>(ScramSession.java:196)
at com.kingbase8.shaded.com.ongres.scram.client.ScramSession$ClientFinalProcessor.<init>(ScramSession.java:163)
at com.kingbase8.shaded.com.ongres.scram.client.ScramSession$ServerFirstProcessor.clientFinalProcessor(ScramSession.java:130)
JDK information as following:
enter image description here
Ah, please try to search the log, it is possible a ExceptionInInitializerError was happened before, so this time the JVM throws NoClassDefFoundError directly because it was failed last time.
Need to get the call stack of the original ExceptionInInitializerError (if it exists) in order to fix this issue.
Related codes and links
https://github.com/openjdk/jdk11u/blob/jdk-11+28/src/java.base/share/classes/sun/security/jca/ProviderConfig.java#L308 - the class ProviderConfig$ProviderLoader was defined inside OpenJDK 11 so it is not likely to a Java classpath issue
https://stackoverflow.com/a/5756989/2412606 - See definition of NoClassDefFoundError here. thanks to #oldpeculier and #jared
For this problem not very clear why occur. in order to fix the problem. we can manual use Security.addSecurity method to load jca or analogous component again. like BouncyCastle. now it work fine for me.
I was using Java 11 and the project was build using Java 1.8. Once I switched to Java 1.8 it worked fine

Bundle exception

I am doing some maintenance to a JAVA backend written using bundles. When running the code after doing some software upgrade, I get that error at first:
! java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.registerService (Ljava/lang/Class;Lorg/osgi/framework/ServiceFactory;Ljava/util/Dictionary;) Lorg/osgi/framework/ServiceRegistration;
When running it a second time, it gives me the following error:
! java.lang.NoClassDefFoundError: Could not initialize class com.sap.hilo.orchestration.workspace.HiloWorkspaceFactory
Then, it keeps showing the second error for any extra code runs. Any clues how resolve this issue?
Regarding:
java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.registerService
I found an answer to a similar question here: OSGi: servicereference.getBundle().getVersion() - No such method error
In the Import-Package section of the pom.xml file you'll need to change the org.osgi.framework version to at least 1.6 or give it a range [1.6,2.0)

After upgrading to new Jenkins version, builds are failing

I just upgraded the jenkins from 2.63 to 2.117 (Which I'm regretting now)
Here is the error message I'm getting at the end of all the jobs.
Please help me to understand and resolve this.
FATAL: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild
java.lang.UnsupportedOperationException: Refusing to marshal java.io.PrintStream for security reasons; see https://jenkins.io/redirect/class-filter/
at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:543)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.EnvironmentVarSetter#log for class org.jenkinsci.plugins.EnvironmentVarSetter
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
Caused: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
at hudson.XmlFile.write(XmlFile.java:193)
Caused: java.io.IOException
at hudson.XmlFile.write(XmlFile.java:200)
at hudson.model.Run.save(Run.java:1923)
at hudson.model.Run.setDisplayName(Run.java:803)
at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setDisplayName(BuildNameSetter.java:76)
at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.access$000(BuildNameSetter.java:31)
at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter$1.tearDown(BuildNameSetter.java:64)
at hudson.model.Build$BuildExecution.doRun(Build.java:174)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1727)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Note: Others who are using older version of jenkins, there is a big chance that all your jobs will be messed up. So, Please do not update jenkins as of now. (https://jenkins.io/blog/2018/03/15/jep-200-lts/)
You can try the solution given in the official site of Jenkins
https://issues.jenkins-ci.org/browse/JENKINS-49144
Add the three following entries to whitelisted-classes.txt:
java.util.concurrent.locks.ReentrantLock
java.util.concurrent.locks.ReentrantLock$NonfairSync
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
It is to do with the two things.
Permission to be updated to the .war file.
Build Pipeline plugin needs to be updated.
This solved my problem.
It's a known security fix in Jenkins https://github.com/jenkinsci/jep/tree/master/jep/200.
You can check list of affected plugins https://wiki.jenkins.io/display/JENKINS/Plugins+affected+by+fix+for+JEP-200 and upgrade your affected ones to overcome the error.

JDK 8u161 breaks JMX Integration

I'm working with a piece of code that's quite old. It works absolutely fine with the versions of Java older than 8u161.
This is the error I get on 8u161 and beyond releases.
[main] ******** - Failed to create JmxConnectInfo!
java.lang.AbstractMethodError
at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:150)
at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:135)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:405)
This error is triggered from a class that extends javax.management.remote.rmi.RMIConnectorServer where I invoke the code
super.start()
I'm sure that this error is caused by JDK-8159377 but I'm unable to figure a way out!
Can someone pls advise?

WAS 8.0(beta version) | unable to parse the MBean descriptor file

Getting this exception unable to find the reason why? Has anybody seen this before? I am running my application in WAS 8.0(beta version).
com.ibm.websphere.management.exception.DescriptorParseException: ADMN0001W: The service is unable to parse the MBean descriptor file
com/ahold/ers/dcr/common/jmx/mbeans/impl\SpringContextMBean.xml. at
com.ibm.ws.management.descriptor.MBeanDescriptorManager.loadDescriptorFile(MBeanDescriptorManager.java:411)
at
com.ibm.ws.management.descriptor.MBeanDescriptorManager.getDescriptor(MBeanDescriptorManager.java:190)
at
com.ibm.ws.management.MBeanFactoryImpl.activateMBean(MBeanFactoryImpl.java:458)
Caused by: java.io.FileNotFoundException: mbeans\AlertHibernateManagerMBean.xml
The forums on the net say i would need to change the JDK and point it to the one provided with WAS 8.0(beta version). Didn't understand this either. I am trying to migrate JavaEE 5 compliant code to WAS 8.0(beta version) (Java EE6). It should happen smoothly i guess as JVM is backward compatible. I hope i wouldn't need to recompile my code with Java EE6 just to make it work with WAS8. Is my understanding correct?

Categories