Java Schemagen on Ubuntu error: SEVERE: null - java

I'm using ubuntu 18.04 with java
>> java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.18.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.18.04, mixed mode, sharing)
installed by sudo apt install default-jre (but I don't think that it is the problem)
and I have installed schemagen using apt as suggested here.
The version of schemagen is 2.3.0.1.
I have launched schemagen Moon.java but I have this error:
Sep 10, 2021 5:54:25 PM com.sun.tools.jxc.SchemaGenerator run
SEVERE: null
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.sun.tools.jxc.SchemaGenerator.run(SchemaGenerator.java:166)
at com.sun.tools.jxc.SchemaGenerator.run(SchemaGenerator.java:91)
at com.sun.tools.jxc.SchemaGenerator.main(SchemaGenerator.java:82)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.sun.tools.jxc.SchemaGeneratorFacade.main(SchemaGeneratorFacade.java:60)
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: class com.sun.tools.javac.code.Attribute$UnresolvedClass cannot be cast to class com.sun.tools.javac.code.Attribute$Class (com.sun.tools.javac.code.Attribute$UnresolvedClass and com.sun.tools.javac.code.Attribute$Class are in module jdk.compiler of loader 'app')
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:163)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
at com.sun.tools.jxc.SchemaGenerator$Runner.compile(SchemaGenerator.java:266)
... 12 more
Caused by: java.lang.ClassCastException: class com.sun.tools.javac.code.Attribute$UnresolvedClass cannot be cast to class com.sun.tools.javac.code.Attribute$Class (com.sun.tools.javac.code.Attribute$UnresolvedClass and com.sun.tools.javac.code.Attribute$Class are in module jdk.compiler of loader 'app')
at jdk.compiler/com.sun.tools.javac.model.AnnotationProxyMaker$ValueVisitor.visitArray(AnnotationProxyMaker.java:192)
at jdk.compiler/com.sun.tools.javac.code.Attribute$Array.accept(Attribute.java:327)
at jdk.compiler/com.sun.tools.javac.model.AnnotationProxyMaker$ValueVisitor.getValue(AnnotationProxyMaker.java:167)
at jdk.compiler/com.sun.tools.javac.model.AnnotationProxyMaker.generateValue(AnnotationProxyMaker.java:145)
at jdk.compiler/com.sun.tools.javac.model.AnnotationProxyMaker.getAllReflectedValues(AnnotationProxyMaker.java:104)
at jdk.compiler/com.sun.tools.javac.model.AnnotationProxyMaker.generateAnnotation(AnnotationProxyMaker.java:90)
at jdk.compiler/com.sun.tools.javac.model.AnnotationProxyMaker.generateAnnotation(AnnotationProxyMaker.java:81)
at jdk.compiler/com.sun.tools.javac.code.AnnoConstruct.getAnnotation(AnnoConstruct.java:185)
at com.sun.tools.jxc.ap.InlineAnnotationReaderImpl.getClassAnnotation(InlineAnnotationReaderImpl.java:75)
at com.sun.tools.jxc.ap.InlineAnnotationReaderImpl.getClassAnnotation(InlineAnnotationReaderImpl.java:67)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:287)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:227)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:375)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:390)
at com.sun.tools.jxc.api.impl.j2s.JavaCompilerImpl.bind(JavaCompilerImpl.java:95)
at com.sun.tools.jxc.ap.SchemaGenerator.process(SchemaGenerator.java:110)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:980)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:896)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1222)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1335)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1258)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:936)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
... 15 more
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0
See https://javaee.github.io/jaxb-v2/
Any modifications to this file will be lost upon recompilation of the source schema.
Generated on: 2020
I'm not able to understand the reason. Have you some ideas to fix it?

Related

Intellij startup error due to bootstrap plugin on Mac

