struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Janes" <...@se.bluewave.com>
Subject RE: BUG!!! FormFile
Date Fri, 19 Dec 2003 06:49:00 GMT

Hi Dan,

The bug itself is in PropertyUtils.java, which is in the Commons-BeanUtils jar,, the workaround
is
very simple..  (lines in bold are the ones I added)


    public static void setSimpleProperty(Object bean,
                                         String name, Object value)
[Some other coder here]
        Class [] cls=writeMethod.getParameterTypes();
        // Call the property setter method
        values[0] = value;
        if (cls[0]==org.apache.struts.upload.FormFile.class &&
value.getClass()==java.lang.String.class) {
            System.out.println("Not setting");
        } else {
            writeMethod.invoke(bean, values);
        }
}

The source of the problem is tricky, it may be in the way thay Opera, if not File is selected
sends
a String.... not an Empty 'File' I don't know.

However the bug is thrown from the writeMethod line above... So I get round it as seen...
(Not neat
but it works - no time to do it nicely)

My code is here: Is a basic details updating form, however as you can see the user can upload
a
FormFile, property photo. To geth the Class Photograph version, they need to call getPhotograph,
which will if photo has arrived etc... create a thumbnail of the image and then return the
Photogrpah instance p.

Hope this helps

Ben

Action Form:
/*
 * ChangeContactForm.java
 *
 * Created on 15 December 2003, 08:47
 */

package com.meganexus.networking.struts.form;
import com.meganexus.networking.info.*;
import org.apache.struts.upload.FormFile;
import java.awt.Image;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.*;
import java.io.FileOutputStream;
import javax.swing.ImageIcon;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.*;
import com.nniol.util.GifDecoder;
/** The ActionForm behind changeConatct, this one is done like this as it now accounts for
file
upload
 *
 * @author  Ben Janes (janes@glocalnet.net)
 * Copyright (c) 2003 Meganexus.com
 */
public class ChangeContactForm extends org.apache.struts.action.ActionForm {


    /** Holds value of property fname. */
    private String fname;

    /** Holds value of property lname. */
    private String lname;

    /** Holds value of property mnames. */
    private String mnames;

    /** Holds value of property dob. */
    private String dob;

    /** Holds value of property title. */
    private Short title;

    /** Holds value of property maritalstatus. */
    private Byte maritalstatus;

    /** Holds value of property addrHNum. */
    private String addrHNum;

    /** Holds value of property addrStreet. */
    private String addrStreet;

    /** Holds value of property addrTown. */
    private String addrTown;

    /** Holds value of property addrCounty. */
    private String addrCounty;

    /** Holds value of property addrPCode. */
    private String addrPCode;

    /** Holds value of property addrCountryId. */
    private Integer addrCountryId;

    /** Holds value of property phone. */
    private String phone;

    /** Holds value of property fax. */
    private String fax;

    /** Holds value of property email. */
    private String email;

    /** Holds value of property notes. */
    private String notes;

    /** Holds value of property formFile. */
    private FormFile photo=null;

    /** Holds value of property mobile. */
    private String mobile;

    private Photo p=null;

    /** Holds value of property removePic. */
    private boolean removePic=false;

    /** Getter for property fname.
     * @return Value of property fname.
     *
     */
    public String getFname() {
        return this.fname;
    }

    /** Setter for property fname.
     * @param fname New value of property fname.
     *
     */
    public void setFname(String fname) {
        this.fname = fname;
    }

    /** Getter for property lname.
     * @return Value of property lname.
     *
     */
    public String getLname() {
        return this.lname;
    }

    /** Setter for property lname.
     * @param lname New value of property lname.
     *
     */
    public void setLname(String lname) {
        this.lname = lname;
    }

    /** Getter for property mnames.
     * @return Value of property mnames.
     *
     */
    public String getMnames() {
        return this.mnames;
    }

    /** Setter for property mnames.
     * @param mnames New value of property mnames.
     *
     */
    public void setMnames(String mnames) {
        this.mnames = mnames;
    }

    /** Getter for property dob.
     * @return Value of property dob.
     *
     */
    public String getDob() {
        return this.dob;
    }

    /** Setter for property dob.
     * @param dob New value of property dob.
     *
     */
    public void setDob(String dob) {
        this.dob = dob;
    }

