zhyh1105 / run-jetty-run

Automatically exported from code.google.com/p/run-jetty-run
0 stars 0 forks source link

Classpath uses jetty-incompatible separator ':' on Linux #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an RJR debug configuration on system that has File.pathSeparator
== ':'
2. Jetty will start up but exit immediately upon processing the webapp
class path.

What is the expected output? What do you see instead?

Jetty should start, but it crashes:

Exception in thread "main" java.net.MalformedURLException: no protocol: ...
    at java.net.URL.<init>(URL.java:567)
    at java.net.URL.<init>(URL.java:464)
    at java.net.URL.<init>(URL.java:413)
    at org.mortbay.resource.Resource.newResource(Resource.java:136)
    at org.mortbay.resource.Resource.newResource(Resource.java:120)
    at
org.mortbay.jetty.webapp.WebAppClassLoader.addClassPath(WebAppClassLoader.java:1
24)
    at runjettyrun.ProjectClassLoader.<init>(ProjectClassLoader.java:39)
    at runjettyrun.Bootstrap.main(Bootstrap.java:109)

What version of the product are you using? On what operating system?

RJR 1.1.0 / Eclipse 3.4.2 M20090211-1700 / Ubuntu 9.04

Please provide any additional information below.

Problem is the following snippet from JettyLaunchConfiguration.java
(committed with rev 39).

      // Class paths
      String[] classpath = getClasspath(configuration);
      String[] webAppClasspathArray = getProjectClasspath(configuration);
      String webAppClasspath = null;
      {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < webAppClasspathArray.length; i++) {
          String path = webAppClasspathArray[i];
          if (sb.length() > 0)
            sb.append(File.pathSeparator);
          sb.append(path);
        }
        webAppClasspath = sb.toString();
      }

Note that the included jetty distribution does use hardcoded path
separators of ",;" (WebappClassLoader.java):

    public void addClassPath(String classPath)
        throws IOException
    {
        if (classPath == null)
            return;

        StringTokenizer tokenizer= new StringTokenizer(classPath, ",;");
        while (tokenizer.hasMoreTokens())
        {
            ...
        }

        ....
    }

Original issue reported on code.google.com by mattias....@gmail.com on 5 May 2009 at 11:17

GoogleCodeExporter commented 9 years ago
This is a duplicate of #25.  Nonetheless, thanks for the extra details.

Original comment by James.Sy...@gmail.com on 5 May 2009 at 12:17