Using GreenQloud Compute

47 views
Skip to first unread message

jvandertil

unread,
Apr 10, 2013, 8:21:10 AM4/10/13
to jcl...@googlegroups.com
Hello everyone,

I'm trying to use JClouds to connect to GreenQloud, they claim their API is EC2 compatible however I can't get it to work properly.

I'm using JClouds 1.5.4 (from Maven) on Java 7:

java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)

I'm getting this exception:
[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.RuntimeException: request: POST https://api.greenqloud.com/ HTTP/1.1; error at 1:1 in document ; cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        at org.jclouds.http.functions.ParseSax.addDetailsAndPropagate(ParseSax.java:174)
        at org.jclouds.http.functions.ParseSax.addDetailsAndPropagate(ParseSax.java:146)
        at org.jclouds.http.functions.ParseSax.parse(ParseSax.java:132)
        at org.jclouds.http.functions.ParseSax.apply(ParseSax.java:86)
        at org.jclouds.http.functions.ParseSax.apply(ParseSax.java:54)
        at com.google.common.util.concurrent.Futures$3.apply(Futures.java:376)
        at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:518)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.jclouds.http.functions.ParseSax.doParse(ParseSax.java:141)
        at org.jclouds.http.functions.ParseSax.parse(ParseSax.java:130)
        ... 7 more

I found references to this issue at: https://code.google.com/p/jclouds/issues/detail?id=972, a pull request from GreenQloud here: https://github.com/jclouds/jclouds/pull/389 and talk about a GreenQloud provider for storage and compute here: https://github.com/jclouds/jclouds/issues/1494

I'm perfectly fine running a development build, but I am unable to find the GreenQloud provider mentioned in issue 1494. Where can I find it? Or is it still not usable?

I hope you can help me out :).

Kind regards,

Jos van der Til


jvandertil

unread,
Apr 10, 2013, 8:25:35 AM4/10/13
to jcl...@googlegroups.com
Oh my, it seems I didn't look good enough. I totally missed the incubation project, here: https://github.com/jclouds/jclouds-labs

I'll try to get it working and post back if I run into any issues.

Andrew Phillips

unread,
Apr 10, 2013, 9:53:41 AM4/10/13
to jcl...@googlegroups.com
Hoi Jos

GreenQloud compute is a provider in jclouds-labs [1]. It didn't make
the 1.6.0-rc.3 release of the labs modules, but there are older
versions available - I don't know how well they work, though.

See
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.jclouds.labs%22%20AND%20a%3A%22greenqloud-compute%22 for the full
list.

Regards

ap

[1] https://github.com/jclouds/jclouds-labs

jvandertil

unread,
Apr 10, 2013, 10:16:27 AM4/10/13
to jcl...@googlegroups.com, aphi...@qrmedia.com
Thank you, I had not found that yet. I'm not that familiar with Maven. I tried using the GreenQloud compute provider for jclouds 1.5.4, but I still get the same error:

[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.RuntimeException: request: POST https://api.greenqloud.com/ HTTP/1.1; error at 1:1 in document ; cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        at org.jclouds.http.functions.ParseSax.addDetailsAndPropagate(ParseSax.java:174)
        at org.jclouds.http.functions.ParseSax.addDetailsAndPropagate(ParseSax.java:146)
        at org.jclouds.http.functions.ParseSax.parse(ParseSax.java:132)
        at org.jclouds.http.functions.ParseSax.apply(ParseSax.java:86)
        at org.jclouds.http.functions.ParseSax.apply(ParseSax.java:54)
        at com.google.common.util.concurrent.Futures$3.apply(Futures.java:376)
        at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:518)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.jclouds.http.functions.ParseSax.doParse(ParseSax.java:141)
        at org.jclouds.http.functions.ParseSax.parse(ParseSax.java:130)
        ... 7 more

I am now building the 1.7.0-SNAPSHOT from the master branch on GitHub, and test if that works.

Adrian Cole

unread,
Apr 10, 2013, 10:20:40 AM4/10/13
to jcl...@googlegroups.com
At first glance, it appears that the error message from the server is not valid XML.  This sort of thing happens in EC2 clones some times.
--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jclouds+u...@googlegroups.com.
To post to this group, send email to jcl...@googlegroups.com.
Visit this group at http://groups.google.com/group/jclouds?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

jvandertil

unread,
Apr 10, 2013, 10:57:31 AM4/10/13
to jcl...@googlegroups.com
Yes, I figured that it was due to the (old) version of JClouds that that error occured. I upgraded to 1.7.0-SNAPSHOT and that fixed that error, but now I ran into something that is going wrong inside JClouds. 
It is requesting a 'c1.medium' instance, which is not available at GreenQloud.

Valid instance types are:
  • t1.nano
  • t1.micro
  • t1.milli
  • m1.small
  • m1.medium
  • m1.large
  • m1.xlarge
  • m2.2xlarge
How can I hook into JClouds to change this? Or is this very hard to do without modifying the JClouds source?
Or, where can I change this in JClouds so I can submit a pull request? I find it very hard to figure out where and how I can hook into JClouds, is there any documentation for this?

I believe I need to do something similar to: jclouds\providers\aws-ec2\src\main\java\org\jclouds\aws\ec2\compute\suppliers\AWSEC2HardwareSupplier.java ?
To unsubscribe from this group and stop receiving emails from it, send an email to jclouds+unsubscribe@googlegroups.com.

Andrew Phillips

unread,
Apr 10, 2013, 12:44:20 PM4/10/13
to jcl...@googlegroups.com
Hi Jos

Thanks for getting this far! Could you remove any passwords etc. from
your code and paste the call to request the image as a Gist or on
Pastie [2] or similar?

Thanks!

ap

[1] https://gist.github.com
[2] http://pastie.org

jvandertil

unread,
Apr 10, 2013, 1:09:02 PM4/10/13
to jcl...@googlegroups.com, aphi...@qrmedia.com
Hello,

I made a small application that produces two errors at the moment.

1. On the first run it will try to create the security group (assumption: it doesn't exist yet) and crash with an error (see First run log.txt)
2. On the second run it will not try to create the security group (since it exists after the first run, which is strange), and fail with the error I reported earlier (invalid instance size).

jvandertil

unread,
Apr 11, 2013, 2:15:34 PM4/11/13
to jcl...@googlegroups.com, aphi...@qrmedia.com
Using the attached module fixed the problem of invalid instance sizes. I'm guessing something like this will eventually make it into the JClouds code base.
GreenQloudHardwareSupplierModule.txt

Adrian Cole

unread,
Apr 11, 2013, 3:28:07 PM4/11/13
to jcl...@googlegroups.com
clever.  pull request will be a way of ensuring that destiny :)


--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jclouds+u...@googlegroups.com.

jvandertil

unread,
Apr 12, 2013, 8:35:54 AM4/12/13
to jcl...@googlegroups.com
For future reference: I submitted a pull request that fixes the invalid instance size issue, located here: https://github.com/jclouds/jclouds-labs/pull/63
Reply all
Reply to author
Forward
0 new messages