Thank you for reply i have gone through link. add proxy host and port
within the code along with
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
              String encodedUserPwd =
              encoder.encode("myunivdomain\
[EMAIL PROTECTED]:password".getBytes());
              con.setRequestProperty
                 ("Proxy-Authorization", "Basic " + encodedUserPwd);
              // PROXY ----------


                con.connect();


But still i am geting this errors.


com.google.gdata.util.AuthenticationException: Error connecting with
login URI
        at
com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(Unknown
Source)
        at
com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(Unknown
Source)
        at com.google.gdata.client.GoogleService.setUserCredentials(Unknown
Source)
        at com.google.gdata.client.GoogleService.setUserCredentials(Unknown
Source)
        at client.Clientproxy.main(Clientproxy.java:48)
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:
195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.Socket.connect(Socket.java:519)
        at java.net.Socket.connect(Socket.java:469)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:
271)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:328)
        at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:
172)
        at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:
729)
        at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:
158)
        at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:
832)
        at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:
230)
        at
com.google.gdata.client.GoogleAuthTokenFactory.makePostRequest(Unknown
Source)
        ... 5 more
com.google.gdata.util.AuthenticationException: Unauthorized
<HTML>
<HEAD>
<TITLE>Authorization required</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Authorization required</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

        at
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(Unknown
Source)
        at
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(Unknown
Source)
        at
com.google.gdata.client.http.HttpGDataRequest.checkResponse(Unknown
Source)
        at com.google.gdata.client.http.HttpGDataRequest.execute(Unknown
Source)
        at com.google.gdata.client.http.GoogleGDataRequest.execute(Unknown
Source)
        at com.google.gdata.client.Service.getFeed(Unknown Source)
        at com.google.gdata.client.Service.getFeed(Unknown Source)
        at com.google.gdata.client.GoogleService.getFeed(Unknown Source)
        at com.google.gdata.client.Service.getFeed(Unknown Source)
        at client.Clientproxy.main(Clientproxy.java:58)
Exception in thread "main" java.lang.NullPointerException
        at client.Clientproxy.main(Clientproxy.java:71)
Your calendars:



On Apr 18, 8:01 pm, "Austin (Google)" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This seems like a proxy setting issue within your JVM environment.
> The Java client library uses the standard network library from J2SE,
> you need to supply the correct proxy setting of your network
> configuration.  I found this page on the web that has a lot of
> information on setting proxy setting in Java -
>
> http://www.rgagnon.com/javadetails/java-0085.html
>
> Hope it helps,
> Austin
>
> On Fri, Apr 18, 2008 at 4:50 AM, Akbar Shaik
>
>
>
> <[EMAIL PROTECTED]> wrote:
> >  Hi
>
> >  I am Akbar Shaik doing MSc in Newcastle University. When i was runing my
> > client java application for Google calendar API from home network, it was
> > working fine. when i am rying to run same code from university network i am
> > geting this error massages.
>
> >  Your calendars:
> >  com.google.gdata.util.AuthenticationException: Error connecting with login
> > URI
> >   at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(Unknown
> > Source)
> >   at
> > com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(Unknown
> > Source)
> >   at com.google.gdata.client.GoogleService.setUserCredentials(Unknown
> > Source)
> >   at com.google.gdata.client.GoogleService.setUserCredentials(Unknown
> > Source)
> >   at test.CalendarTest.main(CalendarTest.java:26)
> >  Caused by: java.net.ConnectException: Connection timed out: connect
> >   at java.net.PlainSocketImpl.socketConnect(Native Method)
> >   at java.net.PlainSocketImpl.doConnect(Unknown Source)
> >   at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
> >   at java.net.PlainSocketImpl.connect(Unknown Source)
> >   at java.net.Socket.connect(Unknown Source)
> >   at java.net.Socket.connect(Unknown Source)
> >   at sun.net.NetworkClient.doConnect(Unknown Source)
> >   at sun.net.www.http.HttpClient.openServer(UnknownSource)
> >   at sun.net.www.http.HttpClient.openServer(UnknownSource)
> >   at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
> >   at sun.net.www.protocol.https.HttpsClient.New(UnknownSource)
> >   at
> > sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClien...
> > Source)
> >   at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
> > Source)
> >   at
> > sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown
> > Source)
> >   at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown
> > Source)
> >   at
> > sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown
> > Source)
> >   at com.google.gdata.client.GoogleAuthTokenFactory.makePostRequest(Unknown
> > Source)
> >   ... 5 more
> >  Exception in thread "main" java.lang.NullPointerException
> >   at test.CalendarTest.main(CalendarTest.java:47)
>
> >  code snipped
> >  System.setProperty("http.proxyHost", "xyz.com");
> >            System.setProperty("http.proxyPort", "8080");
> >  CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
> >    try {
> >     myService.setUserCredentials(username, password);
> >  }
>
> >  i am not sure what i shd in place of xyz.com. as i am runing this
> > application on my laptop.
>
> >  Please reply soon
>
> >  AKBAR B SHAIK- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to