seam fileupload problem reflection error
yilmaz_ Dec 3, 2007 4:10 PMOS : Win xp
Seam 1.2.1 GA @ JBOSS 4.2.2 GA
I tried both
private InputStream picturedata;
or
private byte[] picturedata;[]
i am getting following error
23:09:06,203 WARN [lifecycle] javax.el.ELException: /private/profile/profile.xhtml @43,5 data="#{privatePerson.picturedata}": Error writing 'picturedata' on type org.javassist.tmp.java.lang.Object_$$_javassist_15 javax.faces.el.EvaluationException: javax.el.ELException: /private/profile/profile.xhtml @43,5 data="#{privatePerson.picturedata}": Error writing 'picturedata' on type org.javassist.tmp.java.lang.Object_$$_javassist_15 at javax.faces.component.ValueBindingValueExpressionAdapter.setValue(ValueBindingValueExpressionAdapter.java:147) at org.jboss.seam.ui.UIFileUpload.decode(UIFileUpload.java:57)
I am using this interface and implemented all methods.
public interface PrivatePersonService { public String updatePerson(); public InputStream getPicturedata(); public void setPicturedata(InputStream data) ; public String getContentType() ; public void setContentType(String contentType); public String getFileName(); public void setFileName(String fileName); public String getTitle() ; public void setTitle(String title); }
@Stateless @Name("privatePerson") public class PrivatePerson implements PrivatePersonService { @In @Out User user; @In EntityManager entityManager; @In FacesMessages facesMessages; @In FacesContext facesContext; @Logger Log log; private String contentType; private String fileName; private String title; private InputStream picturedata; public String updatePerson() { try { entityManager.merge(user.getPerson()); if (getPicturedata() != null) { //.... } } catch (Exception e) { } return ""; } /** * @return the data */ public InputStream getPicturedata() { return picturedata; } /** * @param data * the data to set */ public void setPicturedata(InputStream picturedata) { this.picturedata = picturedata; } /** * @return the contentType */ public String getContentType() { return contentType; } /** * @param contentType * the contentType to set */ public void setContentType(String contentType) { this.contentType = contentType; } /** * @return the fileName */ public String getFileName() { return fileName; } /** * @param fileName * the fileName to set */ public void setFileName(String fileName) { this.fileName = fileName; } /** * @return the title */ public String getTitle() { return title; } /** * @param title * the title to set */ public void setTitle(String title) { this.title = title; } }
i configured web.xml
<filter> <filter-name>Seam Filter</filter-name> <filter-class>org.jboss.seam.web.SeamFilter</filter-class> </filter> <filter-mapping> <filter-name>Seam Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
component.xml file
<component class="org.jboss.seam.web.MultipartFilter"> <property name="createTempFiles">true</property> <property name="maxRequestSize">1000000</property> </component>
Server log show multipart component is intalled.