Byte Buddy 1.11.1 has problem with Android - byte-buddy

I am using Byte Buddy in Android and I switched from version 1.10.17 to 1.11.1 but I noticed the new version has problems and is giving me the error:
Caused by: java.lang.IllegalStateException: Failed to resolve the class file version of the current VM: This JVM's version string does not seem to be valid: 0
at net.bytebuddy.ClassFileVersion$VersionLocator$Unresolved.resolve(ClassFileVersion.java:558)
at net.bytebuddy.ClassFileVersion.ofThisVm(ClassFileVersion.java:276)
at net.bytebuddy.description.method.ParameterList$ForLoadedExecutable.of(ParameterList.java:205)
at net.bytebuddy.description.method.MethodDescription$ForLoadedMethod.getParameters(MethodDescription.java:1179)
at net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.compile(TargetMethodAnnotationDrivenBinder.java:82)
at net.bytebuddy.implementation.MethodDelegation$ImplementationDelegate$ForStaticMethod.of(MethodDelegation.java:948)
at net.bytebuddy.implementation.MethodDelegation$WithCustomProperties.to(MethodDelegation.java:1512)
at net.bytebuddy.implementation.MethodDelegation$WithCustomProperties.to(MethodDelegation.java:1493)
at net.bytebuddy.implementation.MethodDelegation.to(MethodDelegation.java:271)
... 34 more
any idea why this is and what can I do ?

This problem is fixed on the master branch of Byte Buddy and will be solved with version 1.11.2. The issue is indeed that Android issues version number 0 which is not correctly processed.

Related

Cannot load native library libLiteCore.dylib on M1

I'm trying to build a JVM application (mostly Kotlin) on my M1 MacBook that uses CouchbaseLite.
I have this in my build.gradle file:
implementation "com.couchbase.lite:couchbase-lite-java:3.0.0-beta02"
(also tried it with a non-beta version 2.8.4)
Gradle sync + build is fine but everytime I run the up and try to create a database
db = Database(LOCAL_DB_NAME, config)
I get the following error:
java.lang.IllegalStateException: Cannot load native library libLiteCore.dylib #/Users/ale/Projects/server/CouchbaseLiteTemp/5e3b1711cace9de693b3e1e0bea0f2f8/libLiteCore.dylib for Mac OS X/aarch64
at com.couchbase.lite.internal.NativeLibrary.load(NativeLibrary.java:113)
at com.couchbase.lite.internal.CouchbaseLiteInternal.init(CouchbaseLiteInternal.java:80)
at com.couchbase.lite.CouchbaseLite.init(CouchbaseLite.java:54)
at com.couchbase.lite.CouchbaseLite.init(CouchbaseLite.java:42)
at com.couchbase.lite.CouchbaseLite.init(CouchbaseLite.java:33)
at de.ihaus.Main.Database.CouchbaseManager.initContext(CouchbaseManager.kt:34)
at de.ihaus.Main.Dingo$main$1.invoke(Dingo.kt:15)
at de.ihaus.Main.Dingo$main$1.invoke(Dingo.kt:14)
at de.ihaus.Main.Login.LoginManager.onLoginSuccess(LoginManager.kt:64)
at de.ihaus.Main.Login.LoginManager$LoginWorker.run(LoginManager.kt:53)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.UnsatisfiedLinkError: /Users/ale/Projects/server/CouchbaseLiteTemp/5e3b1711cace9de693b3e1e0bea0f2f8/libLiteCore.dylib: dlopen(/Users/ale/Projects/server/CouchbaseLiteTemp/5e3b1711cace9de693b3e1e0bea0f2f8/libLiteCore.dylib, 0x0001): tried: '/Users/ale/Projects/server/CouchbaseLiteTemp/5e3b1711cace9de693b3e1e0bea0f2f8/libLiteCore.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libLiteCore.dylib' (no such file)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
I've looked around but CouchbaseLite is supposed to work on an M1.
What am I doing wrong?
Turns out the problem was the Apple Silicon version of the JDK.
If I run the project with an x86_64 version of the JDK, Rosetta kicks in and it works. Will have to live with the performance hit for now, but at least I'm not blocked anymore.
Unfortunately, CBL-Java doesn't support Native Mac M1 yet.

AxisFault at org.apache.axis2.AxisFault.makeFault

