log4j:ERROR 无法解析 url [file://.../mda/log4j.xml]

log4j:ERROR Could not parse url [file://.../mda/log4j.xml]

我正在开发一个使用 Maven、andromda 3.4、CXF Web 服务和 Uml 1.4 的项目。

在我开始使用 Web 服务之前一切正常。我已经用 Webservice 刻板印象正确标记了分类,用 XmlSchema 标记了包。

然而,当我 运行 mvn install 时,出现以下异常:

'wsgenjava:
     [echo] running wsdlvalidator for AndroMDA generated wsdl for service OrganisationService
     [java] log4j:ERROR Could not parse url [file://home/junior/Documents/business/jrsystems/devel/tsaditiro/main-app/mda/../mda/log4j.xml].
     [java] java.net.UnknownHostException: home
     [java]     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
     [java]     at java.net.Socket.connect(Socket.java:579)
     [java]     at java.net.Socket.connect(Socket.java:528)
     [java]     at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:958)
     [java]     at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:918)
     [java]     at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1013)
     [java]     at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:999)
     [java]     at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294)
     [java]     at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:393)
     [java]     at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:765)
     [java]     at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:871)
     [java]     at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)
     [java]     at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
     [java]     at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
     [java]     at org.apache.cxf.common.logging.Log4jLogger.<init>(Log4jLogger.java:76)
     [java]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     [java]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
     [java]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
     [java]     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
     [java]     at org.apache.cxf.common.logging.LogUtils.createLogger(LogUtils.java:273)
     [java]     at org.apache.cxf.common.logging.LogUtils.getLogger(LogUtils.java:166)
     [java]     at org.apache.cxf.common.logging.LogUtils.<clinit>(LogUtils.java:140)
     [java]     at org.apache.cxf.tools.common.toolspec.AbstractToolContainer.<clinit>(AbstractToolContainer.java:44)
     [java] log4j:WARN No appenders could be found for logger (org.apache.cxf.common.logging.LogUtils).
     [java] log4j:WARN Please initialize the log4j system properly.
     [java] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.'

有人知道这个问题是怎么回事吗?

如果您为文件定义的 URL 是 Linux/Unix 系统中的绝对路径,那么您需要在协议后添加一个额外的正斜杠。

例如

file://home/junior/Documents/business/jrsystems/devel/tsaditiro/main-app/mda/../mda/log4j.xml

应该是:

file:///home/junior/Documents/business/jrsystems/devel/tsaditiro/main-app/mda/../mda/log4j.xml