Tried to follow the answers to other similar questions here, unfortunately, to no avail. We are upgrading our application from JAVA 7 to JAVA 17. The code compiles just fine, the problem is when we try to run the .war file on apache-tomee-plume-8.0.8.
JAVA_HOME is set properly:
JAVA_HOME
As well as path:
PATH
Here is the log error message:
Caused by: java.lang.RuntimeException: Unable to read class definition for com.ui.AccountListLight$SubListDataModel
at org.apache.xbean.finder.AnnotationFinder.readClassDef(AnnotationFinder.java:1180)
at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java:153)
at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java:166)
at org.apache.openejb.config.FinderFactory$OpenEJBAnnotationFinder.<init>(FinderFactory.java:546)
at org.apache.openejb.config.FinderFactory.newFinder(FinderFactory.java:267)
at org.apache.openejb.config.FinderFactory.create(FinderFactory.java:80)
at org.apache.openejb.config.FinderFactory.createFinder(FinderFactory.java:69)
at org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoader.java:878)
... 46 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
at org.apache.xbean.asm9.ClassReader.<init>(ClassReader.java:189)
at org.apache.xbean.asm9.ClassReader.<init>(ClassReader.java:170)
at org.apache.xbean.asm9.ClassReader.<init>(ClassReader.java:156)
at org.apache.xbean.asm9.ClassReader.<init>(ClassReader.java:277)
at org.apache.xbean.finder.AnnotationFinder.readClassDef(AnnotationFinder.java:1176)
Yes, I understand that the issue is that I compiled on JAVA 17 and somehow TomEE is trying to run it on an older version (probably JAVA 7 as that was what I had installed before), but considering I removed all JRE/JDK stuff for JAVA 7 on my machine and all there is in it is JAVA 17, how does it keep happening? Thank you for your time.
The problem has nothing to do with Java being unable to read your Java 17-compiled classes. Looking at the stack trace, the problem is that org.apache.xbean.asm9.ClassReader is unable to read your class file. This particular ClassReader is one that TomEE uses to load your application. It is not surprising that TomEE can't read Java 17 applications, since the last release was in August, before Java 17 came out. It was itself compiled using an older version of Java. Hopefully a future version of TomEE will fix this issue.
Related
I am trying to get Cassandra v2.1.17 running using Java 11 (Oracle), but cannot get it to startup. I have updated all the JVM args in cassandra-env.sh to the Java 11 equivalents, but I now get the following error on startup:
ERROR 14:48:10 Exception encountered during startup
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: sun.misc.Unsafe.monitorEnter(Ljava/lang/Object;)V
at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[guava-16.0.jar:na]
...
...
...
Caused by: java.lang.NoSuchMethodError: sun.misc.Unsafe.monitorEnter(Ljava/lang/Object;)V
I have done a good bit of looking about and it seems that this class was removed in Java 9, or at least deprecated, but was still accessible using --add-modules=jdk.unsupported. Adding this to my JVM args didn't help.
Is it possible to run Cassandra 2.1.17 on Oracle Java 11? I can see that the class is still in OpenJDK 11 (https://hg.openjdk.java.net/jdk/jdk11/file/6889f13694c6/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java) but I am stuck using Centos6 and cannot find an install for it.
#MeanwhileInHell, JDK 11 support for Apache Cassandra(R) was explored in the recent Cassandra 4.0 version only and I don't think it's available in very older and unsupported versions like 2.x. Please see https://cassandra.apache.org/doc/latest/cassandra/new/java11.html documentation for additional details.
https://issues.apache.org/jira/browse/CASSANDRA-9608 has details.
This question already has answers here:
import sun.misc.BASE64Encoder results in error compiled in Eclipse
(15 answers)
Closed 1 year ago.
when i run my app in mac, and show up this message
Errors occurred during the build.
Errors running builder 'Android Package Builder' on project 'IMPEXP'.
sun/misc/BASE64Encoder
but this project is work fine in windows 10 computer, and i don't use any about base64Encoder
eclipse Version: Photon Milestone 3 (4.8.0M3)
JRE java se 9.0
edit!
i found something like below
!ENTRY org.eclipse.core.resources 4 2 2017-11-09 11:50:09.047
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
at com.android.sdklib.internal.build.SignedJarBuilder.<init>(SignedJarBuilder.java:177)
at com.android.sdklib.build.ApkBuilder.init(ApkBuilder.java:446)
at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:422)
at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:362)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.finalPackage(BuildHelper.java:391)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.finalDebugPackage(BuildHelper.java:359)
at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:632)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:330)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:405)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:566)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:544)
at org.eclipse.core.internal.resources.Project.build(Project.java:120)
at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1143)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:155)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder cannot be found by com.android.ide.eclipse.base_23.0.7.2120684
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 23 more
As others have pointed out already, this is a compatibility issue—you need exactly Java 8 to run Eclipse.
Install JDK 8 if you don’t have it already.
In Eclipse, go to Window > Preferences > Installed JREs. Make sure Java 8 appears in the list and is selected. After that, close Eclipse.
Additionally, eclipse.ini also has a reference to the Java VM it uses. Make sure the VM it points to is Java 8 (see link on how to find it and how to set VM preferences).
Restart Eclipse and try again.
The Android code you are using is trying to use the sun.misc.BASE64Encoder class.
This deprecated class has been removed from Java 9 so this is not going to work.
You will need to switch back to Java 8 or find an update to the Android code (if there is one).
I'm working with Windows 7. I had to change the preferences and the ini file. Both had C:\Program Files\Java\jdk-12.0.1\bin which I changed to C:\Program Files\Java\jre1.8.0_221\bin. It now works!
In my case it was something very crazy.
I have to download the eclipse IDE Version NEON
Since the project is old almost from 2014
Attached the url of the IDE for which you need it:
Eclipse IDE NEON
I also had to follow the same installation steps
We are trying to run a process (broker) from a SUSE Linux Enterprise Server 11 (java-1_7_0-ibm) which connects to a Javaspace Blackboard (JINI) deployed on another linux machine. (CentOs with Open JDK "1.7.0_05-icedtea" version)
Stack Trace :
INFO: Starting broker
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:259)
at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:653)
at net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
at com.sun.jini.reggie.$Proxy0.lookup(Unknown Source)
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:128)
at edu.vt.ndssl.blackboard.JiniSpaceService.findSpace(JiniSpaceService.java:372)
at edu.vt.ndssl.blackboard.JiniSpaceService.<init>(JiniSpaceService.java:74)
at edu.vt.ndssl.blackboard.JavaSpaceBlackboard.<init>(JavaSpaceBlackboard.java:31)
at edu.vt.ndssl.blackboard.BlackboardFactory.make(BlackboardFactory.java:28)
at edu.vt.ndssl.broker.Broker.<init>(Broker.java:53)
at edu.vt.ndssl.broker.Broker.main(Broker.java:231)
Caused by: java.lang.RuntimeException: Unexpected exception
at com.sun.jini.logging.Levels.createLevel(Levels.java:142)
at com.sun.jini.logging.Levels.<clinit>(Levels.java:52)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:237)
... 10 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1387)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2059)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1984)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1867)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1419)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:420)
at com.sun.jini.logging.Levels.createLevel(Levels.java:138)
... 13 more
Same code works fine with Java 1.6 version upto 26.
I am looking for a correct version of Java to be installed on the SUSE Linux Enterprise Server which will be compatible with this OS and also equivalent to the Oracle JDK Update 5 or Open JDK Version 1.7.0_05 (icedtea).
Apparently, the root cause of the problem is that Oracle has made an incompatible change to the serialization format of the com.sun.jini.logging.Levels class. The change reportedly happened in Oracle JDK 1.6.0_38 and JDK 1.7.0_13, and has presumably made it into recent OpenJDK versions as well.
This problem has manifested in a variety of projects that use JINI. Examples:
https://issues.apache.org/jira/browse/RIVER-415 + https://issues.apache.org/jira/browse/RIVER-416.
https://cloudifysource.zendesk.com/entries/23079726-bootstrap-localcloud-not-working-Could-not-initialize-class-com-sun-jini-logging-Levels
More examples can be found by searching for "com.sun.jini.logging.Levels EOFException".
I can't say what the solution is / would be for you, but I have a couple of ideas:
Avoidance: I think you can avoid the problem if you don't mix pre and post-change JVM versions in your application network.
If you need to upgrade your application JVMs, I suggest that you upgrade them all, and then do a complete shutdown/restart of your JINI applications and services.
Fix your applications: It appears that the Apache River project fixed the problem by modifying the JINI code. As the issue ticket says:
The com.sun.jini.logging.Levels class produces a RuntimeException with the latest version of Java (both 1.6 and 1.7). The issue surrounds creation of custom java.util.logging.Level. The current implementation uses a ClassReplacingObjectOutputStream and the LevelData approach. By removing this approach and creating a subclass of java.util.logging.Level the issue gets resolved.
The issue ticket has a lot of discussion on the best way to do this, proposed patches and links to the checkin where they actually implemented the fix.
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?
I'm getting this error when starting the JBoss server in Eclipse.
Failed to boot JBoss:
java.lang.IllegalStateException: Incompletely deployed.
DEPLOYMENTS IN ERROR
Deployment "AttachmentStore" is in error due to: java.lang.IllegalArgumentException: wrong arguments. new for taget java.land.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]
I've googled the AttachementStore error and most suggested modifying the profile.xml (conf/bootstrap/profile.xml) file by adding a class to the constructor parameter node like this...
constructor parameter class="java.io.File"
Adding the class="java.io.File" seems to be the accepted solution everywhere since it's a known bug in JBoss but it didn't work for me.
I know I added the class correctly, I checked, rechecked and rechecked again the profile.xml file but JBoss is still throwing the same error when starting. I'm completely baffled. Anyone have any other ideas?
Error mainly occurred due to upgrade java 6 to java 7 or 8. Previously I used jdk 6u10 and it is changed to jdk 7u45.
Run the projects using java release of jdk 6u10 or Sun JDK 1.6.0_13. JBOSS runs with these JDK version successfully.