0

尝试查找属性文件的运行时异常。属性文件存在并在启动配置中指向:

-Dconfig.home="C:\development\eclipse workspace\config"

我有几个其他目录指向它们不会导致问题。我得到这个堆栈跟踪:

Caused by: java.net.MalformedURLException: unknown protocol: c


    at org.springframework.web.context.ContextLoader.customizeContext(ContextLoader.java:499)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.net.MalformedURLException: unknown protocol: c
    at java.net.URL.<init>(URL.java:574)
    at java.net.URL.<init>(URL.java:464)
    at java.net.URL.<init>(URL.java:413)
    at 

... 20 more
4

1 回答 1

0

我想到了。编辑启动配置 VM 参数:

运行->运行配置...->Tomcat 6.0(你的服务器)->参数->虚拟机参数

本地文件引用应如下所示:

-Dconfig.home="file:\\\development\eclipse workspace\config"

是的,就是连续三个斜线来逃避“逃逸斜线”

或者,对于 OSX:

-Dconfig.home="file:///Users/gwn719/Documents/conf"
于 2013-04-24T21:39:08.127 回答