【问题标题】:WildFly 20.0.0.Final - Unable to read the logging configuration from 'logging.properties' (java.net.UnknownHostException: usr)WildFly 20.0.0.Final - 无法从“logging.properties”读取日志配置(java.net.UnknownHostException:usr)
【发布时间】:2020-07-06 15:39:14
【问题描述】:

我于 2020 年 6 月 8 日从 WildFly 19.x 升级到 20.0.0.Final。我的应用在本地运行良好,没有任何问题,我并没有真正注意到任何问题。

上周末我在“荒野乡村”,互联网连接速度非常慢。当我启动 WildFly 20 时,它的开头是:

MacBook-Pro-2:bin NOTiFY$ ./standalone.sh -b 0.0.0.0 --server-config=standalone-full.xml
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: //usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final

  JAVA: /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/bin/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

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

然后它会挂起 3-5 分钟,然后启动、运行和部署:

Unable to read the logging configuration from 'file://usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final/standalone/configuration/logging.properties' (java.net.UnknownHostException: usr)

16:29:00,934 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) WFLYDS0013: Started FileSystemDeploymentService for directory /usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final/standalone/deployments
16:29:00,942 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "GoStopHandle.ear" (runtime-name: "GoStopHandle.ear")
16:29:00,965 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=/usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final/standalone/data/activemq/journal,bindingsDirectory=/usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final/standalone/data/activemq/bindings,largeMessagesDirectory=/usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final/standalone/data/activemq/largemessages,pagingDirectory=/usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final/standalone/data/activemq/paging)
16:29:00,988 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221013: Using NIO Journal
16:29:00,997 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0006: Undertow HTTPS listener https listening on 0.0.0.0:8443
16:29:01,045 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
16:29:01,046 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
16:29:01,046 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
16:29:01,047 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
16:29:01,060 INFO  [org.jboss.ws.common.management] (MSC service thread 1-5) JBWS022052: Starting JBossWS 5.4.1.Final (Apache CXF 3.3.6) 
16:29:01,091 WARN  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ222219: File /local/Cellar/wildfly-as/wildfly-20.0.0.Final/standalone/configuration/logging.properties does not exist
16:29:01,114 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221034: Waiting indefinitely to obtain live lock
16:29:01,114 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221035: Live Server Obtained live lock
16:29:01,374 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221003: Deploying ANYCAST queue jms.queue.ExpiryQueue on address jms.queue.ExpiryQueue
16:29:01,375 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221003: Deploying ANYCAST queue jms.queue.DLQ on address jms.queue.DLQ
16:29:01,378 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-6) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor acceptor
16:29:01,378 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-5) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor-throughput acceptor
16:29:01,378 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-3) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor-throughput acceptor
16:29:01,378 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-4) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor acceptor
16:29:01,672 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0207: Starting subdeployment (runtime-name: "GoStopHandleWAR.war")
16:29:01,672 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0207: Starting subdeployment (runtime-name: "GoStopHandleJAR.jar")
16:29:01,759 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221007: Server is now live
16:29:01,759 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 84) AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.10.1 [default, nodeID=4c20d584-ad8f-11ea-9b5a-f8ffc25ffbcd] 
16:29:01,772 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 84) WFLYMSGAMQ0002: Bound messaging object to jndi name java:/ConnectionFactory
16:29:01,806 WARN  [org.apache.activemq.artemis.jms.server] (ServerService Thread Pool -- 85) AMQ122005: Invalid "host" value "0.0.0.0" detected for "http-connector" connector. Switching to "MacBook-Pro-2.local". If this new address is incorrect please manually configure the connector to use the proper one.
16:29:01,808 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 85) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
16:29:01,837 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0007: Registered connection factory java:/JmsXA
16:29:01,900 INFO  [org.apache.activemq.artemis.ra] (MSC service thread 1-4) AMQ151007: Resource adaptor started
16:29:01,900 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-4) IJ020002: Deployed: file://RaActivatoractivemq-ra
16:29:01,902 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-1) WFLYJCA0118: Binding connection factory named java:/JmsXA to alias java:jboss/DefaultJMSConnectionFactory
16:29:01,902 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
16:29:03,284 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0059: Class Path entry javax.activation-api-1.2.0.jar in /content/GoStopHandle.ear/GoStopHandleWAR.war/WEB-INF/lib/jaxb-runtime-2.3.1.jar  does not point to a valid jar for a Class-Path reference.

