Mamallan,
here are my dummy test to see what is causing server log errors:
--------------------------------------------------------------------------------------
public void doFilter(
ServletRequest request,
ServletResponse response,
FilterChain chain) throws IOException, ServletException
{
System.out.println("-------------1");
if (!_filters.isEmpty())
chain = new FilterListChain(_filters, chain);
System.out.println("-------------2");
request.setAttribute(_FILTER_EXECUTED_KEY, Boolean.TRUE);
System.out.println("-------------3");
ExternalContext externalContext = new
ServletExternalContext(_servletContext, request, response);
System.out.println("-------------4");
GlobalConfiguratorImpl config = GlobalConfiguratorImpl.getInstance();
System.out.println("-------------5");
config.beginRequest(externalContext);
System.out.println("-------------6");
String noJavaScript = request.getParameter(XhtmlConstants.NON_JS_BROWSER);
System.out.println("-------------7");
if(noJavaScript != null &&
XhtmlConstants.NON_JS_BROWSER_TRUE.equals(noJavaScript))
{
request = new
BasicHTMLBrowserRequestWrapper((HttpServletRequest)request);
}
System.out.println("-------------8");
Map<String, String[]> addedParams =
FileUploadConfiguratorImpl.getAddedParameters(externalContext);
System.out.println("-------------9");
if(addedParams != null)
{
FileUploadConfiguratorImpl.apply(externalContext);
request = new UploadRequestWrapper((HttpServletRequest)request,
addedParams);
}
System.out.println("-------------10");
try
{
_doFilterImpl(request, response, chain);
System.out.println("-------------100");
}
--------------------------------------------------------------------------------------------------------------------------------------
private void _doFilterImpl(
ServletRequest request,
ServletResponse response,
FilterChain chain) throws IOException, ServletException
{
System.out.println("-------------11");
ExternalContext ec = new ServletExternalContext(_servletContext, request,
response);
System.out.println("-------------12");
boolean isHttpReq = ExternalContextUtils.isHttpServletRequest(ec);
System.out.println("-------------13");
if(isHttpReq)
{
System.out.println("-------------14");
response = _getResponse(ec);
System.out.println("-------------15");
ec.setResponse(response);
System.out.println("-------------16");
}
System.out.println("-------------17");
PseudoFacesContext pfc = new PseudoFacesContext(ec);
System.out.println("-------------18");
_PSEUDO_FACES_CONTEXT.set(pfc);
System.out.println("-------------19");
try
{
if(isHttpReq)
{
System.out.println("-------------20");
request = _getRequest(ec);
System.out.println("-------------21");
ec.setRequest(request);
System.out.println("-------------22");
}
System.out.println("-------------23");
chain.doFilter(request, response);
System.out.println("-------------24");
if(isHttpReq)
{
System.out.println("-------------25");
_handleDialogReturn(ec);
System.out.println("-------------26");
}
}
finally
{
System.out.println("-------------27");
_PSEUDO_FACES_CONTEXT.remove();
System.out.println("-------------28");
}
}
---------------------------------------------------------------------------------------------------------------------
and here is the server log for this
-------------1
-------------2
-------------3
-------------4
-------------5
-------------6
-------------7
-------------8
-------------9
-------------10
-------------11
PWC4011: Unable to set request character encoding to UTF-8 from context /YP,
because request parameters have already been read, or
ServletRequest.getReader() has already been called
-------------12
-------------13
-------------14
-------------15
-------------16
-------------17
-------------18
-------------19
-------------20
-------------21
PWC4011: Unable to set request character encoding to UTF-8 from context /YP,
because request parameters have already been read, or
ServletRequest.getReader() has already been called
-------------22
-------------23
PWC4011: Unable to set request character encoding to UTF-8 from context /YP,
because request parameters have already been read, or
ServletRequest.getReader() has already been called
TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs
(12/06/2007))
Server: unknown
file:/opt/glassfish/domains/domain1/applications/j2ee-apps/YachtPool/YachtPool-ejb_jar/-YachtPool-PU
login successful
-------------24
-------------25
-------------26
-------------27
-------------28
-------------100
Matthias,
there must be some other changes in filter chain because, before fix 1272
because server didn't display this errors. Maybe it is a Glassfish bug, but
how to track the root cause?
Luka Surija
+385 1 61 99 140
+385 98 434 061
[email protected]
I.Y. tim d.o.o.
Vrbik 3, HR-10000 Zagreb
www.iytim.hr
[email protected]
Tadashi Enomori wrote:
Luka,
Thanks for bringing this issue to our attention and investigating the
issue to isolate the cause.
Our team will be working to deliver the solution as soon as possible.
Thanks,
Tadashi
Luka Surija wrote:
Thank you Matthias!
Luka Surija
+385 1 61 99 140
+385 98 434 061
[email protected]
I.Y. tim d.o.o.
Vrbik 3, HR-10000 Zagreb
www.iytim.hr
[email protected]
Matthias Wessendorf wrote:
On Wed, Mar 18, 2009 at 2:52 PM, Luka Surija <[email protected]>
wrote:
Putting "ExternalContext externalContext = new
ServletExternalContext(_servletContext, request, response); " in a
first
line of the function just before
String noJavaScript =
request.getParameter(XhtmlConstants.NON_JS_BROWSER);
resolved the problem with character encoding, but errors in server log
remains.
I'm not sure what is the best solution because:
I pinged the guys that offered the patch. They are
from another team at Oracle. They are aware of the issue.
So, a correct patch should be available soon.
-Matthias
request = new
BasicHTMLBrowserRequestWrapper((HttpServletRequest)request);
is called (if noJavaScript==true) before ExternalContext creation, and
I
think it has a good reason because it changes the request befor any
other
initialization.
on the other hand putting fix 1272 after ExternalContext creation
looks
like has no meaning, but I can't test it.
Luka Surija
+385 1 61 99 140
+385 98 434 061
[email protected]
I.Y. tim d.o.o.
Vrbik 3, HR-10000 Zagreb
www.iytim.hr
[email protected]
Luka Surija wrote:
I'll try your suggestion and post the results.
Luka Surija
+385 1 61 99 140
+385 98 434 061
[email protected]
I.Y. tim d.o.o.
Vrbik 3, HR-10000 Zagreb
www.iytim.hr
[email protected]
Matthias Wessendorf wrote:
in here:
ExternalContext externalContext = new
ServletExternalContext(_servletContext, request, response);
we set the encoding (inside of the ServetExternalContext(...)), so
the
fix for 1272 should be done after that,
or we need to create the ServetExternalContext earlier...
-Matthias
On Wed, Mar 18, 2009 at 2:01 PM, Luka Surija <[email protected]>
wrote:
https://issues.apache.org/jira/browse/TRINIDAD-1430
Luka Surija
+385 1 61 99 140
+385 98 434 061
[email protected]
I.Y. tim d.o.o.
Vrbik 3, HR-10000 Zagreb
www.iytim.hr
[email protected]
Matthias Wessendorf wrote:
Hi Luka,
thanks for following up here.
Do you mind to create an issue for the problem that you are facing?
It would be good to link to 1272 as it is the source of the
problem.
Once done, I'll follow up on that issue(s).
-Matthias
On Wed, Mar 18, 2009 at 1:29 PM, Luka Surija <[email protected]>
wrote:
Finally I've found the source of the problem in general. svn
revision
713294
(TRINIDAD-1272 - Support for WAP2.0 Browser without JavaScript) is
introducing this problem.
The changes in TrinidadFilterImpl.java causes this issue.
this line looks like source of the problems
String noJavaScript =
request.getParameter(XhtmlConstants.NON_JS_BROWSER);
request is probably called too early, so the JSF (Majorra) can't
set
proper
CharacterEncoding, and that's why server reported the error
message
and
messed up non-US characters.
Luka Surija
+385 1 61 99 140
+385 98 434 061
[email protected]
I.Y. tim d.o.o.
Vrbik 3, HR-10000 Zagreb
www.iytim.hr
[email protected]
Matthias Wessendorf wrote:
ah, good to know.
Did you test the recent trunk ?
-Matthias
On Tue, Mar 17, 2009 at 7:43 PM, Luka Surija
<[email protected]>
wrote: