英文:
Wildfly 20 fails to run "out-of-the-box" on Ubuntu 20
问题
在在新安装了Wildfly 20到一个全新的Ubuntu 20系统后,我第一次尝试运行Wildfly时出现了一个错误:"无法创建服务器数据目录:/opt/wildfly-20.0.1.Final/standalone/data"。以下是完整的错误信息:
=========================================================================
JBoss引导环境
JBOSS_HOME:/opt/wildfly-20.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 --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED
=========================================================================
无法读取或配置org.jboss.logmanager.LogManager
java.lang.IllegalArgumentException: 无法为处理程序"FILE"实例化类"org.jboss.logmanager.handlers.PeriodicRotatingFileHandler"
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:117)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:336)
...
java.lang.IllegalStateException: WFLYSRV0124: 无法创建服务器数据目录:/opt/wildfly-20.0.1.Final/standalone/data
at org.jboss.as.server@12.0.3.Final//org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:463)
at org.jboss.as.server@12.0.3.Final//org.jboss.as.server.Main.determineEnvironment(Main.java:388)
...
以下是从 https://docs.wildfly.org/20/Getting_Started_Guide.html#installation 获取的安装步骤:
sudo apt install openjdk-11-jdk
sudo apt-get update
Version_Number=20.0.1.Final
wget https://download.jboss.org/wildfly/$Version_Number/wildfly-$Version_Number.tar.gz -P /tmp
sudo tar xf /tmp/wildfly-$Version_Number.tar.gz -C /opt/
cd /opt/wildfly-$Version_Number/bin
./standalone.sh
有人能解释一下出了什么问题吗?
提前谢谢。
英文:
Immediately after installing Wildfly 20 on a fresh Ubuntu 20 system my 1st attempt to run Wildfly crashes with a "Could not create server data directory: /opt/wildfly-20.0.1.Final/standalone/data" error. Here is the full dump:
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /opt/wildfly-20.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 --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED
=========================================================================
Failed to read or configure the org.jboss.logmanager.LogManager
java.lang.IllegalArgumentException: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE"
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:117)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:336)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:289)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:298)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:546)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:97)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:170)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:132)
at java.logging/java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:445)
at java.logging/java.util.logging.LogManager$2.run(LogManager.java:394)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.logging/java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:382)
at java.logging/java.util.logging.LogManager.getLogManager(LogManager.java:430)
at org.jboss.modules.Main.main(Main.java:457)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:115)
... 13 more
Caused by: java.io.FileNotFoundException: /opt/wildfly-20.0.1.Final/standalone/log/server.log (No such file or directory)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:151)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.setFile(PeriodicRotatingFileHandler.java:104)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:189)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.handlers.FileHandler.<init>(FileHandler.java:119)
at org.jboss.logmanager@2.1.15.Final//org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.<init>(PeriodicRotatingFileHandler.java:72)
... 18 more
java.lang.IllegalStateException: WFLYSRV0124: Could not create server data directory: /opt/wildfly-20.0.1.Final/standalone/data
at org.jboss.as.server@12.0.3.Final//org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:463)
at org.jboss.as.server@12.0.3.Final//org.jboss.as.server.Main.determineEnvironment(Main.java:388)
at org.jboss.as.server@12.0.3.Final//org.jboss.as.server.Main.main(Main.java:96)
at org.jboss.modules.Module.run(Module.java:352)
at org.jboss.modules.Module.run(Module.java:320)
at org.jboss.modules.Main.main(Main.java:617)
Here are the installation steps from https://docs.wildfly.org/20/Getting_Started_Guide.html#installation:
sudo apt install openjdk-11-jdk
sudo apt-get update
Version_Number=20.0.1.Final
wget https://download.jboss.org/wildfly/$Version_Number/wildfly-$Version_Number.tar.gz -P /tmp
sudo tar xf /tmp/wildfly-$Version_Number.tar.gz -C /opt/
cd /opt/wildfly-$Version_Number/bin
./standalone.sh
Can anyone explain what has gone wrong here?
Thank you in advance.
答案1
得分: 1
Wildfly没有权限写入/opt/wildfly-20.0.1.Final/standalone/log/server.log
,因为您使用了sudo
进行提取,所以目录和文件都归属于root用户。
如果这是在开发环境中运行,请执行:
sudo chown -R $USER /opt/wildfly-20.0.1.Final
这将把所有文件和目录的所有权更改为您自己。如果您以普通用户(比如wildfly用户)身份运行,只需执行以下命令:
sudo chown -R wildfly /opt/wildfly-20.0.1.Final
英文:
Wildfly doesn't have permission to write to /opt/wildfly-20.0.1.Final/standalone/log/server.log
because you extracted it with sudo
so the directories and files are all owned by root.
If this is running in a development type environment, run:
sudo chown -R $USER /opt/wildfly-20.0.1.Final
This will change all files and directories to be owned by you. If, instead, you run as a generic user (say wildfly) just change to:
sudo chown -R wildfly /opt/wildfly-20.0.1.Final
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论