strruts file upload problem(illegal argument exception)

G

giggi

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(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(Property
Utils.java:1789)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(Property
Utils.java:1684)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.
java:1713)
at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:101
9)
at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
essor.java:821)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:254)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
2)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.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$ServletInvocationAction.run
(ServletStubImpl.java:971)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6350)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3635)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2585)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Any help would be greately appreciated.

thanks
 
A

Aidan

giggi said:
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(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(Property
Utils.java:1789)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(Property
Utils.java:1684)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.
java:1713)
at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:101
9)
at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
essor.java:821)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:254)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
2)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.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$ServletInvocationAction.run
(ServletStubImpl.java:971)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6350)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3635)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2585)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java: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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top