It's all about the answers!

Ask a question

Unable to parse expires attribute: Mon

helene højrup (231912) | asked Apr 22 '13, 9:47 a.m.
I'm trying to follow lab6, example 3 in the CLM 2012 OSLC Workshop.

In the 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

permanent link
Arne Bister (2.6k12832) | answered Oct 19 '16, 8:06 a.m.

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
Ralph Schoon selected this answer as the correct answer

3 other answers

permanent link
Mike Jaworski (1.4k6) | answered Apr 24 '13, 10:18 a.m.

See if this article offers any help: 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.

Mike Jaworski

permanent link
ukrishne k (213) | answered Dec 12 '18, 2:26 a.m.

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

permanent link
Manju Gowda (37110) | answered Dec 12 '18, 8:06 a.m.
Hi Umesh,

Are you trying to login to the application which has reverse proxy. ?

Try to ignore CookiePolicy.IGNORE_COOKIES.

Thanks & Best Regards,

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.