如果我切换回 WildFly 19.0.0。Final 没问题。 (我没有得到:“无法从中读取日志记录配置”)。

是什么原因导致:“无法读取日志配置”?

TIA

2.

WildFly 20.x 有两个'//':

JBOSS_HOME: //usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final

WildFly 19.x 有一个“/”:

JBOSS_HOME: /usr/local/Cellar/wildfly-as/wildfly-19.0.0.Final

macOS Catalina 10.15.5

【问题讨论】:

  • 您的环境变量中是否设置了JBOSS_HOME
  • WildFy 20 具有:JBOSS_HOME://usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final 和 WildFy 18:JBOSS_HOME:/usr/local/Cellar/wildfly-as/ wildfly-19.0.0.Final

标签: macos jboss wildfly


【解决方案1】:

所以问题是JBOSS_HOME 环境变量开头的双斜杠。 Wildfly 19 和 20 都以相同的问题开头如果我有双斜杠(这是在 Linux 上,但问题是一样的):

export JBOSS_HOME=//home/scott/wildfly/wildfly-20.0.0.Final

scott@coyote:~/wildfly/wildfly-20.0.0.Final$ bin/standalone.sh

   WARNING:  JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.

             JBOSS_HOME: //home/scott/wildfly/wildfly-20.0.0.Final

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

  JBoss Bootstrap Environment

  JBOSS_HOME: //home/scott/wildfly/wildfly-20.0.0.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

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

Unable to read the logging configuration from 'file://home/scott/wildfly/wildfly-20.0.0.Final/standalone/configuration/logging.properties' (java.net.UnknownHostException: home)
08:36:10,393 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-5) WFLYDS0013: Started FileSystemDeploymentService for directory /home/scott/wildfly/wildfly-20.0.0.Final/standalone/deployments

Wildfly 在我的示例中将//home 解释为主机,然后尝试连接到它。解决方法是从您的环境中删除 JBOSS_HOME 并让 standalone.sh 解决问题,或者修复环境变量中的双斜杠。

我的猜测是,有一些代码会查找双斜杠,如果存在,会盲目地将 file: 部分替换为 http:

【讨论】:

    【解决方案2】:

    升级到:wildfly-20.0.1.Final

    =========================================================================
    
      JBoss Bootstrap Environment
    
      JBOSS_HOME: /usr/local/Cellar/wildfly-as/wildfly-20.0.1.Final
    
      JAVA: /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/bin/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
    
    =========================================================================
    
    13:48:07,800 INFO  [org.jboss.modules] (main) JBoss Modules version 1.10.1.Final
    13:48:08,100 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.11.Final
    13:48:08,104 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
    13:48:08,179 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 20.0.1.Final (WildFly Core 12.0.3.Final) starting
    

    解决了我在 20.0.0.Full 中遇到的“错误”:

    =========================================================================
    
      JBoss Bootstrap Environment
    
      JBOSS_HOME: //usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final
    
      JAVA: /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/bin/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
    
    =========================================================================
    
    Unable to read the logging configuration from 'file://usr/local/Cellar/wildfly-as/wildfly-20.0.0.Final/standalone/configuration/logging.properties' (java.net.UnknownHostException: usr)
    

    【讨论】:

      【解决方案3】:

      就我而言,我忘记设置JBOSS_HOME 环境变量。我将它指向wildfly安装文件夹并且它有效。 导出set JBOSS_HOME "C:\Servers\wildfly-20.0.1.Final"

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-01-13
        • 1970-01-01
        • 1970-01-01
        • 2015-03-13
        • 2016-12-12
        • 2015-08-09
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多