It appeared that this bug (I'm sure it is) is connected to one of my
previuos postings. A NullPointerException mentioned is throwed ONLY if we
are processing a servlet-security-protected page and resin is just
forwarding the request to login page. In 2.0.5 ANY custom filters described
in web.xml were simply SKIPPED (my old posting was just about that). In
2.1.0 however (and it's good, seems developers have fixed this issue) custom
filters are processed just after forward to login page. BUT if one of these
filters tries to do request.setCharacterEncoding("some encoding"), a
NullPointerException is throwed by com.caucho.vfs.ReadStream.setEncoding(),
see stacktrace below. This is because field
com.caucho.vfs.ReadStream.readEncodingName is null at the moment of
setCharacterEncoding() invocation. And in turn it's null because no
"content-type" header is sent and
com.caucho.server.http.Request.getCharacterEncoding() hence returned null.
I hope this will be fixed in the nearest future.
Best wishes,
Alexei Yudichev mailto:alexey@xxx.com
-----Original Message-----
From: Alexey Yudichev
Sent: Friday, March 29, 2002 7:54 PM
To: resin-interest@xxx.com
Subject: 2.0.5 -> 2.1.0 => NullPointerException
After upgrading to 2.1.0 I get the following exception when one of my
filters tries to invoke request.setCharacterEncoding("Cp1253"). Have anybody
got similar problems?
java.lang.NullPointerException
at com.caucho.vfs.ReadStream.setEncoding(ReadStream.java:400)
at
com.caucho.server.http.Request.setCharacterEncoding(Request.java:966)
at
com.caucho.server.http.RequestAdapter.setCharacterEncoding(RequestAdapter.ja
va:270)
at com.tw.servlet.filters.I18nFilter.doFilter(I18nFilter.java:60)
at
com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:87)
at
com.tw.servlet.filters.RequestInfoFIlter.doFilter(RequestInfoFIlter.java:87)
at
com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:87)
at
com.tw.servlet.filters.ErrorHunterFilter.doFilter(ErrorHunterFilter.java:41)
at
com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:87)
at com.caucho.server.http.Invocation.service(Invocation.java:291)
at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:132)
at
com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:21
2)
at
com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:99
)
at
com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:76
)
at
com.caucho.http.security.FormLogin.authenticate(FormLogin.java:228)
at
com.caucho.server.http.AbstractRequest.authenticate(AbstractRequest.java:662
)
at
com.caucho.http.security.SecurityFilter.doFilter(SecurityFilter.java:104)
at
com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:87)
at com.caucho.server.http.Invocation.service(Invocation.java:291)
at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:132)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:217)
at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:159)
at com.caucho.server.TcpConnection.run(TcpConnection.java:136)
at java.lang.Thread.run(Thread.java:536)
Best wishes,
Alexei Yudichev mailto:alexey@xxx.com
Received on Tue 02 Apr 2002 05:51:14 -0800
This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:17:00 PDT