如果没有在 Wildfly 14 中进行任何部署,我什至无法启动 Wildfly
sh Standalone.sh --server-config=../standalone/configuration/standalone.xml
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /home/00887661017/Desktop/wildfly-14.0.1.Final
JAVA: java
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
=========================================================================
Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/ModuleLayer
at org.jboss.modules.JDKModuleFinder.<init>(JDKModuleFinder.java:45)
at org.jboss.modules.JDKModuleFinder.<clinit>(JDKModuleFinder.java:42)
at org.jboss.modules.Utils.<clinit>(Utils.java:44)
at org.jboss.modules.LocalModuleLoader.<init>(LocalModuleLoader.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(java.base@9-internal/Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(java.base@9-internal/NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(java.base@9-internal/DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(java.base@9-internal/Constructor.java:453)
at org.jboss.modules.DefaultBootModuleLoaderHolder$1.run(DefaultBootModuleLoaderHolder.java:37)
at org.jboss.modules.DefaultBootModuleLoaderHolder$1.run(DefaultBootModuleLoaderHolder.java:33)
at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)
at org.jboss.modules.DefaultBootModuleLoaderHolder.<clinit>(DefaultBootModuleLoaderHolder.java:33)
at org.jboss.modules.Main.main(Main.java:391)
Caused by: java.lang.ClassNotFoundException: java.lang.ModuleLayer
at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:366)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184)
at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
... 13 more
同样的过程在 CentOS 中也有效。
编辑,添加更多信息:
java -version
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)
在没有配置文件作为参数的情况下启动服务器会导致与最初出现的行为相同。