I've gotten some test code to compile, etc, but when I call refreshInbox(), I get "Entity enclosing requests cannot be redirected without user intervention". Am I missing a step, has GMail changed and broken jGmail, or what? Any suggestions would be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I see this thread is old, but im hoping you could help me anyway.
Same problem as above:
java.lang.IllegalArgumentException: Entity enclosing requests cannot be redirected without user intervention
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:221)
at net.sf.jgmail.GmailAdapter.makeWebRequest(GmailAdapter.java:312)
at net.sf.jgmail.GmailAdapter.login(GmailAdapter.java:145)
at net.sf.jgmail.GmailAdapter.refresh(GmailAdapter.java:113)
at net.sf.jgmail.GmailSession.refreshInbox(GmailSession.java:132)
at axon.gmail_client.Test_Access.main(Test_Access.java:22)
<terminated, exit value: 0>/opt/jdk1.6.0_10/bin/java (10 Feb 2009 2:31:10 PM)
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Per default HttpClient automatically handles redirects for all non entity enclosing methods. Just do not PostMethod#setFollowRedirects() to true in your code and everything should be fine. i.e.
Even though I set setFollowRedirects to false, I cannot connect to gmail successfully. Has something changed in gmail and jgmail is not in sync?
The exception I get & response is:
net.sf.jgmail.LoginException: Unable to find _sgh value in rawResponse <html><head><title>Google Accounts</title>
<style type="text/css">
body {font-family: arial,sans-serif;}
.body {margin: 0 15px; }
I've gotten some test code to compile, etc, but when I call refreshInbox(), I get "Entity enclosing requests cannot be redirected without user intervention". Am I missing a step, has GMail changed and broken jGmail, or what? Any suggestions would be appreciated.
I haven't worked on this in a while. If you want to debug and submit a path that would be great.
Hi
I see this thread is old, but im hoping you could help me anyway.
Same problem as above:
java.lang.IllegalArgumentException: Entity enclosing requests cannot be redirected without user intervention
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:221)
at net.sf.jgmail.GmailAdapter.makeWebRequest(GmailAdapter.java:312)
at net.sf.jgmail.GmailAdapter.login(GmailAdapter.java:145)
at net.sf.jgmail.GmailAdapter.refresh(GmailAdapter.java:113)
at net.sf.jgmail.GmailSession.refreshInbox(GmailSession.java:132)
at axon.gmail_client.Test_Access.main(Test_Access.java:22)
<terminated, exit value: 0>/opt/jdk1.6.0_10/bin/java (10 Feb 2009 2:31:10 PM)
Thanks
Hey Folks,
Also having the same issue.
Debugged it as far as GMailAdapter.makeWebRequest() around
method.setFollowRedirects(true);
I'll carry on the digging tomorrow, but if there is any ideas afloat feel free to post them.
Cheers,
N.
Per default HttpClient automatically handles redirects for all non entity enclosing methods. Just do not PostMethod#setFollowRedirects() to true in your code and everything should be fine. i.e.
GMailAdapter.makeWebRequest()
method.setFollowRedirects(false);
See the HttpClient redirect handling guide for details:
http://jakarta.apache.org/commons/httpclient/redirects.html
Hi there,
Even though I set setFollowRedirects to false, I cannot connect to gmail successfully. Has something changed in gmail and jgmail is not in sync?
The exception I get & response is:
net.sf.jgmail.LoginException: Unable to find _sgh value in rawResponse <html><head><title>Google Accounts</title>
<style type="text/css">
body {font-family: arial,sans-serif;}
.body {margin: 0 15px; }
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 dir="ltr" bgcolor="#ffffff" text="#000000" link="#0000cc" vlink="#551a8b" alink="#ff0000"><style type="text/css">
.aligns {
text-align: right;
}
.margins {
margin-left: 13px;
}
.floats-normal {
float: left;
}
.floats-reverse {
float: right;
margin-top: 17px;
}
</style>
<div class="topbar aligns" style="font-size:smaller; margin-bottom:0 15px 1px 15px; white-space:nowrap;">
<a href="http://www.google.com">Google Home</a>
|
<a href="https://www.google.com/accounts/Login">Sign In</a></div>
<div class="header margins" style="height: 40px; margin: 13px 15px 9px 15px;"><a href="https://www.google.com/accounts/"><img src="googleaccountslogo/en.gif" border="0" class="floats-normal" alt="Google"></a>
</div>
<div style="clear:both;"></div>
<div class="body"><p>Invalid request.
</p></div>
<div class="footer" style="color: #666; font-size: smaller; margin: 50px 15px 0 15px; text-align: center;">&copy;2009 Google
-
<a href="http://www.google.com">Google Home</a>
-
<a href="https://www.google.com/accounts/TOS?hl=en">Terms of Service</a>
-
<a href="http://www.google.com/intl/en/privacy.html">Privacy Policy</a>
-
<a href="http://www.google.com/support/accounts?hl=en">Help</a></div></body></html>
at net.sf.jgmail.GmailAdapter.login(GmailAdapter.java:156)
at net.sf.jgmail.GmailAdapter.refresh(GmailAdapter.java:113)
at net.sf.jgmail.GmailSession.refreshInbox(GmailSession.java:132)
.
.
.
Any ideas?
Thanks.