    /** Getter for property title.
     * @return Value of property title.
     *
     */
    public Short getTitle() {
        return this.title;
    }

    /** Setter for property title.
     * @param title New value of property title.
     *
     */
    public void setTitle(Short title) {
        this.title = title;
    }

    /** Getter for property maritalstatus.
     * @return Value of property maritalstatus.
     *
     */
    public Byte getMaritalstatus() {
        return this.maritalstatus;
    }

    /** Setter for property maritalstatus.
     * @param maritalstatus New value of property maritalstatus.
     *
     */
    public void setMaritalstatus(Byte maritalstatus) {
        this.maritalstatus = maritalstatus;
    }

    /** Getter for property addrHNum.
     * @return Value of property addrHNum.
     *
     */
    public String getAddrHNum() {
        return this.addrHNum;
    }

    /** Setter for property addrHNum.
     * @param addrHNum New value of property addrHNum.
     *
     */
    public void setAddrHNum(String addrHNum) {
        this.addrHNum = addrHNum;
    }

    /** Getter for property addrStreet.
     * @return Value of property addrStreet.
     *
     */
    public String getAddrStreet() {
        return this.addrStreet;
    }

    /** Setter for property addrStreet.
     * @param addrStreet New value of property addrStreet.
     *
     */
    public void setAddrStreet(String addrStreet) {
        this.addrStreet = addrStreet;
    }

    /** Getter for property addrTown.
     * @return Value of property addrTown.
     *
     */
    public String getAddrTown() {
        return this.addrTown;
    }

    /** Setter for property addrTown.
     * @param addrTown New value of property addrTown.
     *
     */
    public void setAddrTown(String addrTown) {
        this.addrTown = addrTown;
    }

    /** Getter for property addrCounty.
     * @return Value of property addrCounty.
     *
     */
    public String getAddrCounty() {
        return this.addrCounty;
    }

    /** Setter for property addrCounty.
     * @param addrCounty New value of property addrCounty.
     *
     */
    public void setAddrCounty(String addrCounty) {
        this.addrCounty = addrCounty;
    }

    /** Getter for property addrPCode.
     * @return Value of property addrPCode.
     *
     */
    public String getAddrPCode() {
        return this.addrPCode;
    }

    /** Setter for property addrPCode.
     * @param addrPCode New value of property addrPCode.
     *
     */
    public void setAddrPCode(String addrPCode) {
        this.addrPCode = addrPCode;
    }

    /** Getter for property addrCountryId.
     * @return Value of property addrCountryId.
     *
     */
    public Integer getAddrCountryId() {
        return this.addrCountryId;
    }

    /** Setter for property addrCountryId.
     * @param addrCountryId New value of property addrCountryId.
     *
     */
    public void setAddrCountryId(Integer addrCountryId) {
        this.addrCountryId = addrCountryId;
    }

    /** Getter for property phone.
     * @return Value of property phone.
     *
     */
    public String getPhone() {
        return this.phone;
    }

    /** Setter for property phone.
     * @param phone New value of property phone.
     *
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /** Getter for property fax.
     * @return Value of property fax.
     *
     */
    public String getFax() {
        return this.fax;
    }

    /** Setter for property fax.
     * @param fax New value of property fax.
     *
     */
    public void setFax(String fax) {
        this.fax = fax;
    }

    /** Getter for property email.
     * @return Value of property email.
     *
     */
    public String getEmail() {
        return this.email;
    }

    /** Setter for property email.
     * @param email New value of property email.
     *
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /** Getter for property notes.
     * @return Value of property notes.
     *
     */
    public String getNotes() {
        return this.notes;
    }

    /** Setter for property notes.
     * @param notes New value of property notes.
     *
     */
    public void setNotes(String notes) {
        this.notes = notes;
    }

    /** Getter for property photo.
     * @return Value of property photo.
     *
     */
    public FormFile getPhoto() {
        return this.photo;
    }

    public Photo getPhotograph() {
        if (this.photo!=null && p==null) {
            p=new Photo();
            generateThumbnail(p);
        }
        return p;
    }


    /** Setter for property photo.
     * @param formFile New value of property photo.
     *
     */
    public void setPhoto(FormFile photo) {
        this.photo=photo;
    }

