canot login

subhash
2006-07-10
2013-04-03
  • subhash
    subhash
    2006-07-10

    sir
    i am using g4j 0.3.19 version and g4j-deps o.3.15b .i am unlable to login to gmail.
    my code is:
    ////////////////////
    import siuying.gm.GMConnector;
    import java.util.TimeZone;
    public class test {

        /**
         * @param args
         */
        public static void main(String[] args) {
           
            try{
            //connector.setTimezone("GMT-8");
          //connector.setProxy("192.168.0.10",8080);
        
            GMConnector gm;
             gm = null;
            try {
            gm = new GMConnector();
            gm.setUser("user_id");
            gm.setPasswd("passwd");
            gm.setTimezone(TimeZone.getTimeZone("GMT-8").getID());
            } catch (NumberFormatException nfe) {
            System.exit(1);
            }
            
            if (gm.connect()) {
            System.out.println("Logged in.");
            } else {
            System.out.println("Failed logging in!");
            System.exit(1);
            }

            boolean  i;
           
            i=gm.isConnected();
            if(i)
             System.out.println("connection is created");   
            else
              System.out.println("connection failed");       
           
            // TODO Auto-generated method stub;

       
        }
            catch(Exception erro) { 
            erro.printStackTrace(); 
        }

        }
    }
    //////////////////////////////////////
    error messg. is:

    Jul 10, 2006 10:20:59 AM siuying.gm.GMConnector <init>
    INFO: Initializing ...
    Jul 10, 2006 10:20:59 AM siuying.gm.GMConnector <init>
    INFO: Initialization done.
    Jul 10, 2006 10:20:59 AM siuying.gm.GMConnector connect
    INFO: Request Body: org.apache.commons.httpclient.methods.PostMethod@179c285
    Jul 10, 2006 10:21:04 AM siuying.gm.GMConnector connect
    WARNING: Connect failed:        <html>    <head>  <title> Google Accounts </title>  <style type="text/css"><!--

          .body { margin-left: 3em;
                  margin-right: 5em;
                  font-family: arial,sans-serif; }

          div.errorbox-good {}

          div.errorbox-bad {}

          div.errormsg { color: red; font-size: smaller; font-family: arial,sans-serif;}
          font.errormsg { color: red; font-size: smaller; font-family: arial,sans-serif;}
        //--> </style>  </head>  <body alink="#ff0000" text="#000000" bgcolor="#ffffff" link="#0000cc" vlink="#551a8b" dir="ltr">                       <table cellpadding="0" width="100%" cellspacing="0" border="0"> <tr> <td align="right" nowrap> <font size="-1" face="Arial, sans-serif">           <a href="http://www.google.com">Google Home</a>  |     <a href="https://www.google.com/accounts/Login">Sign In</a>    </font> </td> </tr> <tr> <td><img width="1" alt="" height="1"></td> </tr> </table>  <table cellpadding="2" width="100%" cellspacing="0" border="0"> <tr> <td colspan="2"><img width="1" alt="" height="2"></td> </tr> <tr> <td width="1%" valign="top">  <a href="https://www.google.com/accounts/"> <img src="googleaccountslogo.gif" alt="Google" border="0" align="left">   </a>  </td> <td valign="top"> <table cellpadding="0" width="100%" cellspacing="0" border="0"> <tr> <td colspan="2"><img width="1" alt="" height="15"></td> </tr> <tr bgcolor="#3366cc"> <td><img width="1" alt="" height="1"></td> </tr> <tr bgcolor="#e5ecf9"> <td style="padding-left: 4px; padding-bottom:3px; padding-top:2px; font-family:arial,sans-serif;"> <b>Google Accounts</b></td> </tr> <tr> <td colspan="2"><img width="1" alt="" height="5"></td> </tr>  </table> </td> </tr> </table>   <div class="body"> <p> Invalid request. </p> </div>   <style type="text/css"><!--

    .footer { padding-right: 5px;
              padding-left: 5px;
              padding-bottom: 5px;
              padding-top: 5px;
              font-size: 83%;
              border-top: #ffffff 1px solid;
              border-bottom: #ffffff 1px solid;
              background: #e5ecf9;
              text-align: center;
              font-family: arial,sans-serif;
    }
    //--> </style> <br><br> <div align="center" class="footer"> <font color="#666666">  &copy;2005 Google  </font> - <a href="http://www.google.com">Google Home</a> - <a href="http://www.google.com/terms_of_service.html">Terms of Service</a> - <a href="http://www.google.com/privacy.html">Privacy Policy</a> - <a href="http://www.google.com/help/faq_accounts.html">About Google Accounts</a> </div>  </body> </html>
    Failed logging in!

    //////////////////////
    sir,
    pls help me ..........