Hi,

You should cast the return from openConnection() to HttpURLConnection:

URL requestURL = new URL(url);
HttpURLConnection connection = (HttpURLConnection)
requestURL.openConnection();

Depending on what you need to do you might not need to open the
connection at all. It might be better to use the stream and readers
like shown in the URL Fetch documentation you referenced (http://
code.google.com/appengine/docs/java/urlfetch/overview.html).

Br,
Ville


On Feb 27, 9:15 pm, Persevering <apo...@gmail.com> wrote:
> Hi All,
>
> I am new to Google app and trying to build an application that would
> load some data from other site over hppts. Below is my code that is
> working in other applications but i am getting some errors with google
> app engine.
>
> Initially compiler is throwing error like
>         - sun.net.www.protocol.https.HttpsURLConnectionImplis not supported
> by Google App Engine's Java runtime environment.
>
> My code is:
> java.net.URL requestURL = new URL(url);
> HttpsURLConnectionImpl h =
> (HttpsURLConnectionImpl)requestURL.openConnection();
>
> and somehow i complied it using solution available at "http://
> 74.125.153.132/search?q=cache:http://blog.frankel.ch/tag/google"; but i
> got error on local Development environment as mentioned below:
>
> com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler
> $Connection cannot be cast to
> sun.net.www.protocol.https.HttpsURLConnectionImpl
> java.lang.ClassCastException:
> com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler
> $Connection cannot be cast to
> sun.net.www.protocol.https.HttpsURLConnectionImpl
>
> I have also gone 
> throughhttp://code.google.com/appengine/docs/java/urlfetch/overview.html
> but no luck.
>
> Please let me know how can i solve it.
>
> Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to