    /** Getter for property mobile.
     * @return Value of property mobile.
     *
     */
    public String getMobile() {
        return this.mobile;
    }

    /** Setter for property mobile.
     * @param mobile New value of property mobile.
     *
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }


    private void generateThumbnail(Photo p) {
        try {
            double maxDimH=150.0;
            double maxDimW=100.0;
            BufferedImage inImage=null;
            p.setPhoto(photo.getFileData());
            if (photo.getContentType().compareToIgnoreCase("image/jpeg")==0 ||
photo.getContentType().compareToIgnoreCase("image/pjpeg")==0 ||
photo.getContentType().compareToIgnoreCase("image/jpg")==0) {
                JPEGImageDecoder decoder=JPEGCodec.createJPEGDecoder(photo.getInputStream());
                inImage=decoder.decodeAsBufferedImage();
            } else if (photo.getContentType().compareToIgnoreCase("image/gif")==0 ) {
                GifDecoder decoder=new GifDecoder();
                decoder.read(photo.getInputStream());
                inImage=decoder.getImage();
            }
//            Image inImage=new ImageIcon(p.getPhoto()).getImage();
            p.setHeight(inImage.getHeight(null));
            p.setWidth(inImage.getWidth(null));
            p.setType(photo.getContentType());
            p.setFilename(photo.getFileName());
            double scaleH = (double)maxDimH/(double)inImage.getHeight(null);
            double scaleW = (double)maxDimW/(double)inImage.getWidth(null);
            // Determine size of new image.
            //One of them
            // should equal maxDim.
            int scaledW = (int)(scaleW*inImage.getWidth(null));
            int scaledH = (int)(scaleH*inImage.getHeight(null));
            // Create an image buffer in
            //which to paint on.
            BufferedImage outImage = new BufferedImage(scaledW, scaledH,
BufferedImage.TYPE_INT_RGB);
            // Set the scale.
            AffineTransform tx = new AffineTransform();
            // If the image is smaller than
            //the desired image size,
            // don't bother scaling.
            if (scaleW < 1.0d || scaleH<1.0d) {
                tx.scale(scaleW, scaleH);
            }
            // Paint image.
            Graphics2D g2d = outImage.createGraphics();
            g2d.drawImage(inImage, tx, null);
            // JPEG-encode the image
            //and write to file.
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder((OutputStream)baos );
            encoder.encode(outImage);
            p.setThumbnail(baos.toByteArray());
            baos.close();
            g2d.dispose();
        } catch (FileNotFoundException e) {
            com.nniol.handlers.ErrorReporter er=new com.nniol.handlers.ErrorReporter(e);
            com.nniol.handlers.MailHandler.sendMail("error",er);
        } catch (IOException e) {
            com.nniol.handlers.ErrorReporter er=new com.nniol.handlers.ErrorReporter(e);
            com.nniol.handlers.MailHandler.sendMail("error",er);
        } catch (Exception e) {
            com.nniol.handlers.ErrorReporter er=new com.nniol.handlers.ErrorReporter(e);
            com.nniol.handlers.MailHandler.sendMail("error",er);
        }
    }

    /** Getter for property removePic.
     * @return Value of property removePic.
     *
     */
    public boolean getRemovePic() {
        return this.removePic;
    }

    /** Setter for property removePic.
     * @param removePic New value of property removePic.
     *
     */
    public void setRemovePic(boolean removePic) {
        this.removePic = removePic;
    }

}

_______________________________
The JSP
_______________________________
<%@ page    language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib  uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/meganexus.tld" prefix="mg" %>
<%@include file="sessionManager.jsp" %>
<%
    Integer curUserID=mSes.getUserId(session.getId());
    // Get Node for User
    com.meganexus.networking.map.GraphNodeContainer
gnc=com.meganexus.networking.map.GraphBuilder.getNode(curUserID.intValue());
    if (gnc.isGraphBeingRebuilt()) {
        mSes.addMessage(session.getId(),"messages.graphbeingrebuilt");
    }
    com.meganexus.networking.info.Person curUser=gnc.getNode().getPerson();

%>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html:html locale="true">
<%@include file="head.jsp" %>
<body>
    <table cellpadding="0" cellspacing="5" border="1">
        <tr>
            <td valign="top">
                <%@include file="optionsMenu.jsp" %>
            </td>
            <td valign="top">
                <%@include file="aMessage.jsp" %>
                <!-- Output information goes here -->
                <div class="clsFormContainer">
                <html:form method="POST" enctype="multipart/form-data" action="/changeContact"
