voyent
ice:inputFile: MissingResourceException when uploading  XML
Forum Index -> Components
Author Message
rthomas

Joined: 01/Feb/2008 00:00:00
Messages: 12
Offline


I have specified an inputFile element:

<ice:inputFile id="fu" label="Submit" actionListener="#{archiver.uploadFile}"/>

My actionListener gets called (it just logs a message), but then there is an exception:

12:20:38,114 ERROR [[Persistent Faces Servlet]] Servlet.service() for servlet Persistent Faces Servlet threw exception
java.util.MissingResourceException: Can't find bundle for base name org.jboss.seam.international.messages, locale en

This occurs whether or not I include an h:message element

Thanks for any help.
rthomas

Joined: 01/Feb/2008 00:00:00
Messages: 12
Offline


I realize this is really a Seam configuration issue, as far as finding text for an error message. I'll post separately on the root cause exception in the upload servlet
jguglielmin

Joined: 20/Jul/2007 00:00:00
Messages: 181
Offline


You need to have a messages.properties bundle with the correct location specified in faces-config.xml. See seam-comp-showcase for this.
rthomas

Joined: 01/Feb/2008 00:00:00
Messages: 12
Offline


I already have it. All the text in my application comes from my messages.properties file.

But this begs the question. Why is the upload servlet trying to retrieve application-specific localized messages for its exception handling?
mark.collette


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


It's not Exception handling, so much as for FacesMessages, which are intended to be viewed by the end user. For inputFile, there are user errors, which will trigger FacesMessage creation, such as uploading a file that's too large, or typing in a file name that doesn't exist.
[Email]
rthomas

Joined: 01/Feb/2008 00:00:00
Messages: 12
Offline


I'm still confused. The messages.properties file in the showcase contains application-specific messages. Does it also contain messages to be used by the inputFile component? I see nothing that relates to "built in" error messages required by Icefaces.

And back to the original problem: Even though I have a messages.properties file, the upload servlet exception indicates that it cannot find the file, not that a particular message is missing. (In the latter case, I assume that the key would be output, just as happens if a key-value pair is missing from the properties.)

To summarize:

1. The upload servlet is looking for a messages.properties file
2. I have a messages.properties file, configured in faces-config.xml which my application finds and uses.
3. My messages.properties file of course does not have the key-value pairs on which the inputFile component is supposedly relying.

So:

4. Is there a properties file required by the inputFile component?
or
5. Must an application messages file include tags required by Icefaces?

This just doesn't make any sense. I'm obviously missing something here.

Thanks.
mark.collette


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


Looking more closely at your posting, I see that it's looking for org.jboss.seam.international.messages, which is a Seam properties file. Can you provide the whole stack trace? Because I don't understand why our component would be trying to access that. Do you have an s: tags on that page? Can you try pairing down your page, just to test, so that it only has the inputFile component on it?
[Email]
rthomas

Joined: 01/Feb/2008 00:00:00
Messages: 12
Offline


Thanks for your response. I was in error in the snippet that I included above:

<ice:inputFile id="fu" label="Submit" actionListener="#{archiver.uploadFile}"/>

The version I was running had a reference to the message bundle, i.e.:

<ice:inputFile id="fu" label="#{messages['lbl_submit']}"
actionListener="#{archiver.uploadFile}"/>

So the error is caused by the upload servlet being unable to find the messages bundle, which is used all throughout the rest of my application.

I decided to defer using the bundle for the file upload for now, and just hard coded the "Submit" label. This avoids the exception, and my actionListener is called upon completion of the upload.

BUT........

After the listener is called, there is:

java.lang.IllegalArgumentException: method not found: destroy for component: testManager

I will zip up a stripped down version of my code later and send it, but what appears to be now happening is this: the Seam scope of my backing bean and session bean are being ignored and the system is attempting to destroy them. In the above case, the "testManager" is a SESSION scoped session bean injected into the SESSION scoped backing bean which contains the actionListener. So it looks like something is trying to destroy these objects in spite of their Seam scope declarations.

To summarize:
1. The uploadServlet is unable to locate the application messages.properties file, even though it is properly configured and accessible throughout the rest of the application.
2. The uploadServlet is ignoring the Seam scope of the backing bean containing the actionListener


 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team