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

时间:2015-04-15 09:13:09

标签: java web-services maven cxf andromda

我正在开发一个使用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$2.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.'

有人知道这个问题到底是什么吗?

1 个答案:

答案 0 :(得分:3)

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

e.g。

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