#Java Runtime Error

65 messages · Page 1 of 1 (latest)

verbal minnow
#

I want to deploy Java .war file using Wildfly v24.0.1 on ec2 aws instance.
I am getting this deployment error, and can not fix it:

{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\”webapp.war\".INSTALL" => "WFLYSRV0153: Failed to process phase INSTALL of deployment \"webapp.war\"
    Caused by: java.lang.UnsupportedClassVersionError: Failed to link webapp/WebApplication (Module \"deployment.webapp.war\" from Service Module Loader): webapp/WebApplication has been compiled by a more recent version of the      (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0"}}

Any help will be welcomed.
THANKKKKK YOOUU 😄

plush berryBOT
#

This post has been reserved for your question.

Hey @verbal minnow! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

high cipher
#

you need to compile to java 8

#

or if jboss has updated version where it supports java 11 then you need to update your server

verbal minnow
#
OpenJDK Runtime Environment Corretto-11.0.15.9.1 (build 11.0.15+9-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.15.9.1 (build 11.0.15+9-LTS, mixed mode)```
#
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/ec2-user/wildfly-24.0.1.Final

  JAVA: /home/ec2-user/java/jdk-11.0.18/bin/java

  JAVA_OPTS:  -server -Xms128m -Xmx1533m -Xss256k -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=768m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED

=========================================================================

15:23:59,695 INFO  [org.jboss.modules] (main) JBoss Modules version 1.11.0.Final
WildFly Full 24.0.1.Final (WildFly Core 16.0.1.Final)```
vocal salmon
#

Since it's clearly not using this java version

verbal minnow
#

just ps?

vocal salmon
#

Well ps auxww | grep wildfly

verbal minnow
#
ec2-user  5401  1.6 25.6 3321584 1037384 ?     Sl   14:24   1:07 /usr/java/latest/bin/java -D[Standalone] -server -Xms128m -Xmx1533m -Xss256k -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=768m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/home/ec2-user/wildfly-24.0.1.Final/standalone/log/server.log -Dlogging.configuration=file:/home/ec2-user/wildfly-24.0.1.Final/standalone/configuration/logging.properties -jar /home/ec2-user/wildfly-24.0.1.Final/jboss-modules.jar -mp /home/ec2-user/wildfly-24.0.1.Final/modules org.jboss.as.standalone -Djboss.home.dir=/home/ec2-user/wildfly-24.0.1.Final -Djboss.server.base.dir=/home/ec2-user/wildfly-24.0.1.Final/standalone
ec2-user 10024  0.0  0.0 110596  1912 pts/0    R+   15:31   0:00 grep --color=auto wildfly```
vocal salmon
#

And what's usr java latest bin java version

verbal minnow
#

Hm , I suppose I want to use /home/ec2-user/java/jdk-11.0.18/bin

#

Here is the newest java which I installed

vocal salmon
#

/usr/java/latest/bin/java -version ?

verbal minnow
#
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
vocal salmon
#

Well that's the issue

#

And also echo $JAVA_HOME?

verbal minnow
#

/home/ec2-user/java/jdk-11.0.18

#

But the wildfly doesnt use the correct one

#

Right?

vocal salmon
#

Yes

#

How is wildfly starting

verbal minnow
#

I run ./standalone.sh

#

which is inside the bin

#

wildfly/bin/standalone

vocal salmon
#

env | grep java?

verbal minnow
#
JAVA_HOME=/home/ec2-user/java/jdk-11.0.18```
vocal salmon
#

which java

verbal minnow
#

/usr/bin/java

vocal salmon
#

🤔

#

usr bin java version?

#

/usr/bin/java -version

verbal minnow
#

openjdk version "11.0.15" 2022-04-19 LTS
OpenJDK Runtime Environment Corretto-11.0.15.9.1 (build 11.0.15+9-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.15.9.1 (build 11.0.15+9-LTS, mixed mode)

#

That is the one I want to use

vocal salmon
#

Yeah

#

You'll have to see how standalone is ending up on the wrong one

#

It will probably have a hierarchy like some env vars, Java on PATH, etc

verbal minnow
#

to just copy paste the whole folder

#

into the one that is wildfly using

vocal salmon
#

No

verbal minnow
#

aka

#

/usr/java/jdk1.8.0_121/bin

#

ok

vocal salmon
#

What's in standalone.conf

verbal minnow
#

#JAVA_HOME="/opt/java/jdk"

#

I guess i will have to change it to /home/ec2-user/java/jdk-11.0.18

vocal salmon
#

Well it's commented out atm

#

So you will have to uncomment it and set it to your new path

verbal minnow
verbal minnow
#
#
# Specify the location of the Java home directory.  If set then $JAVA will
# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".
#
JAVA_HOME="/home/ec2-user/java/jdk-11.0.18"

# tell linux glibc how many memory pools can be created that are used by malloc
# MALLOC_ARENA_MAX="5"

#
# Specify the exact Java VM executable to use.
#
#JAVA=""```
vocal salmon
#

No

#

Why? Still not working?

verbal minnow
#

Since the server is being run on Linux server

vocal salmon
#

Still using same jvm?

verbal minnow
#
ec2-user  6602  5.5  8.9 3186772 360532 ?      Sl   16:25   0:15 /home/ec2-user/java/jdk-11.0.18/bin/java -D[Standalone] -server -Xms128m -Xmx1533m -Xss256k -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=768m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/ec2-user/wildfly-24.0.1.Final/standalone/log/server.log -Dlogging.configuration=file:/home/ec2-user/wildfly-24.0.1.Final/standalone/configuration/logging.properties -jar /home/ec2-user/wildfly-24.0.1.Final/jboss-modules.jar -mp /home/ec2-user/wildfly-24.0.1.Final/modules org.jboss.as.standalone -Djboss.home.dir=/home/ec2-user/wildfly-24.0.1.Final -Djboss.server.base.dir=/home/ec2-user/wildfly-24.0.1.Final/standalone
ec2-user  9232  0.0  0.0 110592  1868 pts/0    S+   16:30   0:00 grep --color=auto wildfly```
vocal salmon
#

Is there still a problem