I am getting following exception when trying to access the deployed war application.
Environment Details: WAS Liberty Profile and IBM JDK 6
<pre>
Exception = java.lang.IllegalArgumentException
Source = com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters
probeid = 1105
Stack Dump = java.lang.IllegalArgumentException: Cookie name "Path" is a reserved token
at javax.servlet.http.Cookie.<init>(Cookie.java:139)
at com.ibm.ws.webcontainer.osgi.request.IRequestImpl.getCookies(IRequestImpl.java:147)
at com.ibm.ws.webcontainer.srt.SRTServletRequest.getCookies(SRTServletRequest.java:1600)
at com.ibm.ws.webcontainer.security.internal.WebRequestImpl.determineIfRequestHasAuthenticationData(WebRequestImpl.java:155)
at com.ibm.ws.webcontainer.security.internal.WebRequestImpl.hasAuthenticationData(WebRequestImpl.java:176)
at com.ibm.ws.webcontainer.security.internal.WebAppSecurityCollaboratorImpl.optionallyAuthenticateUnprotectedResource(WebAppSecurityCollaboratorImpl.java:392)
at com.ibm.ws.webcontainer.security.internal.WebAppSecurityCollaboratorImpl.performSecurityChecks(WebAppSecurityCollaboratorImpl.java:343)
at com.ibm.ws.webcontainer.security.internal.WebAppSecurityCollaboratorImpl.preInvoke(WebAppSecurityCollaboratorImpl.java:327)
at com.ibm.wsspi.webcontainer.collaborator.CollaboratorHelper.preInvokeCollaborators(CollaboratorHelper.java:431)
at com.ibm.ws.webcontainer.osgi.collaborator.CollaboratorHelperImpl.preInvokeCollaborators(CollaboratorHelperImpl.java:267)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1033)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:81)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:930)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$1.run(DynamicVirtualHost.java:253)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:457)
at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398)
at com.ibm.ws.threading.internal.Worker.run(Worker.java:380)
at java.lang.Thread.run(Thread.java:770)
</pre>
Can somebody help on this?
There are restrictions on cookie names, including a selection of reserved names/tokens[1]. (No need to worry about the specific environment in this case.) =) You may not use any of the following names (this list may not be exhaustive):
Also, since cookies are case-insensitive[2], "Path" will spark the same
java.lang.IllegalArgumentException
as "path" will.As for the restrictions, cookie names:
$
[2],
or semicolons;
[3]=)
References
From the stacktrace, it looks like that the cookie from the client side (maybe the browser ?) has an invalid name. Per the Cookie java doc, some reserved words are not allowed for cookie name.