Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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?

1 vote


Accepted answer

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

0 votes


3 other answers

Permanent link
 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

0 votes


Permanent link

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


0 votes


Permanent link
Hi Umesh,

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

Try to ignore CookiePolicy.IGNORE_COOKIES.

Thanks & Best Regards,
Manju

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Apr 22 '13, 9:47 a.m.

Question was seen: 14,194 times

Last updated: Dec 12 '18, 8:06 a.m.

Confirmation Cancel Confirm