Unable to parse expires attribute: Mon
Hi
I'm trying to follow lab6, example 3 in the CLM 2012 OSLC Workshop.
In the httpUtils.java I get a warning when executing the step
HttpResponse documentResponse = httpClient.execute(request);
when trying to access the RMCatalog.
The warning that I get is
22-04-2013 15:32:24 org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: jfs-request-token-01e6dd241caf46e589245c4a56cdb99f="n1duY2KTK5pRsDtQQMWGSh2YJZMcoVcpfLCzjpDv1E"; Version=1; Max-Age=600; Expires=Mon, 22-Apr-2013 13:42:24 GMT; Path=/rm". Unable to parse expires attribute: Mon
22-04-2013 15:32:24 org.apache.http.impl.client.DefaultRequestDirector handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm=https://myServer:9443/jts/oauth-authorize}
Any ideas on how I solve this?
I'm trying to follow lab6, example 3 in the CLM 2012 OSLC Workshop.
In the httpUtils.java I get a warning when executing the step
HttpResponse documentResponse = httpClient.execute(request);
when trying to access the RMCatalog.
The warning that I get is
22-04-2013 15:32:24 org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: jfs-request-token-01e6dd241caf46e589245c4a56cdb99f="n1duY2KTK5pRsDtQQMWGSh2YJZMcoVcpfLCzjpDv1E"; Version=1; Max-Age=600; Expires=Mon, 22-Apr-2013 13:42:24 GMT; Path=/rm". Unable to parse expires attribute: Mon
22-04-2013 15:32:24 org.apache.http.impl.client.DefaultRequestDirector handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm=https://myServer:9443/jts/oauth-authorize}
Any ideas on how I solve this?
Accepted answer
Hi,
I was able to overcome this by adding a different cookie policy to the httpclient: httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
The question is a couple of years old already but maybe this helps the next reader. If so I would appreciate if you accept his as answer. - Arne
I was able to overcome this by adding a different cookie policy to the httpclient: httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
The question is a couple of years old already but maybe this helps the next reader. If so I would appreciate if you accept his as answer. - Arne
3 other answers
Helene,
See if this article offers any help: https://issues.apache.org/jira/browse/HTTPCLIENT-896. It looks like the "Expires" value for your cookie is not in a valid format (for whatever reason) and this article provides some steps in the comments to workaround. Not sure if you can simply pass this "CookieSpecPNames.DATE_PATTERNS" parameter through the HTTP request or if you need to actually perform the cookie transformation suggested in this article, but hopefully this helps.
Thanks,
Mike Jaworski
HI Arne,
I am facing the same issue, I have added line you have mentioned after DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
I am getting compile time error "BROWSER_COMPATIBILITY can't be resolved or it is not a field.
Please help me
Thanks in Advance