I have an error when running axis client, i'm using axis2 version 1.7.7
org.apache.axis2.AxisFault
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:123)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at ch.e_dec.www.services.edecservice.v2.ServiceStub.goodsDeclarations(EdecServiceStub.java:339)
at ch.e_dec.www.services.edecservice.EdecClient.main(EdecClient.java:318)
Caused by: java.lang.NullPointerException
at org.apache.axis2.builder.MIMEBuilder.processDocument(MIMEBuilder.java:78)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108)
I have checked with axis2 1.4.1 version , there is no issue found , And for upgrading axis version same code has done with latest version 1.7.7
In 1.4.1 version it was successful,
contentType:Before:multipart/related; boundary="----=_Part_3837_17859151.1531477242209"
contentType:After:multipart/related; boundary="----=_Part_3837_17859151.1531477242209"; type="text/xml"
The type is getting as type="text/xml" while using axis2 1.4.1
but in axis2 1.7.7 , when i checked it is found that the content type is null . so null pointer exception is coming . i want to know why the type is getting as null
contentType:Before:multipart/related; boundary="----=_Part_3837_17859151.1531477242209"
contentType:After:multipart/related; boundary="----=_Part_3837_17859151.1531477242209";
please help me.
Backward incompatible changes as described in Axis2 1.7.0 release notes:
Apache Axis2 1.7.0 is a major release that contains lots of bug fixes and improvements, some of which introduce backward incompatible changes with respect to Axis2 1.6.x (as described below).
More specifically:
.. application code should no longer assume that the Attachments object is set on the message context and contains all MIME parts of the message. Note that as of Axis2 1.7.0, this assumption is still true (because the JAX-WS implementation internally relies on this), but this will change in a subsequent release.
Class apache/axis2/builder/MIMEBuilder.java is mentioned on this JIRA issue.
You have to refactor your implementation to be able to upgrade the version.

OpenJDK 9 SSL error with gradlew

I recently upgraded to OpenJDK 9 but am now encountering errors with CI build.
Exception in thread "main" javax.net.ssl.SSLException:
java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty
I tried to symlinking
/usr/lib/jvm/java-9-openjdk-amd64/lib/security/cacerts
/etc/ssl/certs/java/cacerts
But did not work, can confirm Slim version works but i'd rather not use this. Is there any quick hack or work around to use until the issue is resolved down the line?

Getting Error while starting glassfish server

when I am starting glass fish server through command prompt I am getting an
error. I am using jdk 1.5 and jdk1.6 also. Due to java version am I getting that error or any other reason.
I am using two tomcat server also that port no is 8080 and 8081.
For glass fish-domain purpose I am using 4545 port number.
Error starting domain mydomain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
FATAL ERROR in native method: processing of -javaagent failed
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:133)
Exception in thread "main"
This is the important bit.
java.lang.UnsupportedClassVersionError: Bad version number in .class file
It means that the class loader does not understand the version number of one of the ".class" files that it is trying to load.
The most likely explanation is that you are trying to load classes that have been compiled on a Java 7 development platform on an earlier (e.g. Java 5 or Java 6) JRE / JVM installation. You either need to upgrade your execution platform to Java 7 (best option), or downgrade your development platform to Java 5 or Java 6 (or whatever you are using).
Note that both Java 5 and Java 6 have reached "end of life", and there will not be any more patch releases available ... unless you take out an Oracle Java support contract.

PlayORM Example compilation error

Samples run fine on my Windows 7.
However I get the following error on my Ubuntu machine:
Exception in thread "main" java.lang.NoSuchMethodError: org.joda.time.LocalDateTime.toDate()Ljava/util/Date;
at com.alvazan.orm.api.base.spi.UniqueKeyGenerator.generateKey(UniqueKeyGenerator.java:47)
at com.alvazan.orm.api.base.spi.UniqueKeyGenerator.generateNewKey(UniqueKeyGenerator.java:42)
at com.alvazan.orm.api.base.spi.UniqueKeyGenerator.generateNewKey(UniqueKeyGenerator.java:21)
at com.alvazan.orm.impl.meta.data.MetaIdField.fillInAndFetchId(MetaIdField.java:106)
at com.alvazan.orm.impl.meta.data.MetaIdField.translateToColumn(MetaIdField.java:56)
at com.alvazan.orm.impl.meta.data.MetaClassSingle.translateToRow(MetaClassSingle.java:82)
at com.alvazan.orm.layer0.base.BaseEntityManagerImpl.putImpl(BaseEntityManagerImpl.java:117)
at com.alvazan.orm.layer0.base.BaseEntityManagerImpl.put(BaseEntityManagerImpl.java:100)
at com.example.PlayORMExample.createTestData(PlayORMExample.java:89)
at com.example.PlayORMExample.main(PlayORMExample.java:31)
I looked at similar questions on the "stack", but they do not seem to apply to my case.
you either
have the wrong version of the joda-time jar OR
have two joda time jars one of which is the wrong version
later,
Dean (I am a committer on PlayOrm).