voyent
Why ace:fileEntry does not work?  XML
Forum Index -> Components Go to Page: 1, 2 Next 
Author Message
cristiboariu@gmail.com

Joined: 20/Jan/2011 04:52:32
Messages: 10
Offline


I'm using jsf 2.0 and icefaces 3 component to upload files:

Code:
<h:form enctype="multipart/form-data">   
 <ace:fileEntry
         id="file-entry"
         relativePath="/files/"
         maxFileCount="10"
         maxFileCountMessage="Limited to 10 files uploaded concurrantly."
         fileEntryListener="#{uploadFileBean.sampleListener}"
         maxFileSize="6291456"
         maxFileSizeMessage="Submitted file is too large."
         maxTotalSize="18874368"
         maxTotalSizeMessage="Total size of submitted files is too large."
         required="true"
         requiredMessage="The file is required to submit this form."
         useOriginalFilename="true"
         useSessionSubdir="true" />
 
       <h:commandButton
         id="submit"
         type="submit"
         value="Send File" />
       </h:form>

but after I select a file to upload and press Send File button, I receive:

The file is required to submit this form. 


which is very strange because I already selected a file.

Does anyone has any suggestion?
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1396
Offline


Have you looked at this tutorial on ace fileEntry? There is code attached that you may want to try first and then fit to your application.
http://www.icesoft.org/wiki/display/ICE/Incremental+Upload+Processing+Using+FileEntryCallback
cristiboariu@gmail.com

Joined: 20/Jan/2011 04:52:32
Messages: 10
Offline


Yes, I've just tried it in my application (jboss 7, icefaces 3.2.0) and receive:

'exampleForm:fileEntry' required a file be selected for uploading 'exampleForm:fileEntry' required a file be selected for uploading
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1396
Offline


Please see if this could be your issue:-
http://jira.icesoft.org/browse/ICE-7738
not sure if you are using the following context-param in your web.xml, but it might be worth a try:-
<context-param>
<param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
<param-value>fileEntry</param-value>
</context-param>

(if you are using more of the components, you can try 'all' as the param-value instead of 'fileEntry')
ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1338
Offline


Hi,

Please note that ICEfaces 3 requires JSF 2.1. In fact, there is a specific set of JSF runtime library versions supported on each release, which are documented in the Release Notes.

Your problem could very well be related to using an unsupported JSF runtime version.

Regards,
Ken



Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
cristiboariu@gmail.com

Joined: 20/Jan/2011 04:52:32
Messages: 10
Offline


Hi Ken,
I'm using Icefaces 3.2.0 and indeed I had JSF 2.1.7 while this release requires JSF 2.1.6. I changed it to be 2.1.6:

18:41:02,844 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Initializing Mojarra 2.1.6 (SNAPSHOT 20111206) for context '' 


but still the same error:

Code:
'test:file-entry' required a file be selected for uploading
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1396
Offline


Did you try the mandatory configuration option in your web.xml?
cristiboariu@gmail.com

Joined: 20/Jan/2011 04:52:32
Messages: 10
Offline


Yes, this seems to not solve the issue (with both fileEntry or all):

Code:
<context-param> 
 <param-name>org.icefaces.mandatoryResourceConfiguration</param-name> 
 <param-value>fileEntry</param-value> 
 </context-param> - See more at: http://www.icesoft.org/JForum/posts/list/22360.page#sthash.xlW0QxNr.oufkl1QD.dpuf
mark.collette


Joined: 07/Feb/2005 00:00:00
Messages: 1692
Offline


The problem might be in setting enctype yourself in the form. ace:fileEntry does that automatically itself.

<h:form enctype="multipart/form-data">
[Email]
cristiboariu@gmail.com

Joined: 20/Jan/2011 04:52:32
Messages: 10
Offline


Hi Ken,

Even if I remove enctype from the form, I receive the same error.
juvinao

Joined: 22/Sep/2008 00:00:00
Messages: 19
Offline


Did you could solve the issue? i am stuck with the same problem.

y tried in web.xml:

Code:
<context-param>
         <param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
         <param-value>fileEntry</param-value>
     </context-param>



i always get the requiredMessage property value.

thanks.
cristiboariu@gmail.com

Joined: 20/Jan/2011 04:52:32
Messages: 10
Offline


I haven't solved the issue and unfortunately it seems that icefaces guys are pretty quiet overhere.
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1396
Offline


Did you try building the showcase example from the downloaded bundle and deploy that to your application server?
If this doesn't work, then it's much easier to go through and see (remotely) what the (possible) problem is.
If it works, then you can review what is different from your application and showcase.
Thanks,
there are two targets for the build depending on whether your application server is servlet-profile (does not contain jsf jars like tomcat) or web-profile (contains jsf jars).
Code:
 ant -p Buildfile:
  icefaces3/samples/showcase/showcase/build.xml 
 Main targets: 
 servlet-profile Generate a .war file according to the servlet-profile which includes the JSF and EL libraries. (Jetty 7, Tomcat 6 and 7) 
 web-profile Generate a .war file according to the web-profile which excludes the JSF and EL libraries. (GlassFish v3, JBoss 6) 
 Default target: servlet-profile - See more at: http://www.icesoft.org/JForum/posts/list/20324.page#sthash.1CkXkUam.dpuf
 
juvinao

Joined: 22/Sep/2008 00:00:00
Messages: 19
Offline


I detected that i am using glassfish 4 and this is not in the list of supported platforms for Icefaces 3.3. :(

http://www.icesoft.org/java/projects/ICEfaces/supported-platforms.jsf

Just glassfish 3.0/3.1 are supported.

I tried with glass fish 3.1.2 and it works.

I'll be waiting for the Icefaces 4 release to upgrade.

thanks for your help.
joseluis829

Joined: 25/Aug/2010 18:05:03
Messages: 2
Offline


Hi guys! I have the same problem, I am migrating my code from Glassfish 3 to JBoss EAP 6.1. It was working fine in Glassfish 3 but when I changed the web app server, it does not upload the file. If I set the file as required, I get the same error as cristiboariu, otherwise I get nothing. How did you solve this problem folks? Or what could be an alternative? Please help me with his one :)

Code with Icefaces 2, Glassfish 3 (it does not work in JBoss)
Code:
 <ace:fileEntry
                         useOriginalFilename="true"
                         useSessionSubdir="true"
                         absolutePath="./../../docroot"
                         fileEntryListener="#{ctrEditions.uploadListener}"
                         relativePath="uploaded"
                         id="pPPdf">
                     </ace:fileEntry>
                     <h:commandButton value="Upload file" />
 
 
Forum Index -> Components Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team