From: Andrew B. <a.g...@le...> - 2006-04-26 10:37:14
|
I've come across what might be a bug in Java 1.5.0 It first showed up when I upgraded our system to 1.5.0 and file uploads stopped working with mvnForum behind a Guanxi guard. They worked fine if mvnForum was not behind the guard. At first I thought this was a problem with Guanxi and contacted Alistair, but I now know the problem actually lies in Java (humble apologies and cakes to Alistair). When an mvnForum user tried to upload a file, he/she was presented with a null pointer exception. This was generated in mvnForum (actually in net.myvietnam.mvncore.fileupload.FileUpload) at the following code: HttpServletRequest req; public static final String CONTENT_TYPE = "Content-type"; String contentType = req.getHeader(CONTENT_TYPE); I put a bit of debugging code into the mvnforum and guanxi code and was able to show that the 'content-type' header was arriving at the guard OK and was being passed through to the mvnForum class when the guard rewrote the request. According to the Java docs, the string passed to request.getHeader() is case insensitive. However, the exception went away when I changed the code to read: public static final String CONTENT_TYPE = "content-type"; Seems the definition of case-insensitive isn't quite what you might expect. Aggie |
From: Matthew B. <mat...@ou...> - 2006-04-26 10:43:13
|
Andrew Booth wrote: > I put a bit of debugging code into the mvnforum and guanxi code and was able > to show that the 'content-type' header was arriving at the guard OK and was > being passed through to the mvnForum class when the guard rewrote the > request. According to the Java docs, the string passed to > request.getHeader() is case insensitive. However, the exception went away When you say the guard rewrote the request do you mean it wrapped it in a servletrequestwrapper? Is this tomcat 5.0 or 5.5? -- -- Matthew Buckett, VLE Developer -- Learning Technologies Group, Oxford University Computing Services -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ |
From: Andrew B. <a.g...@le...> - 2006-04-26 10:49:45
|
Yes - it wraps it in a servlet requestwrapper. I'm using Tomcat 5.5.16 on our production server under Solaris, but the bug also happens with Tomcat 5.0.28 under OS-X. -----Original Message----- From: bod...@li... [mailto:bod...@li...] On Behalf Of Matthew Buckett Sent: 26 April 2006 11:43 To: bod...@li... Subject: Re: [Bodington-developers] Possible bug in Java 1.5.0 Andrew Booth wrote: > I put a bit of debugging code into the mvnforum and guanxi code and was able > to show that the 'content-type' header was arriving at the guard OK and was > being passed through to the mvnForum class when the guard rewrote the > request. According to the Java docs, the string passed to > request.getHeader() is case insensitive. However, the exception went away When you say the guard rewrote the request do you mean it wrapped it in a servletrequestwrapper? Is this tomcat 5.0 or 5.5? -- -- Matthew Buckett, VLE Developer -- Learning Technologies Group, Oxford University Computing Services -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Bodington-developers mailing list Bod...@li... https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Matthew B. <mat...@ou...> - 2006-04-26 10:58:01
|
Andrew Booth wrote: > Yes - it wraps it in a servlet requestwrapper. And it doesn't implement it's own getHeader() method but rather leaves it to the HttpServletRequestWrapper implementation. -- -- Matthew Buckett, VLE Developer -- Learning Technologies Group, Oxford University Computing Services -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ |
From: Andrew B. <a.g...@le...> - 2006-04-26 11:24:15
|
You are right, it overrides getHeader(). I want my cakes back! ;-) -----Original Message----- From: bod...@li... [mailto:bod...@li...] On Behalf Of Matthew Buckett Sent: 26 April 2006 11:58 To: bod...@li... Subject: Re: [Bodington-developers] Possible bug in Java 1.5.0 Andrew Booth wrote: > Yes - it wraps it in a servlet requestwrapper. And it doesn't implement it's own getHeader() method but rather leaves it to the HttpServletRequestWrapper implementation. -- -- Matthew Buckett, VLE Developer -- Learning Technologies Group, Oxford University Computing Services -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Bodington-developers mailing list Bod...@li... https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Sean M. <se...@sm...> - 2006-04-26 13:57:46
|
Phew! Them's fighting words. I'm standing back.... (BTW: Alistair is out this week, so get your cheap shots in now!-) s On 26 Apr 2006, at 12:23, Andrew Booth wrote: > You are right, it overrides getHeader(). > > I want my cakes back! ;-) > > -----Original Message----- > From: bod...@li... > [mailto:bod...@li...] On Behalf Of > Matthew Buckett > Sent: 26 April 2006 11:58 > To: bod...@li... > Subject: Re: [Bodington-developers] Possible bug in Java 1.5.0 > > Andrew Booth wrote: >> Yes - it wraps it in a servlet requestwrapper. > > And it doesn't implement it's own getHeader() method but rather leaves > it to the HttpServletRequestWrapper implementation. > > -- > -- Matthew Buckett, VLE Developer > -- Learning Technologies Group, Oxford University Computing Services > -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers > |
From: Alistair Y. <ali...@sm...> - 2006-05-01 10:37:18
|
The GuardRequest just copies the headers as-is. It doesn't change them. It just adds the SAML attributes to the headers. So I'd say it is indeed a java 1.5 bug and you do indeed, sir, owe me an eclair ;) Alistair On 26 Apr 2006, at 12:23, Andrew Booth wrote: > You are right, it overrides getHeader(). > > I want my cakes back! ;-) > > -----Original Message----- > From: bod...@li... > [mailto:bod...@li...] On Behalf Of > Matthew Buckett > Sent: 26 April 2006 11:58 > To: bod...@li... > Subject: Re: [Bodington-developers] Possible bug in Java 1.5.0 > > Andrew Booth wrote: >> Yes - it wraps it in a servlet requestwrapper. > > And it doesn't implement it's own getHeader() method but rather leaves > it to the HttpServletRequestWrapper implementation. > > -- > -- Matthew Buckett, VLE Developer > -- Learning Technologies Group, Oxford University Computing Services > -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |