Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > strruts file upload problem(illegal argument exception)

Reply
Thread Tools

strruts file upload problem(illegal argument exception)

 
 
giggi
Guest
Posts: n/a
 
      06-06-2004
Hi,
I am trying to do file upload using struts1.1. I am getting
illegal argument type exception(stack trace attached below). I am struggling
to fix this since three days. I would really appreciate any kind of
help.

I am using web logic 8.1, eclipse and java for my development.
I created a form with property type FormFile.
jsp with input field <html:file property="theFile"/>

and a submit button<html:submit/>. In action class I am just getting
the file with form.getTheFile() method. but the problem is that when I
hit submit button I am getting the following exception:
<Error> <HTTP> <BEA-101017> <[ServletContext(id=314
99063,name=cms-int-20040605,context-path=/cms-int-20040605)] Root cause
of Servl
etException.
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.setSimp leProperty(Property
Utils.java:1789)
at
org.apache.commons.beanutils.PropertyUtils.setNest edProperty(Property
Utils.java:1684)
at
org.apache.commons.beanutils.PropertyUtils.setProp erty(PropertyUtils.
java:1713)
at
org.apache.commons.beanutils.BeanUtils.setProperty (BeanUtils.java:101
9)
at
org.apache.commons.beanutils.BeanUtils.populate(Be anUtils.java:80
at
org.apache.struts.util.RequestUtils.populate(Reque stUtils.java:1252)
at
org.apache.struts.action.RequestProcessor.processP opulate(RequestProc
essor.java:821)
at
org.apache.struts.action.RequestProcessor.process( RequestProcessor.ja
va:254)
at
org.apache.struts.action.ActionServlet.process(Act ionServlet.java:148
2)
at
org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run
(ServletStubImpl.java:971)
at
weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
pl.java:402)
at
weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
pl.java:305)
at
weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationActio
n.run(WebAppServletContext.java:6350)
at
weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(Authenticate
dSubject.java:317)
at
weblogic.security.service.SecurityManager.runAs(Se curityManager.java:
11
at
weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppSe
rvletContext.java:3635)
at
weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestIm
pl.java:2585)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
>


Any help would be greately appreciated.

thanks
 
Reply With Quote
 
 
 
 
Aidan
Guest
Posts: n/a
 
      06-08-2004
giggi wrote:
> Hi,
> I am trying to do file upload using struts1.1. I am getting
> illegal argument type exception(stack trace attached below). I am struggling
> to fix this since three days. I would really appreciate any kind of
> help.
>
> I am using web logic 8.1, eclipse and java for my development.
> I created a form with property type FormFile.
> jsp with input field <html:file property="theFile"/>
>
> and a submit button<html:submit/>. In action class I am just getting
> the file with form.getTheFile() method. but the problem is that when I
> hit submit button I am getting the following exception:
> <Error> <HTTP> <BEA-101017> <[ServletContext(id=314
> 99063,name=cms-int-20040605,context-path=/cms-int-20040605)] Root cause
> of Servl
> etException.
> java.lang.IllegalArgumentException: argument type mismatch
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.apache.commons.beanutils.PropertyUtils.setSimp leProperty(Property
> Utils.java:1789)
> at
> org.apache.commons.beanutils.PropertyUtils.setNest edProperty(Property
> Utils.java:1684)
> at
> org.apache.commons.beanutils.PropertyUtils.setProp erty(PropertyUtils.
> java:1713)
> at
> org.apache.commons.beanutils.BeanUtils.setProperty (BeanUtils.java:101
> 9)
> at
> org.apache.commons.beanutils.BeanUtils.populate(Be anUtils.java:80
> at
> org.apache.struts.util.RequestUtils.populate(Reque stUtils.java:1252)
> at
> org.apache.struts.action.RequestProcessor.processP opulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process( RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(Act ionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:525)
> at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run
> (ServletStubImpl.java:971)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
> pl.java:402)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationActio
> n.run(WebAppServletContext.java:6350)
> at
> weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(Se curityManager.java:
> 11
> at
> weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppSe
> rvletContext.java:3635)
> at
> weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestIm
> pl.java:2585)
> at
> weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
>
>
> Any help would be greately appreciated.
>
> thanks


You wouldn't happen to be using Opera as your browser? I recall having
issues with it and file uploads with Struts. It looked similar to what
you're describing.

Aidan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File upload from client application (non-form based upload) stuart@microsoft.com Python 1 11-25-2006 12:14 AM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
How to detect sizeof upload in order to show status of browser file upload? Heather Fraser Java 0 07-05-2004 12:35 AM
defaulting argument to previous argument Bhushit Joshipura C++ 5 12-30-2003 03:21 PM
Upload Excel with Macros using HTML File Upload Prakash ASP General 3 11-12-2003 04:26 AM



Advertisments