After installing a bootstrap plugin from the IntelliJ plugin marketplace, it asks for a reboot. After restarting Intellij, it is not open and showing the following log. I have already tried reinstalling it. I am using the community version 2022.3
com.intellij.diagnostic.PluginException: Fatal error initializing 'com.intellij.plugin.bootstrap.BootstrapPluginApplicationComponent
' [Plugin: nl.jworks.intellij.bootstrap3]
at com.intellij.serviceContainer.ComponentManagerImpl.handleInitComponentError$intellij_platform_serviceContainer(ComponentManagerImpl.kt:571)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:382)
at com.intellij.serviceContainer.ComponentManagerImpl.access$registerComponents(ComponentManagerImpl.kt:50)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:260)
at com.intellij.openapi.client.ClientAwareComponentManager.registerComponents(ClientAwareComponentManager.kt:46)
at com.intellij.idea.ApplicationLoader.doInitApplication(ApplicationLoader.kt:78)
at com.intellij.idea.ApplicationLoader.access$doInitApplication(ApplicationLoader.kt:1)
at com.intellij.idea.ApplicationLoader$doInitApplication$1.invokeSuspend(ApplicationLoader.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at com.intellij.idea.ApplicationLoader.initApplication(ApplicationLoader.kt:61)
at com.p.s.k.p._g.k(_g.java:60)
at com.p.s.k.p.p6.k(p6.java:113)
at com.p.s.k.p.pa.p(pa.java:139)
at com.p.s.k.p.pG.p(pG.java:57)
at com.intellij.idea.MainImpl.start(MainImpl.kt:13)
at com.intellij.idea.StartupUtil$startApplication$7.invokeSuspend(StartupUtil.kt:294)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at com.intellij.idea.Main.main(Main.kt:36)
Caused by: java.lang.ClassNotFoundException: com.intellij.plugin.bootstrap.BootstrapPluginApplicationComponent
PluginClassLoader(plugin=PluginDescriptor(name=Bootstrap 3, id=nl.jworks.intellij.bootstrap3, descriptorPath=plugin.xml, path=~/Library/Application Support/JetBrains/IdeaIC2022.3/plugins/bootstrap3.jar, version=4.1.1, package=null, isBundled=false), packagePrefix=null, instanceId=12, state=active)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:215)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponent(ComponentManagerImpl.kt:495)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:374)
... 26 more
-----
Your JRE: 17.0.5+1-b653.23 aarch64 (JetBrains s.r.o.)
/Applications/IntelliJ IDEA CE.app/Contents/jbr/Contents/Home```

Add agent and custom-handler to the same Wildfly deployment

I'm trying to configure JMX Exporter as an agent of a Wildfly 10.1.0 box. Everything works fine with default configuration.
Now I need to add Sentry as a custom-handler which fail the Wildfly start with the following error:
java.lang.IllegalArgumentException: Failed to load module "io.sentry" for handler "SENTRY"
at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:64)
...
at java.util.logging.Logger.getLogger(Logger.java:502)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JmxCollector.<clinit>(JmxCollector.java:38)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.NoClassDefFoundError: org/jboss/modules/ModuleLoader
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ModuleFinder.getClassLoader(AbstractPropertyConfiguration.java:463)
at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:62)
... 27 more
When I add -Xbootclasspath/p:/opt/jboss/wildfly/jboss-modules.jar to JAVA_OPTS the error changes to:
java.lang.IllegalArgumentException: Failed to load module "io.sentry" for handler "SENTRY"
at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:64)
...
at java.util.logging.Logger.getLogger(Logger.java:502)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JmxCollector.<clinit>(JmxCollector.java:38)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: org.jboss.modules.ModuleNotFoundException: io.sentry:main
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:223)
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ModuleFinder.getClassLoader(AbstractPropertyConfiguration.java:467)
at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:62)
... 27 more
org.jboss.modules.ModuleNotFoundException: org.jboss.as.standalone:main
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:223)
at org.jboss.modules.Main.main(Main.java:394)
Is there a proper way to configure an agent and a custom-handler in the same Wildfly deployment?
EDIT 1:
The current JAVA_OPTS is:
-server
-Xms1024m
-Xmx1024m
-XX:MetaspaceSize=256m
-XX:MaxMetaspaceSize=256m
-XX:NewRatio=2
-XX:SurvivorRatio=20
-XX:+UnlockExperimentalVMOptions
-XX:+UseCGroupMemoryLimitForHeap
-XX:+UseGCOverheadLimit
-XX:+ExitOnOutOfMemoryError
-Djava.net.preferIPv4Stack=true
-Djava.awt.headless=true
-Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager,io.sentry
-javaagent:/opt/agent/prometheus/jmx_prometheus_javaagent.jar=1234:/opt/jboss/wildfly/bin/jmx-exporter-config.yaml
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Xbootclasspath/p:/opt/jboss/wildfly/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.4.Final.jar
-Xbootclasspath/p:/opt/jboss/wildfly/modules/system/layers/base/io/sentry/main/sentry-1.7.2.jar
-Xbootclasspath/p:/opt/jboss/wildfly/jboss-modules.jar
JVM version:
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (IcedTea 3.6.0) (Alpine 8.151.12-r0)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
OS version (container):
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.7.0
PRETTY_NAME="Alpine Linux v3.7"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"

How to resolve Unsupported major.minor version 51.0 error when trying to run Maven project Java [duplicate]

This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 7 years ago.
I'm not sure what has happened but I have a maven based Java project in Eclipse (Mars) where when I go to Run As-> Mvn install (from the UI), I've tried cleaning the project, Maven-> update project, mvn eclipse:eclipse, etc...nothing works
I get the following Exception thrown at me:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:254)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(Launcher.java:144)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:266)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Earlier this was working with no trouble. This project is configured at with Java 1.6
I run mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.3", arch: "x86_64", family: "mac"
I run java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
I have seen the other similar question which solutions like
export JAVA_HOME=<path to installed java version> but this does not work for me.
Any help or assistance would be much appreciated, thanks.
Configure java 1.7 for this project. As java version doesn't match with maven so please use java 1.7
It is clear that your default java version is 1.7
Go to project properties and from here set java 1.7 for your project. Hope this may help you out.

Unsupported Class Version during Maven build in Jenkins

I've seen a few of these questions on here, but none of the solutions/tips seem to be pointing me in the right direction. So I have 3 JDK's installed in the locations of "/opt/java/6", "/opt/java/7", and "/opt/java/8". All of these are set in the global Jenkins configuration. Jenkins itself is run using Java 8 which is the system default JRE that I set manually through alternatives (I'm using CentOS 7). I had a bunch of old projects that are built using maven and the maven compiler plugin which is set to source=1.6 target=1.6 . Every time I try to execute a build with the Java 6 JDK I get
Started by user Antony Prince
ln builds/lastSuccessfulBuild /var/lib/jenkins/jobs/BitCalculator/lastSuccessful failed
java.nio.file.DirectoryNotEmptyException: /var/lib/jenkins/jobs/BitCalculator/lastSuccessful
at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:242)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at hudson.Util.createSymlinkJava7(Util.java:1194)
at hudson.Util.createSymlink(Util.java:1112)
at hudson.model.Run.createSymlink(Run.java:1851)
at hudson.model.Run.updateSymlinks(Run.java:1832)
at hudson.model.Run.execute(Run.java:1743)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
ln builds/lastStableBuild /var/lib/jenkins/jobs/BitCalculator/lastStable failed
java.nio.file.DirectoryNotEmptyException: /var/lib/jenkins/jobs/BitCalculator/lastStable
at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:242)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at hudson.Util.createSymlinkJava7(Util.java:1194)
at hudson.Util.createSymlink(Util.java:1112)
at hudson.model.Run.createSymlink(Run.java:1851)
at hudson.model.Run.updateSymlinks(Run.java:1833)
at hudson.model.Run.execute(Run.java:1743)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Building in workspace /var/lib/jenkins/workspace/BitCalculator
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url /home/git/repositories/java/BitCalculator.git # timeout=10
Fetching upstream changes from /home/git/repositories/java/BitCalculator.git
> git --version # timeout=10
> git fetch --tags --progress /home/git/repositories/java/BitCalculator.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse origin/master^{commit} # timeout=10
Checking out Revision 4f119f7783cc4ff00e5bf9bb27850ae7698d4fe8 (origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 4f119f7783cc4ff00e5bf9bb27850ae7698d4fe8
> git rev-list 4f119f7783cc4ff00e5bf9bb27850ae7698d4fe8 # timeout=10
Parsing POMs
[BitCalculator] $ /opt/java/6/bin/java -Djava.awt.headless=true -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.5.jar:/usr/share/maven/boot/plexus-classworlds.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven /var/lib/jenkins/war/WEB-INF/lib/remoting-2.44.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 56445
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /var/lib/jenkins/workspace/BitCalculator/pom.xml -P sign clean deploy
java.lang.reflect.InvocationTargetException
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.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:331)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.UnsupportedClassVersionError: javax/inject/Provider : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:86)
... 22 more
channel stopped
[BitCalculator] $ /bin/sh -xe /tmp/hudson6524656470722686910.sh
+ rm 'target/*no_deps*'
rm: cannot remove 'target/*no_deps*': No such file or directory
Build step 'Execute shell' marked build as failure
ERROR: Failed to parse POMs
hudson.util.IOException2: java.lang.reflect.InvocationTargetException
at hudson.maven.Maven3Builder.call(Maven3Builder.java:178)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
... 10 more
Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:181)
... 15 more
Caused by: java.lang.reflect.InvocationTargetException
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.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:331)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
... 15 more
Caused by: java.lang.UnsupportedClassVersionError: javax/inject/Provider : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:86)
... 22 more
Archiving artifacts
Sending e-mails to: antony#blazrsoft.com
Finished: FAILURE
This indicates that there's Java 7 interfering somewhere, but I'm not sure where.
The code is 1.6 compliant and most of the projects have no dependencies, so I'm not sure why this is happening. If I execute maven outside of Jenkins, the projects build just fine with JDK 6, so its leading me to think there's a misconfiguration in Jenkins somewhere, but I'm not sure where since everything seems to be as it should be. The paths to the JDKs are set properly in the global config and the projects themselves are set to use the specified JDK's. I apologize if its a duplicate question or something silly, but I've been trying to figure this out for days with no results. Everyone just says to check the paths and make sure there are no dependent artifacts built with a later JDK and I'm sure that this is not the problem.
$ mvn -version
Apache Maven 3.0.5 (Red Hat 3.0.5-16)
Maven home: /usr/share/maven
Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: /opt/java/8/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.32-openvz-042stab090.5-amd64", arch: "amd64", family: "unix"
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.6</source>
<target>1.6</target>
<compilerVersion>1.6</compilerVersion>
</configuration>
</plugin>
You have an old java version. For example in my case I´m compiling an old product so I have to keep the java deprecated version.
So the solution was to download a newest jdk and configure the JAVA_HOME in the slave.
http://lmarccdk12.ptx.fr.sopra:14000/computer//configure in the section Advanced/JavaPath=/root/jdk1.7.0_79/bin/java (that´s the version I chose)
You will see the following message in the slave launch log:
[SSH] Starting slave process: cd "/root" && /root/jdk1.7.0_79/bin/java -jar slave.jar
Your Jenkins job is of type "Maven project", and this job type has a limitation in that it cannot run a Maven build with a JDK version that is older than the Java version under which Jenkins is run.
Beginning with Jenkins 2.357 (released on June 28, 2022) and the forthcoming 2.361.1 LTS release, Jenkins requires Java 11 or newer. Therefore, you can no longer run Maven projects with JDKs 1.6, 1.7 and 1.8. The minimum version is now Java 11.
To resolve this, you may:
Create a Freestyle project and use Invoke top-level Maven targets to invoke Maven, or create a Jenkins Pipeline project. In both cases, using an older JDK will be possible.
Use JDK 11 but set source and target version to the older Java version. I haven't tried that though, and I believe this option may cause other trouble.
For further information, see also Jenkins requires Java 11 or newer and Maven Builds Fails After Upgrade

Trying to start a war file - getting errors - need help understanding catalina.out

I apologize in advance - for what may be a common mistake, but after a couple of days of trying to figure it out... I think it appears that the war file wants a different java jdk... but I've tried now with this version below as well as openjdk 1.6 and 1.7.
Tomcat7 running on Wheezy. Here is my jdk version:
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Server VM (build 25.5-b02, mixed mode)
Here is my $JAVA_HOME:
/usr/local/java/jdk1.8.0_05
Here is my "catalina.out":
INFO: Deploying web application archive /var/lib/tomcat7/webapps/my_app.war
Jun 6, 2014 2:22:50 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/my_app/WEB-INF/lib/javax.servlet-api-3.1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
...
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.myco.mydata.controller.ShowmydataController] for bean with name 'showmydataController' defined in file [/var/lib/tomcat7/webapps/my_app/WEB-INF/classes/com/myco/mydata/controller/ShowmydataController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/myco/mydata/controller/ShowmydataController : Unsupported major.minor version 51.0 (unable to load class com.myco.mydata.controller.ShowmydataController)
...
Caused by: java.lang.UnsupportedClassVersionError: com/myco/mydata/controller/ShowmydataController : Unsupported major.minor version 51.0 (unable to load class com.myco.mydata.controller.ShowmydataController)
...
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.myco.mydata.controller.ShowmydataController] for bean with name 'showmydataController' defined in file [/var/lib/tomcat7/webapps/my_app/WEB-INF/classes/com/myco/mydata/controller/ShowmydataController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/myco/mydata/controller/ShowmydataController : Unsupported major.minor version 51.0 (unable to load class com.myco.mydata.controller.ShowmydataController)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1330) ~[spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1396) ~[spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:385) [spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:354) [spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:97) ~[spring-context-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609) ~[spring-context-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) ~[spring-context-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) ~[spring-web-4.0.5.RELEASE.jar:4.0.5.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4790) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5284) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600) ~[tomcat-catalina-7.0.28.jar:7.0.28]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.6.0_31]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.6.0_31]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) ~[na:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.6.0_31]
at java.lang.Thread.run(Thread.java:701) ~[na:1.6.0_31]
...
And so-on.
Thanks in advance for your time and attention!
I may have resolved this issue.
I installed openjdk 1.7. Then I edited /etc/init.d/tomcat7 and set JDK_DIRS="/usr/lib/jvm/java-1.7.0-openjdk-i386".
Tomcat restarted successfully and the war file started... kindof... as the application was not fully working, but this is now the DEVs problem. It appears from the Tomcat/Java POV - this issue is resolved.
It look like you compile in a different JDK version that you have in App Server, try to compile using the same jdk.

Categories

Resources