fabric8io / fabric8

fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
http://fabric8.io/
1.76k stars 504 forks source link

Cannot create container in fresh CR3 using quickstarts #2072

Closed sonofingo closed 10 years ago

sonofingo commented 10 years ago

Hi. I am really a beginner at this but I cannot create containers from the quickstarts in CR3. The threads creating the containers gets stuck at " io.fabric8.agent.mvn.Parser.parsePathWithSchemePrefix (Parser.java:128)". I have briefly looked at the code and to me it looks a bit weird since I do not know what formats the location strings may have. What happens if the location string contains the string "mvn::"? I might be totally wrong here.

The current version has this implementation:

    /**
    * Lets trim any kind of "mvn:" prefix before parsing
    */
    public static Parser parsePathWithSchemePrefix(String location) throws MalformedURLException {
        String withoutMvnPrefix = location;
        boolean done = false;
        while (!done) {
            int idx = location.indexOf(':');
            if (idx > 0) {
                withoutMvnPrefix = location.substring(idx + 1);
            }
            // there may be a inlined maven repo location (assuming http), so we are done if we find that
            if (withoutMvnPrefix.startsWith("http:")) {
                done = true;
            } else if (withoutMvnPrefix.indexOf(':') < 0) {
                done = true;
            }
        }
        return new Parser(withoutMvnPrefix);
    }

The previous version had this implementation:

    /**
    * Lets trim any kind of "mvn:" prefix before parsing
    */
    public static Parser parsePathWithSchemePrefix(String location) throws MalformedURLException {
        String withoutMvnPrefix = location;
        int idx = location.lastIndexOf(':');
        if (idx > 0) {
            withoutMvnPrefix = location.substring(idx + 1);
        }
        return new Parser(withoutMvnPrefix);
    }
davsclaus commented 10 years ago

Thanks for reporting - yeah there is a bug in that parser code.

jstrachan commented 10 years ago

we'll cut a 1.1.0.CR6 soon with this fix...