有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

AntJava。网MalformedURLException:没有协议错误

我在运行ant在Ubuntu上构建java代码时遇到了这个错误。应用程序必须部署在Tomcat web app目录中。当我在源目录中运行ant时,它会构建所有文件并在web app目录中部署应用程序。但是,在完成之前,它会以错误终止。下面列出了我得到的错误

java.net.MalformedURLException: no protocol: /usr/share/tomcat7/webapps/manager/reload?path=http%3A%2F%2Flocalhost%3A8080%2Fokm%2Findex.jsp
    at java.net.URL.<init>(URL.java:585)    
    at java.net.URL.<init>(URL.java:482)
    at java.net.URL.<init>(URL.java:431)
    at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:176)
    at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:150)
    at org.apache.catalina.ant.ReloadTask.execute(ReloadTask.java:45)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

请告诉我我做错了什么


共 (1) 个答案

  1. # 1 楼答案

    使用file:///(the file)。系统在这里需要的“协议”是file:/