Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Struts File Upload Error - erroneous handlers

Thread view: 
watergirl - 09 Oct 2006 20:20 GMT
Hello.

I'm trying to do a very simple upload using velocity and struts. This
is my html:

<html>
<body>
<form name="myForm" method="post" action="<my action goes here>"
enctype="multipart/form-data">
        Select File: <input type="file" name="myFile"> </br>
        <input type="submit" value="Upload File">
  </form>
</body>
</html>

For some reason I'm getting this error...

java.lang.InternalError: erroneous handlers
    at
org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(Ljavax/servlet/http/HttpServletRequest;)V(CommonsMultipartRequestHandler.java:???)
    at
org.apache.struts.util.RequestUtils.populate(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;Ljavax/servlet/http/HttpServletRequest;)V(RequestUtils.java:445)

Does anyone have any clue what this could be about? Also - my
struts-config file:

      <form-bean
           dynamic="true"
           name="myForm"
           type="org.apache.struts.action.DynaActionForm">
           <!-- inputs -->
           <form-property name="myFile"
type="org.apache.struts.upload.FormFile"/>
       </form-bean>
I was creating my own action form but currently just trying to keep it
basic.

                 <action
        path="/FileUpload"
        name="myForm"
        type="my.package.StrutsUploadAction">
        <forward name="success" path="/success.vm"/>
    </action>

Any ideas would be greatly appreciated.

Thank you!
Manish Pandit - 09 Oct 2006 21:48 GMT
Try replacing

>          Select File: <input type="file" name="myFile"> </br>

with Select File : <html:file property="myFile"/></br>

If this does not work, try getting rid of the dyna form altogether, and
parse the multipart request in your action. I am not sure what type
<input type=file> puts in the request, but your action is expecting a
FormFile, which can be the error you are observing.

-cheers,
Manish
watergirl - 10 Oct 2006 15:24 GMT
> Try replacing
>
[quoted text clipped - 9 lines]
> -cheers,
> Manish

Manish.

Thank you for the suggestion. I tried removing the dyna form and
parsing via the multi part request object and got the same
error...Still at a loss!

Thanks.
Steph
Manish Pandit - 10 Oct 2006 16:57 GMT
Hi!

Can you check and see if the jakarta fileupload library version is same
on your tomcat vs. your IDE/build location? If there is a fileupload
jar in tomcat, get rid of it so that it will always pick up the one in
your WEB-INF/lib.

-cheers,
Manish
watergirl - 10 Oct 2006 21:38 GMT
Thanks Manish! I removed old jars and made sure the only ones that I
wanted to use were in my WEB-INF/lib and it works great :)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.