focus="fname" onsubmit="return validateChangeContactForm(this);">
                    <fieldset class="clsDialogGroup">
                    <legend><bean:message key="legend.changecontact" /></legend>
                    <table cellpadding="0" cellspacing="5" >
                        <tr>
                            <td class="clsFormDataError" colspan="2">
                                <html:errors/>
                            </td>
                        </tr>
                        <tr>
                            <th class="clsFormData" colspan="6"><bean:message
key="prompt.personaldetails" /></th>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.firstname"/></td>
                            <td class="clsFormData"><html:text property="fname" size="25"
maxlength="50" value="<%= curUser.getFname() %>" /></td>
                            <td class="clsFormData" rowspan="17">
                                <mg:showThumbnail personId="<%= Integer.toString(curUser.getId())
%>" showRemoveBox="true" removeMsgKey="prompt.removephoto" property="removePic"  /><br
/>

                            </td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.lastname"/></td>
                            <td class="clsFormData"><html:text property="lname" size="25"
maxlength="50" value="<%= curUser.getLname() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.middlenames"/></td>
                            <td class="clsFormData"><html:text property="mnames"
size="25"
maxlength="100" value="<%= curUser.getMnames() %>" /></td>
                        </tr>

                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.DoB"/></td>
                            <td class="clsFormData">
                                <html:text property="dob" size="25" maxlength="30" value="<%=
curUser.getDoBFormatted() %>" /> <bean:message key="prompt.DoB.format"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.title"/></td>
                            <td class="clsFormData">
                                <html:select property="title" value="<%=
Short.toString(curUser.getTitleId()) %>">
                                    <html:optionsCollection name="sessionTitleList"  value="id"
label="title" />
                                </html:select>
                            </td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.maritalstatus"/></td>
                            <td class="clsFormData">
                                <html:select property="maritalstatus" value="<%=
Byte.toString(curUser.getMaritalStatusId()) %>" >
                                    <bean:define id="tdeMStatusList" name="sessionMStatusList"
type="com.meganexus.networking.info.MaritalStatusList"  />
                                    <html:optionsCollection name="tdeMStatusList" value="id"
label="status" />
                                </html:select>
                            </td>
                        </tr>

                        <tr>
                            <th class="clsFormData" colspan="2"><bean:message
key="prompt.contactDetails" /></th>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.addrHNum"/></td>
                            <td class="clsFormData"><html:text property="addrHNum"
size="25"
maxlength="150" value="<%= curUser.getAddrHNum() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.addrStreet"/></td>
                            <td class="clsFormData"><html:text property="addrStreet"
size="25"
maxlength="150" value="<%= curUser.getAddrStreet() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.addrTown"/></td>
                            <td class="clsFormData"><html:text property="addrTown"
size="25"
maxlength="150" value="<%= curUser.getAddrTown() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.addrCounty"/></td>
                            <td class="clsFormData"><html:text property="addrCounty"
size="25"
maxlength="150" value="<%= curUser.getAddrCounty() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.addrPCode"/></td>
                            <td class="clsFormData"><html:text property="addrPCode"
size="25"
maxlength="150" value="<%= curUser.getAddrPCode() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.addrCountry"/></td>
                            <td class="clsFormData">
                                <html:select property="addrCountryId" value="<%=
Integer.toString(curUser.getAddrCountryId()) %>" >
                                    <html:optionsCollection name="sessionCountryList" 
value="id"
label="country" />
                                </html:select>
                            </td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.phone"/></td>
                            <td class="clsFormData"><html:text property="phone" size="25"
maxlength="150" value="<%= curUser.getPhone() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.mobile"/></td>
                            <td class="clsFormData"><html:text property="mobile"
size="25"
maxlength="150" value="<%= curUser.getMobile() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.fax"/></td>
                            <td class="clsFormData"><html:text property="fax" size="25"
maxlength="150" value="<%= curUser.getFax() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.email"/></td>
                            <td class="clsFormData"><html:text property="email" size="25"
maxlength="150" value="<%= curUser.getEmail() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.notes"/></td>
                            <td class="clsFormData" colspan="2"><html:textarea property="notes"
