You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Samba <sa...@gmail.com> on 2008/03/14 07:55:10 UTC
Trinidad FileUpload failing with Tomahawk Extension Filter
Hi!
I'm using both Trinidad and Tomahawk components together in the same page.
I wanted to use Trinidad InputFileUpload component for uploading files..
But I'm getting null pointer exception
Stack Trace is given below:
javax.servlet.ServletException: #{fileUploadTest.doUpload}:
/home.xhtml @27,74 action="#{fileUploadTest.doUpload}":
java.lang.NullPointerException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
*root cause*
javax.faces.FacesException: #{fileUploadTest.doUpload}: /home.xhtml
@27,74 action="#{fileUploadTest.doUpload}":
java.lang.NullPointerException
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
*root cause*
javax.faces.el.EvaluationException: /home.xhtml @27,74
action="#{fileUploadTest.doUpload}": java.lang.NullPointerException
org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
*root cause*
java.lang.NullPointerException
demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
com.sun.el.parser.AstValue.invoke(AstValue.java:151)
com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
Is there any known issues of incompatibility of Trinidad FileUploader with
Tomahawk Extension Filtter?
Thanking you in advance,
--
Regards...
Samba.
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Samba <sa...@gmail.com>.
Hi! Scott and Mathew,
does that mean Trnidad File Upload shall not work with Commons File
Uploader or is the converse also true--- I mean to ask whether the
tomahawk's commons file uploader will also fail in the presence of Trinidad
Fileuploader ?
And what if I need to write my own handling of File Uploading feature --
will that work, or will it also fail because of these diverse file upload
handlers?
Can you please clarify on this ?
If need be , I'll think of rolling my own handler for uploading files if
none of the existing ones work with each other..., but is that possible?
or is it that only one form handler can exist per web app that can process
file uploads?
File Upload is an important feature in our app, and it is highly impossible
to compromise on this requirement.
Thanking you in advance,
Samba
On Sat, Mar 15, 2008 at 12:44 AM, Scott O'Bryan <da...@gmail.com> wrote:
> Actually I take that last part back, it will NOT fix the issue now that I
> look at it. The two are incompatible.
>
> Scott
>
>
> On Fri, Mar 14, 2008 at 1:13 PM, Scott O'Bryan <da...@gmail.com>
> wrote:
>
> > Samba, this will not work because Tobago's filter is doing the
> > multi-part form handling. The two mechanisms are incompatible with each
> > other and will be until we have uniform handling of the multi-part form
> > request. (I know Matthias, yes the configurator commons is comming... :)
> > ).
> >
> > Adding the TrinidadFilter mapping BEFORE the Tobago Filter will probably
> > fix the issue.
> >
> > Scott
> >
> >
> > On Fri, Mar 14, 2008 at 5:37 AM, Samba <sa...@gmail.com> wrote:
> >
> > > Hi! Mathew,
> > >
> > > Below I pasted the code of the method referrred;
> > >
> > > *
> > >
> > > public
> > > *String doUpload(){
> > >
> > > *try* {
> > >
> > > BufferedInputStream bis =
> > > *new* BufferedInputStream(((UploadedFile)fileOne).getInputStream());
> > >
> > > OutputStream os =
> > > *null*;
> > >
> > > System.
> > > *out*.println("ContentType : "+fileOne.getContentType()+"$$$$$$$$$$" +
> > > fileOne.getFilename() );
> > >
> > > os =
> > > *new* FileOutputStream("C:\\temp\\"+fileOne.getFilename());
> > >
> > > *int* element;
> > >
> > > *while*((element=bis.read())!=-1){
> > >
> > > os.write(element);
> > >
> > > }
> > >
> > > }
> > > *catch* (IOException e) {
> > >
> > > // *TODO* Auto-generated catch block
> > >
> > > e.printStackTrace();
> > >
> > > }
> > >
> > > *return* *null*;
> > >
> > > }
> > >
> > > It is working fine even if I have Tomahawk jars and commons-fileupload
> > > jar in my lib, but the moment I add the ExtenstionFilter configuration
> > > entries in the web.xml, it is failing by throwing a NPE..
> > >
> > > hope this is not a bug and will get a solution to the problem soon,
> > > Samba
> > > On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf <
> > > matzew@apache.org> wrote:
> > >
> > > > Hi,
> > > >
> > > > ....
> > > > >
> > > > >
> > > > > root cause java.lang.NullPointerException
> > > > > demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> > > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >
> > > > > sun.reflect.NativeMethodAccessorImpl.invoke(
> > > > NativeMethodAccessorImpl.java:39)
> > > > >
> > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > > DelegatingMethodAccessorImpl.java:25)
> > > >
> > > > *snip*
> > > > can you provide the code of the doUpload() ?
> > > >
> > > > > Is there any known issues of incompatibility of Trinidad
> > > > FileUploader with
> > > > > Tomahawk Extension Filtter?
> > > >
> > > > not that I know...
> > > >
> > > > -Matthias
> > > >
> > > > > Thanking you in advance,
> > > > >
> > > > > --
> > > > > Regards...
> > > > > Samba.
> > > >
> > > >
> > > >
> > > > --
> > > > Matthias Wessendorf
> > > >
> > > > further stuff:
> > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > sessions: http://www.slideshare.net/mwessendorf
> > > > mail: matzew-at-apache-dot-org
> > > >
> > >
> > >
> > >
> > > --
> > > Regards...
> > > Samba.
> >
> >
> >
>
--
Regards...
Samba.
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Scott O'Bryan <da...@gmail.com>.
Actually I take that last part back, it will NOT fix the issue now that I
look at it. The two are incompatible.
Scott
On Fri, Mar 14, 2008 at 1:13 PM, Scott O'Bryan <da...@gmail.com> wrote:
> Samba, this will not work because Tobago's filter is doing the multi-part
> form handling. The two mechanisms are incompatible with each other and will
> be until we have uniform handling of the multi-part form request. (I know
> Matthias, yes the configurator commons is comming... :) ).
>
> Adding the TrinidadFilter mapping BEFORE the Tobago Filter will probably
> fix the issue.
>
> Scott
>
>
> On Fri, Mar 14, 2008 at 5:37 AM, Samba <sa...@gmail.com> wrote:
>
> > Hi! Mathew,
> >
> > Below I pasted the code of the method referrred;
> >
> > *
> >
> > public
> > * String doUpload(){
> >
> > *try* {
> >
> > BufferedInputStream bis =
> > *new* BufferedInputStream(((UploadedFile)fileOne).getInputStream());
> >
> > OutputStream os =
> > *null*;
> >
> > System.
> > *out*.println("ContentType : "+fileOne.getContentType()+"$$$$$$$$$$" +
> > fileOne.getFilename() );
> >
> > os =
> > *new* FileOutputStream("C:\\temp\\"+fileOne.getFilename());
> >
> > *int* element;
> >
> > *while*((element=bis.read())!=-1){
> >
> > os.write(element);
> >
> > }
> >
> > }
> > *catch* (IOException e) {
> >
> > // *TODO* Auto-generated catch block
> >
> > e.printStackTrace();
> >
> > }
> >
> > *return* *null*;
> >
> > }
> >
> > It is working fine even if I have Tomahawk jars and commons-fileupload
> > jar in my lib, but the moment I add the ExtenstionFilter configuration
> > entries in the web.xml, it is failing by throwing a NPE..
> >
> > hope this is not a bug and will get a solution to the problem soon,
> > Samba
> > On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf <ma...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > > ....
> > > >
> > > >
> > > > root cause java.lang.NullPointerException
> > > > demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(
> > > NativeMethodAccessorImpl.java:39)
> > > >
> > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > DelegatingMethodAccessorImpl.java:25)
> > >
> > > *snip*
> > > can you provide the code of the doUpload() ?
> > >
> > > > Is there any known issues of incompatibility of Trinidad
> > > FileUploader with
> > > > Tomahawk Extension Filtter?
> > >
> > > not that I know...
> > >
> > > -Matthias
> > >
> > > > Thanking you in advance,
> > > >
> > > > --
> > > > Regards...
> > > > Samba.
> > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > sessions: http://www.slideshare.net/mwessendorf
> > > mail: matzew-at-apache-dot-org
> > >
> >
> >
> >
> > --
> > Regards...
> > Samba.
>
>
>
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Martin Marinschek <ma...@gmail.com>.
No other features of Tomahawk will fail due to this... this is really
a singular problem with the file-upload!
regards,
Martin
On 3/18/08, Samba <sa...@gmail.com> wrote:
> Thanks for the advise...
> At least in my situation it did not break anything we currently have.
> And we do not use Tomahawk file upload, so I guess I can go with this
> approach, even though it may not be an ideal solution.
> I'll let you know if I observe any other tomahawk features failing because
> of this configuration.
>
> Samba
>
>
>
> On Mon, Mar 17, 2008 at 10:30 PM, Scott O'Bryan <da...@gmail.com> wrote:
>
> > Simon, you are exactly correct on your comments. Putting Trinidad's
> > filter first means that *IT* takes priority. This would certainly break
> > Tomahawk's file uploads and maybe even some other stuff. We definitely
> > need to handle this and although I wouldn't say it's necessary to unite
> > the file-upload "components" in all the various render kits, I'm
> > certainly advocating consistent Multi-part for handling so that all the
> > various components are compatible with one another.
> >
> > Samba: Looking at it again, the Trinidad filter does force execution of
> > the Configurators earlier in the request. So yes, switching the order
> > will work because the Trinidad bits will get processed first.
> >
> > Scott
> >
> > simon.kitching@chello.at wrote:
> > > I think it's important to track this, so I've created an issue
> > > (severity=minor):
> > > TOMAHAWK-1213
> > >
> > > Putting trinidad's filter first has probably now broken any tomahawk
> > > fileUpload components. If you don't have any in your app then that is
> > > not a problem of course, but it is something that the library does need
> > > to fix sometime, whether via Scott's "configurator" module or otherwise.
> > >
> > > Samba: code duplication is a problem everyone is aware of. But tomahawk
> > > and trinidad cannot just be merged together. Some people want one but
> > > not the other. And anyway, people also combine these projects with other
> > > component libs created outside apache so all the apache libs need to be
> > > compatible with others as best they can.
> > >
> > > Regards,
> > > Simon
> > >
> > > Samba schrieb:
> > >
> > >> hey,
> > >> It worked now...
> > >>
> > >> The trick is to put Tomahawk Extension Filter below Trinidad Filter....
> > >>
> > >> Thanks for your help..
> > >> Samba
> > >>
> > >> P.S.
> > >> One more thing.. Is ther any planned date for the release of the
> > >> Unified approach for file uploading in myfaces ?
> > >> Actually I feel a lot duplicate effort is being put on JSF ... it
> > >> would be better if , at least in MyFaces Project .... combine all the
> > >> work into one stream so that these kind of incompatibilites won't
> > >> arise, and also the users need not have to bother about configuring
> > >> different and diverse pieces .
> > >>
> > >>
> > >>
> > >>
> > >> On Mon, Mar 17, 2008 at 12:02 PM, Samba <saasira@gmail.com
> > >> <ma...@gmail.com>> wrote:
> > >>
> > >> Hey.. Scott, I did not notice..
> > >>
> > >> You are referring to *Tobago Filter ---* where as I am using
> > >> Tomahawk's extension Filter...
> > >>
> > >> I know that tobago filter is incompatible with trinidad....
> > >>
> > >> But is Tomahawk Filter also incompatibile with Trinidad?
> > >>
> > >> thanks once again,
> > >>
> > >> On Sat, Mar 15, 2008 at 12:43 AM, Scott O'Bryan
> > >> <darkarena@gmail.com <ma...@gmail.com>> wrote:
> > >>
> > >> Samba, this will not work because Tobago's filter is doing the
> > >> multi-part form handling. The two mechanisms are incompatible
> > >> with each other and will be until we have uniform handling of
> > >> the multi-part form request. (I know Matthias, yes the
> > >> configurator commons is comming... :) ).
> > >>
> > >> Adding the TrinidadFilter mapping BEFORE the Tobago Filter
> > >> will probably fix the issue.
> > >>
> > >> Scott
> > >>
> > >>
> > >> On Fri, Mar 14, 2008 at 5:37 AM, Samba <saasira@gmail.com
> > >> <ma...@gmail.com>> wrote:
> > >>
> > >> Hi! Mathew,
> > >>
> > >> Below I pasted the code of the method referrred;
> > >>
> > >> *
> > >>
> > >> public
> > >>
> > >> *String doUpload(){ *try* {
> > >>
> > >> BufferedInputStream bis =
> > >>
> > >> *new*
> > >>
> > BufferedInputStream(((UploadedFile)fileOne).getInputStream());
> > >>
> > >>
> > >> OutputStream os =
> > >>
> > >> *null*;
> > >>
> > >> System.
> > >>
> > >> /out/.println("ContentType :
> > >> "+fileOne.getContentType()+"$$$$$$$$$$" +
> > >> fileOne.getFilename() );
> > >>
> > >> os =
> > >>
> > >> *new*
> > >> FileOutputStream("C:\\temp\\"+fileOne.getFilename());
> > >> *int* element; *while*((element=bis.read())!=-1){
> > >>
> > >> os.write(element);
> > >>
> > >> }
> > >>
> > >> }
> > >>
> > >> *catch* (IOException e) { // *TODO* Auto-generated catch
> > >> block
> > >>
> > >> e.printStackTrace();
> > >>
> > >> }
> > >>
> > >> *return* *null*;
> > >>
> > >> }
> > >>
> > >>
> > >> It is working fine even if I have Tomahawk jars and
> > >> commons-fileupload jar in my lib, but the moment I add the
> > >> ExtenstionFilter configuration entries in the web.xml, it
> > >> is failing by throwing a NPE..
> > >>
> > >> hope this is not a bug and will get a solution to the
> > >> problem soon,
> > >> Samba
> > >> On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf
> > >> <matzew@apache.org <ma...@apache.org>> wrote:
> > >>
> > >> Hi,
> > >>
> > >> ....
> > >> >
> > >> >
> > >> > root cause java.lang.NullPointerException
> > >> >
> > >> demo.backing.FileUploadTest.doUpload(
> > FileUploadTest.java:84)
> > >> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > >> Method)
> > >> >
> > >> >
> > >> sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> > >> >
> > >> >
> > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> > >>
> > >> *snip*
> > >> can you provide the code of the doUpload() ?
> > >>
> > >> > Is there any known issues of incompatibility of
> > >> Trinidad FileUploader with
> > >> > Tomahawk Extension Filtter?
> > >>
> > >> not that I know...
> > >>
> > >> -Matthias
> > >>
> > >>
> > >
> > >
> >
> >
>
>
> --
> Regards...
> Samba.
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Samba <sa...@gmail.com>.
Thanks for the advise...
At least in my situation it did not break anything we currently have.
And we do not use Tomahawk file upload, so I guess I can go with this
approach, even though it may not be an ideal solution.
I'll let you know if I observe any other tomahawk features failing because
of this configuration.
Samba
On Mon, Mar 17, 2008 at 10:30 PM, Scott O'Bryan <da...@gmail.com> wrote:
> Simon, you are exactly correct on your comments. Putting Trinidad's
> filter first means that *IT* takes priority. This would certainly break
> Tomahawk's file uploads and maybe even some other stuff. We definitely
> need to handle this and although I wouldn't say it's necessary to unite
> the file-upload "components" in all the various render kits, I'm
> certainly advocating consistent Multi-part for handling so that all the
> various components are compatible with one another.
>
> Samba: Looking at it again, the Trinidad filter does force execution of
> the Configurators earlier in the request. So yes, switching the order
> will work because the Trinidad bits will get processed first.
>
> Scott
>
> simon.kitching@chello.at wrote:
> > I think it's important to track this, so I've created an issue
> > (severity=minor):
> > TOMAHAWK-1213
> >
> > Putting trinidad's filter first has probably now broken any tomahawk
> > fileUpload components. If you don't have any in your app then that is
> > not a problem of course, but it is something that the library does need
> > to fix sometime, whether via Scott's "configurator" module or otherwise.
> >
> > Samba: code duplication is a problem everyone is aware of. But tomahawk
> > and trinidad cannot just be merged together. Some people want one but
> > not the other. And anyway, people also combine these projects with other
> > component libs created outside apache so all the apache libs need to be
> > compatible with others as best they can.
> >
> > Regards,
> > Simon
> >
> > Samba schrieb:
> >
> >> hey,
> >> It worked now...
> >>
> >> The trick is to put Tomahawk Extension Filter below Trinidad Filter....
> >>
> >> Thanks for your help..
> >> Samba
> >>
> >> P.S.
> >> One more thing.. Is ther any planned date for the release of the
> >> Unified approach for file uploading in myfaces ?
> >> Actually I feel a lot duplicate effort is being put on JSF ... it
> >> would be better if , at least in MyFaces Project .... combine all the
> >> work into one stream so that these kind of incompatibilites won't
> >> arise, and also the users need not have to bother about configuring
> >> different and diverse pieces .
> >>
> >>
> >>
> >>
> >> On Mon, Mar 17, 2008 at 12:02 PM, Samba <saasira@gmail.com
> >> <ma...@gmail.com>> wrote:
> >>
> >> Hey.. Scott, I did not notice..
> >>
> >> You are referring to *Tobago Filter ---* where as I am using
> >> Tomahawk's extension Filter...
> >>
> >> I know that tobago filter is incompatible with trinidad....
> >>
> >> But is Tomahawk Filter also incompatibile with Trinidad?
> >>
> >> thanks once again,
> >>
> >> On Sat, Mar 15, 2008 at 12:43 AM, Scott O'Bryan
> >> <darkarena@gmail.com <ma...@gmail.com>> wrote:
> >>
> >> Samba, this will not work because Tobago's filter is doing the
> >> multi-part form handling. The two mechanisms are incompatible
> >> with each other and will be until we have uniform handling of
> >> the multi-part form request. (I know Matthias, yes the
> >> configurator commons is comming... :) ).
> >>
> >> Adding the TrinidadFilter mapping BEFORE the Tobago Filter
> >> will probably fix the issue.
> >>
> >> Scott
> >>
> >>
> >> On Fri, Mar 14, 2008 at 5:37 AM, Samba <saasira@gmail.com
> >> <ma...@gmail.com>> wrote:
> >>
> >> Hi! Mathew,
> >>
> >> Below I pasted the code of the method referrred;
> >>
> >> *
> >>
> >> public
> >>
> >> *String doUpload(){ *try* {
> >>
> >> BufferedInputStream bis =
> >>
> >> *new*
> >>
> BufferedInputStream(((UploadedFile)fileOne).getInputStream());
> >>
> >>
> >> OutputStream os =
> >>
> >> *null*;
> >>
> >> System.
> >>
> >> /out/.println("ContentType :
> >> "+fileOne.getContentType()+"$$$$$$$$$$" +
> >> fileOne.getFilename() );
> >>
> >> os =
> >>
> >> *new*
> >> FileOutputStream("C:\\temp\\"+fileOne.getFilename());
> >> *int* element; *while*((element=bis.read())!=-1){
> >>
> >> os.write(element);
> >>
> >> }
> >>
> >> }
> >>
> >> *catch* (IOException e) { // *TODO* Auto-generated catch
> >> block
> >>
> >> e.printStackTrace();
> >>
> >> }
> >>
> >> *return* *null*;
> >>
> >> }
> >>
> >>
> >> It is working fine even if I have Tomahawk jars and
> >> commons-fileupload jar in my lib, but the moment I add the
> >> ExtenstionFilter configuration entries in the web.xml, it
> >> is failing by throwing a NPE..
> >>
> >> hope this is not a bug and will get a solution to the
> >> problem soon,
> >> Samba
> >> On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf
> >> <matzew@apache.org <ma...@apache.org>> wrote:
> >>
> >> Hi,
> >>
> >> ....
> >> >
> >> >
> >> > root cause java.lang.NullPointerException
> >> >
> >> demo.backing.FileUploadTest.doUpload(
> FileUploadTest.java:84)
> >> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> Method)
> >> >
> >> >
> >> sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> >> >
> >> >
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> >>
> >> *snip*
> >> can you provide the code of the doUpload() ?
> >>
> >> > Is there any known issues of incompatibility of
> >> Trinidad FileUploader with
> >> > Tomahawk Extension Filtter?
> >>
> >> not that I know...
> >>
> >> -Matthias
> >>
> >>
> >
> >
>
>
--
Regards...
Samba.
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Scott O'Bryan <da...@gmail.com>.
Simon, you are exactly correct on your comments. Putting Trinidad's
filter first means that *IT* takes priority. This would certainly break
Tomahawk's file uploads and maybe even some other stuff. We definitely
need to handle this and although I wouldn't say it's necessary to unite
the file-upload "components" in all the various render kits, I'm
certainly advocating consistent Multi-part for handling so that all the
various components are compatible with one another.
Samba: Looking at it again, the Trinidad filter does force execution of
the Configurators earlier in the request. So yes, switching the order
will work because the Trinidad bits will get processed first.
Scott
simon.kitching@chello.at wrote:
> I think it's important to track this, so I've created an issue
> (severity=minor):
> TOMAHAWK-1213
>
> Putting trinidad's filter first has probably now broken any tomahawk
> fileUpload components. If you don't have any in your app then that is
> not a problem of course, but it is something that the library does need
> to fix sometime, whether via Scott's "configurator" module or otherwise.
>
> Samba: code duplication is a problem everyone is aware of. But tomahawk
> and trinidad cannot just be merged together. Some people want one but
> not the other. And anyway, people also combine these projects with other
> component libs created outside apache so all the apache libs need to be
> compatible with others as best they can.
>
> Regards,
> Simon
>
> Samba schrieb:
>
>> hey,
>> It worked now...
>>
>> The trick is to put Tomahawk Extension Filter below Trinidad Filter....
>>
>> Thanks for your help..
>> Samba
>>
>> P.S.
>> One more thing.. Is ther any planned date for the release of the
>> Unified approach for file uploading in myfaces ?
>> Actually I feel a lot duplicate effort is being put on JSF ... it
>> would be better if , at least in MyFaces Project .... combine all the
>> work into one stream so that these kind of incompatibilites won't
>> arise, and also the users need not have to bother about configuring
>> different and diverse pieces .
>>
>>
>>
>>
>> On Mon, Mar 17, 2008 at 12:02 PM, Samba <saasira@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>> Hey.. Scott, I did not notice..
>>
>> You are referring to *Tobago Filter ---* where as I am using
>> Tomahawk's extension Filter...
>>
>> I know that tobago filter is incompatible with trinidad....
>>
>> But is Tomahawk Filter also incompatibile with Trinidad?
>>
>> thanks once again,
>>
>> On Sat, Mar 15, 2008 at 12:43 AM, Scott O'Bryan
>> <darkarena@gmail.com <ma...@gmail.com>> wrote:
>>
>> Samba, this will not work because Tobago's filter is doing the
>> multi-part form handling. The two mechanisms are incompatible
>> with each other and will be until we have uniform handling of
>> the multi-part form request. (I know Matthias, yes the
>> configurator commons is comming... :) ).
>>
>> Adding the TrinidadFilter mapping BEFORE the Tobago Filter
>> will probably fix the issue.
>>
>> Scott
>>
>>
>> On Fri, Mar 14, 2008 at 5:37 AM, Samba <saasira@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>> Hi! Mathew,
>>
>> Below I pasted the code of the method referrred;
>>
>> *
>>
>> public
>>
>> *String doUpload(){ *try* {
>>
>> BufferedInputStream bis =
>>
>> *new*
>> BufferedInputStream(((UploadedFile)fileOne).getInputStream());
>>
>>
>> OutputStream os =
>>
>> *null*;
>>
>> System.
>>
>> /out/.println("ContentType :
>> "+fileOne.getContentType()+"$$$$$$$$$$" +
>> fileOne.getFilename() );
>>
>> os =
>>
>> *new*
>> FileOutputStream("C:\\temp\\"+fileOne.getFilename());
>> *int* element; *while*((element=bis.read())!=-1){
>>
>> os.write(element);
>>
>> }
>>
>> }
>>
>> *catch* (IOException e) { // *TODO* Auto-generated catch
>> block
>>
>> e.printStackTrace();
>>
>> }
>>
>> *return* *null*;
>>
>> }
>>
>>
>> It is working fine even if I have Tomahawk jars and
>> commons-fileupload jar in my lib, but the moment I add the
>> ExtenstionFilter configuration entries in the web.xml, it
>> is failing by throwing a NPE..
>>
>> hope this is not a bug and will get a solution to the
>> problem soon,
>> Samba
>> On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf
>> <matzew@apache.org <ma...@apache.org>> wrote:
>>
>> Hi,
>>
>> ....
>> >
>> >
>> > root cause java.lang.NullPointerException
>> >
>> demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
>> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> >
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>
>> *snip*
>> can you provide the code of the doUpload() ?
>>
>> > Is there any known issues of incompatibility of
>> Trinidad FileUploader with
>> > Tomahawk Extension Filtter?
>>
>> not that I know...
>>
>> -Matthias
>>
>>
>
>
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by "simon.kitching@chello.at" <si...@chello.at>.
I think it's important to track this, so I've created an issue
(severity=minor):
TOMAHAWK-1213
Putting trinidad's filter first has probably now broken any tomahawk
fileUpload components. If you don't have any in your app then that is
not a problem of course, but it is something that the library does need
to fix sometime, whether via Scott's "configurator" module or otherwise.
Samba: code duplication is a problem everyone is aware of. But tomahawk
and trinidad cannot just be merged together. Some people want one but
not the other. And anyway, people also combine these projects with other
component libs created outside apache so all the apache libs need to be
compatible with others as best they can.
Regards,
Simon
Samba schrieb:
> hey,
> It worked now...
>
> The trick is to put Tomahawk Extension Filter below Trinidad Filter....
>
> Thanks for your help..
> Samba
>
> P.S.
> One more thing.. Is ther any planned date for the release of the
> Unified approach for file uploading in myfaces ?
> Actually I feel a lot duplicate effort is being put on JSF ... it
> would be better if , at least in MyFaces Project .... combine all the
> work into one stream so that these kind of incompatibilites won't
> arise, and also the users need not have to bother about configuring
> different and diverse pieces .
>
>
>
>
> On Mon, Mar 17, 2008 at 12:02 PM, Samba <saasira@gmail.com
> <ma...@gmail.com>> wrote:
>
> Hey.. Scott, I did not notice..
>
> You are referring to *Tobago Filter ---* where as I am using
> Tomahawk's extension Filter...
>
> I know that tobago filter is incompatible with trinidad....
>
> But is Tomahawk Filter also incompatibile with Trinidad?
>
> thanks once again,
>
> On Sat, Mar 15, 2008 at 12:43 AM, Scott O'Bryan
> <darkarena@gmail.com <ma...@gmail.com>> wrote:
>
> Samba, this will not work because Tobago's filter is doing the
> multi-part form handling. The two mechanisms are incompatible
> with each other and will be until we have uniform handling of
> the multi-part form request. (I know Matthias, yes the
> configurator commons is comming... :) ).
>
> Adding the TrinidadFilter mapping BEFORE the Tobago Filter
> will probably fix the issue.
>
> Scott
>
>
> On Fri, Mar 14, 2008 at 5:37 AM, Samba <saasira@gmail.com
> <ma...@gmail.com>> wrote:
>
> Hi! Mathew,
>
> Below I pasted the code of the method referrred;
>
> *
>
> public
>
> *String doUpload(){ *try* {
>
> BufferedInputStream bis =
>
> *new*
> BufferedInputStream(((UploadedFile)fileOne).getInputStream());
>
>
> OutputStream os =
>
> *null*;
>
> System.
>
> /out/.println("ContentType :
> "+fileOne.getContentType()+"$$$$$$$$$$" +
> fileOne.getFilename() );
>
> os =
>
> *new*
> FileOutputStream("C:\\temp\\"+fileOne.getFilename());
> *int* element; *while*((element=bis.read())!=-1){
>
> os.write(element);
>
> }
>
> }
>
> *catch* (IOException e) { // *TODO* Auto-generated catch
> block
>
> e.printStackTrace();
>
> }
>
> *return* *null*;
>
> }
>
>
> It is working fine even if I have Tomahawk jars and
> commons-fileupload jar in my lib, but the moment I add the
> ExtenstionFilter configuration entries in the web.xml, it
> is failing by throwing a NPE..
>
> hope this is not a bug and will get a solution to the
> problem soon,
> Samba
> On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf
> <matzew@apache.org <ma...@apache.org>> wrote:
>
> Hi,
>
> ....
> >
> >
> > root cause java.lang.NullPointerException
> >
> demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> *snip*
> can you provide the code of the doUpload() ?
>
> > Is there any known issues of incompatibility of
> Trinidad FileUploader with
> > Tomahawk Extension Filtter?
>
> not that I know...
>
> -Matthias
>
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Samba <sa...@gmail.com>.
hey,
It worked now...
The trick is to put Tomahawk Extension Filter below Trinidad Filter....
Thanks for your help..
Samba
P.S.
One more thing.. Is ther any planned date for the release of the Unified
approach for file uploading in myfaces ?
Actually I feel a lot duplicate effort is being put on JSF ... it would be
better if , at least in MyFaces Project .... combine all the work into one
stream so that these kind of incompatibilites won't arise, and also the
users need not have to bother about configuring different and diverse
pieces .
On Mon, Mar 17, 2008 at 12:02 PM, Samba <sa...@gmail.com> wrote:
> Hey.. Scott, I did not notice..
>
> You are referring to *Tobago Filter ---* where as I am using Tomahawk's
> extension Filter...
>
> I know that tobago filter is incompatible with trinidad....
>
> But is Tomahawk Filter also incompatibile with Trinidad?
>
> thanks once again,
>
> On Sat, Mar 15, 2008 at 12:43 AM, Scott O'Bryan <da...@gmail.com>
> wrote:
>
> > Samba, this will not work because Tobago's filter is doing the
> > multi-part form handling. The two mechanisms are incompatible with each
> > other and will be until we have uniform handling of the multi-part form
> > request. (I know Matthias, yes the configurator commons is comming... :)
> > ).
> >
> > Adding the TrinidadFilter mapping BEFORE the Tobago Filter will probably
> > fix the issue.
> >
> > Scott
> >
> >
> > On Fri, Mar 14, 2008 at 5:37 AM, Samba <sa...@gmail.com> wrote:
> >
> > > Hi! Mathew,
> > >
> > > Below I pasted the code of the method referrred;
> > >
> > > *
> > >
> > > public
> > > *String doUpload(){
> > >
> > > *try* {
> > >
> > > BufferedInputStream bis =
> > > *new* BufferedInputStream(((UploadedFile)fileOne).getInputStream());
> > >
> > > OutputStream os =
> > > *null*;
> > >
> > > System.
> > > *out*.println("ContentType : "+fileOne.getContentType()+"$$$$$$$$$$" +
> > > fileOne.getFilename() );
> > >
> > > os =
> > > *new* FileOutputStream("C:\\temp\\"+fileOne.getFilename());
> > >
> > > *int* element;
> > >
> > > *while*((element=bis.read())!=-1){
> > >
> > > os.write(element);
> > >
> > > }
> > >
> > > }
> > > *catch* (IOException e) {
> > >
> > > // *TODO* Auto-generated catch block
> > >
> > > e.printStackTrace();
> > >
> > > }
> > >
> > > *return* *null*;
> > >
> > > }
> > >
> > > It is working fine even if I have Tomahawk jars and commons-fileupload
> > > jar in my lib, but the moment I add the ExtenstionFilter configuration
> > > entries in the web.xml, it is failing by throwing a NPE..
> > >
> > > hope this is not a bug and will get a solution to the problem soon,
> > > Samba
> > > On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf <
> > > matzew@apache.org> wrote:
> > >
> > > > Hi,
> > > >
> > > > ....
> > > > >
> > > > >
> > > > > root cause java.lang.NullPointerException
> > > > > demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> > > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >
> > > > > sun.reflect.NativeMethodAccessorImpl.invoke(
> > > > NativeMethodAccessorImpl.java:39)
> > > > >
> > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > > DelegatingMethodAccessorImpl.java:25)
> > > >
> > > > *snip*
> > > > can you provide the code of the doUpload() ?
> > > >
> > > > > Is there any known issues of incompatibility of Trinidad
> > > > FileUploader with
> > > > > Tomahawk Extension Filtter?
> > > >
> > > > not that I know...
> > > >
> > > > -Matthias
> > > >
> > > > > Thanking you in advance,
> > > > >
> > > > > --
> > > > > Regards...
> > > > > Samba.
> > > >
> > > >
> > > >
> > > > --
> > > > Matthias Wessendorf
> > > >
> > > > further stuff:
> > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > sessions: http://www.slideshare.net/mwessendorf
> > > > mail: matzew-at-apache-dot-org
> > > >
> > >
> > >
> > >
> > > --
> > > Regards...
> > > Samba.
> >
> >
> >
>
>
> --
> Regards...
> Samba.
--
Regards...
Samba.
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Samba <sa...@gmail.com>.
Hey.. Scott, I did not notice..
You are referring to *Tobago Filter ---* where as I am using Tomahawk's
extension Filter...
I know that tobago filter is incompatible with trinidad....
But is Tomahawk Filter also incompatibile with Trinidad?
thanks once again,
On Sat, Mar 15, 2008 at 12:43 AM, Scott O'Bryan <da...@gmail.com> wrote:
> Samba, this will not work because Tobago's filter is doing the multi-part
> form handling. The two mechanisms are incompatible with each other and will
> be until we have uniform handling of the multi-part form request. (I know
> Matthias, yes the configurator commons is comming... :) ).
>
> Adding the TrinidadFilter mapping BEFORE the Tobago Filter will probably
> fix the issue.
>
> Scott
>
>
> On Fri, Mar 14, 2008 at 5:37 AM, Samba <sa...@gmail.com> wrote:
>
> > Hi! Mathew,
> >
> > Below I pasted the code of the method referrred;
> >
> > *
> >
> > public
> > *String doUpload(){
> >
> > *try* {
> >
> > BufferedInputStream bis =
> > *new* BufferedInputStream(((UploadedFile)fileOne).getInputStream());
> >
> > OutputStream os =
> > *null*;
> >
> > System.
> > *out*.println("ContentType : "+fileOne.getContentType()+"$$$$$$$$$$" +
> > fileOne.getFilename() );
> >
> > os =
> > *new* FileOutputStream("C:\\temp\\"+fileOne.getFilename());
> >
> > *int* element;
> >
> > *while*((element=bis.read())!=-1){
> >
> > os.write(element);
> >
> > }
> >
> > }
> > *catch* (IOException e) {
> >
> > // *TODO* Auto-generated catch block
> >
> > e.printStackTrace();
> >
> > }
> >
> > *return* *null*;
> >
> > }
> >
> > It is working fine even if I have Tomahawk jars and commons-fileupload
> > jar in my lib, but the moment I add the ExtenstionFilter configuration
> > entries in the web.xml, it is failing by throwing a NPE..
> >
> > hope this is not a bug and will get a solution to the problem soon,
> > Samba
> > On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf <
> > matzew@apache.org> wrote:
> >
> > > Hi,
> > >
> > > ....
> > > >
> > > >
> > > > root cause java.lang.NullPointerException
> > > > demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(
> > > NativeMethodAccessorImpl.java:39)
> > > >
> > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > DelegatingMethodAccessorImpl.java:25)
> > >
> > > *snip*
> > > can you provide the code of the doUpload() ?
> > >
> > > > Is there any known issues of incompatibility of Trinidad
> > > FileUploader with
> > > > Tomahawk Extension Filtter?
> > >
> > > not that I know...
> > >
> > > -Matthias
> > >
> > > > Thanking you in advance,
> > > >
> > > > --
> > > > Regards...
> > > > Samba.
> > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > sessions: http://www.slideshare.net/mwessendorf
> > > mail: matzew-at-apache-dot-org
> > >
> >
> >
> >
> > --
> > Regards...
> > Samba.
>
>
>
--
Regards...
Samba.
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Scott O'Bryan <da...@gmail.com>.
Samba, this will not work because Tobago's filter is doing the multi-part
form handling. The two mechanisms are incompatible with each other and will
be until we have uniform handling of the multi-part form request. (I know
Matthias, yes the configurator commons is comming... :) ).
Adding the TrinidadFilter mapping BEFORE the Tobago Filter will probably fix
the issue.
Scott
On Fri, Mar 14, 2008 at 5:37 AM, Samba <sa...@gmail.com> wrote:
> Hi! Mathew,
>
> Below I pasted the code of the method referrred;
>
> *
>
> public
> * String doUpload(){
>
> *try* {
>
> BufferedInputStream bis =
> *new* BufferedInputStream(((UploadedFile)fileOne).getInputStream());
>
> OutputStream os =
> *null*;
>
> System.
> *out*.println("ContentType : "+fileOne.getContentType()+"$$$$$$$$$$" +
> fileOne.getFilename() );
>
> os =
> *new* FileOutputStream("C:\\temp\\"+fileOne.getFilename());
>
> *int* element;
>
> *while*((element=bis.read())!=-1){
>
> os.write(element);
>
> }
>
> }
> *catch* (IOException e) {
>
> // *TODO* Auto-generated catch block
>
> e.printStackTrace();
>
> }
>
> *return* *null*;
>
> }
>
> It is working fine even if I have Tomahawk jars and commons-fileupload jar
> in my lib, but the moment I add the ExtenstionFilter configuration entries
> in the web.xml, it is failing by throwing a NPE..
>
> hope this is not a bug and will get a solution to the problem soon,
> Samba
> On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf <ma...@apache.org>
> wrote:
>
> > Hi,
> >
> > ....
> > >
> > >
> > > root cause java.lang.NullPointerException
> > > demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >
> > > sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> > >
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> >
> > *snip*
> > can you provide the code of the doUpload() ?
> >
> > > Is there any known issues of incompatibility of Trinidad FileUploader
> > with
> > > Tomahawk Extension Filtter?
> >
> > not that I know...
> >
> > -Matthias
> >
> > > Thanking you in advance,
> > >
> > > --
> > > Regards...
> > > Samba.
> >
> >
> >
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://matthiaswessendorf.wordpress.com/
> > sessions: http://www.slideshare.net/mwessendorf
> > mail: matzew-at-apache-dot-org
> >
>
>
>
> --
> Regards...
> Samba.
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Samba <sa...@gmail.com>.
Hi! Mathew,
Below I pasted the code of the method referrred;
*
public* String doUpload(){
*try* {
BufferedInputStream bis = *new* BufferedInputStream(((UploadedFile)fileOne
).getInputStream());
OutputStream os =*null*;
System.*out*.println("ContentType : "+fileOne.getContentType()+"$$$$$$$$$$"+
fileOne.getFilename() );
os = *new* FileOutputStream("C:\\temp\\"+fileOne.getFilename());
*int* element;
*while*((element=bis.read())!=-1){
os.write(element);
}
} *catch* (IOException e) {
// *TODO* Auto-generated catch block
e.printStackTrace();
}
*return* *null*;
}
It is working fine even if I have Tomahawk jars and commons-fileupload jar
in my lib, but the moment I add the ExtenstionFilter configuration entries
in the web.xml, it is failing by throwing a NPE..
hope this is not a bug and will get a solution to the problem soon,
Samba
On Fri, Mar 14, 2008 at 4:35 PM, Matthias Wessendorf <ma...@apache.org>
wrote:
> Hi,
>
> ....
> >
> >
> > root cause java.lang.NullPointerException
> > demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >
> > sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> >
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>
> *snip*
> can you provide the code of the doUpload() ?
>
> > Is there any known issues of incompatibility of Trinidad FileUploader
> with
> > Tomahawk Extension Filtter?
>
> not that I know...
>
> -Matthias
>
> > Thanking you in advance,
> >
> > --
> > Regards...
> > Samba.
>
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> mail: matzew-at-apache-dot-org
>
--
Regards...
Samba.
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Matthias Wessendorf <ma...@apache.org>.
Hi,
....
>
>
> root cause java.lang.NullPointerException
> demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
*snip*
can you provide the code of the doUpload() ?
> Is there any known issues of incompatibility of Trinidad FileUploader with
> Tomahawk Extension Filtter?
not that I know...
-Matthias
> Thanking you in advance,
>
> --
> Regards...
> Samba.
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
Posted by Samba <sa...@gmail.com>.
Just to add a few more details :
I'm using SUN RI JSF 1.2
Trinidad 1.2.7-snapshot
Tomahawk1.1.7-snapshot
and
Facelets 1.1.4
On Fri, Mar 14, 2008 at 12:25 PM, Samba <sa...@gmail.com> wrote:
> Hi!
> I'm using both Trinidad and Tomahawk components together in the same page.
>
> I wanted to use Trinidad InputFileUpload component for uploading files..
> But I'm getting null pointer exception
>
> Stack Trace is given below:
>
>
> javax.servlet.ServletException: #{fileUploadTest.doUpload}: /home.xhtml @27,74 action="#{fileUploadTest.doUpload}": java.lang.NullPointerException
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>
> *root cause*
>
> javax.faces.FacesException: #{fileUploadTest.doUpload}: /home.xhtml @27,74 action="#{fileUploadTest.doUpload}": java.lang.NullPointerException
> com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
> org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>
> *root cause*
>
> javax.faces.el.EvaluationException: /home.xhtml @27,74 action="#{fileUploadTest.doUpload}": java.lang.NullPointerException
> org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
> com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
> org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>
> *root cause*
>
> java.lang.NullPointerException
> demo.backing.FileUploadTest.doUpload(FileUploadTest.java:84)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:585)
> com.sun.el.parser.AstValue.invoke(AstValue.java:151)
> com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
> com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
> org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
> com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
> org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>
>
> Is there any known issues of incompatibility of Trinidad FileUploader with
> Tomahawk Extension Filtter?
> Thanking you in advance,
>
> --
> Regards...
> Samba.
>
>
--
Regards...
Samba.