rows="5" cols="60" value="<%= curUser.getNotes() %>" /></td>
                        </tr>
                        <tr>
                            <td class="clsFormData"><bean:message key="prompt.photo"/></td>
                            <td class="clsFormData"><html:file property="photo"
accept="image/jpeg,image/gif"/></td>
                        </tr>
                        <tr>
                            <th class="clsFormData" colspan="2">
                                <html:submit>
                                    <bean:message key="button.submit"/>
                                </html:submit>
                &#160;&#160;&#160;
                                <html:reset>
                                    <bean:message key="button.reset"/>
                                </html:reset>
                            </th>
                        </tr>
                    </table>
                </html:form>
                <html:javascript formName="changeContactForm"
                        dynamicJavascript="true"
                         staticJavascript="false"/>
                <script language="Javascript1.1" src="staticJavascript.jsp"></script>

                </div>
            </td>
        </tr>
    </table>
</body>
</html:html>



Benjamin A. Janes
------------------------------------
BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden


|---------+------------------------------->
|         |           Dan Payne           |
|         |           <stairwaymail-struts|
|         |           @yahoo.com>         |
|         |                               |
|         |           2003-12-18 16:28    |
|         |           Please respond to   |
|         |           "Struts Users       |
|         |           Mailing List"       |
|         |                               |
|---------+------------------------------->
  >----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                                                                               |
  |       To:       struts-user@jakarta.apache.org                                       
                                                                               |
  |       cc:                                                                            
                                                                               |
  |       Subject:  RE: BUG!!! FormFile                                                  
                                                                               |
  >----------------------------------------------------------------------------------------------------------------------------------------------------------------------|




Ben,

So is the bug in Opera or Struts? This problem is
extremely annoying. Also, do you mind posting your
work around?

Thanks,

Dan

-----Original Message-----
From: Ben Janes [mailto:bej@se.bluewave.com]
Sent: Thursday, December 18, 2003 1:19 AM
To: Struts Users Mailing List
Subject: RE: BUG!!! FormFile



HI Dan,

That would make sense, in my browsered enlightenment I
never use IE, only Opera 7.2......

Anyway, I wrote a work around in the PropertyUtils
class and now it all works fine... Same thing I
had wit mime types, IE: image/pjpeg Opera image/jpeg :
you tell me


Mvh
Benjamin A. Janes
------------------------------------
BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden


|---------+------------------------------->
|         |           Dan Payne           |
|         |           <stairwaymail-struts|
|         |           @yahoo.com>         |
|         |                               |
|         |           2003-12-17 17:14    |
|         |           Please respond to   |
|         |           "Struts Users       |
|         |           Mailing List"       |
|         |                               |
|---------+------------------------------->

>----------------------------------------------------------------------------------------------------------------------------------------------------------------------|

  |


    |
  |       To:       struts-user@jakarta.apache.org


    |
  |       cc:


    |
  |       Subject:  RE: BUG!!! FormFile


    |

>----------------------------------------------------------------------------------------------------------------------------------------------------------------------|





I have the same problem but ONLY with Opera 7.2x

I'm using Struts 1.1 and with Opera 7.1 everything
worked fine. The formFile field could be left blank.
When I upgraded to 7.2 it began to throw a argument
type mismatch when the formFile field was left blank.
Could this be the source of your problem? Everything
still works fine with IE. Here's the stack trace:

javax.servlet.ServletException: BeanUtils.populate
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
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
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:182)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)


at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)


at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)


at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)


at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)

root cause

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(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
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(RequestProcessor.java:821)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
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
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:182)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)


at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)


at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)


at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)


at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)


at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)

-----Original Message-----
From: Ben Janes [mailto:bej@se.bluewave.com]
Sent: Wednesday, December 17, 2003 5:39 AM
To: Struts Users Mailing List
Subject: RE: BUG!!! FormFile



Struts 1.1

Do you want more code, such as JSP /  ActionForm etc

Mvh
Benjamin A. Janes
------------------------------------
BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden



---------------------------------------------------------------------
To unsubscribe, e-mail:
struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail:
struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail:
struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail:
struts-user-help@jakarta.apache.org







---------------------------------------------------------------------
To unsubscribe, e-mail:
struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail:
struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org







---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message