views:

56

answers:

1

Hi,

I have been having this issue in iterating through an array of keys and calling the getString() method on the resource bundle. I have all the mappings I need in my bundle and for some reason one of the resource will not be fetched. This is only an issue in Linux Ubunthu 9. It works in Windows. It finds all the resources up until my "item" resource which is mapped correctly. As stated above I use the same jar on bot os's. All my resources work except this single key. I have tried changing the key and this resource, but it keeps throwing the MissingResourceException. My classpath is correct otherwise my other keys would not function. I have no idea what could be causing this. I have also tried reordering my bundle - no luck.

Any input would be appreciated.

String cols = new String[] {"name", "actor" , "requestor", "electronicFolder", "item", "dueOn", "finalOccurrenceOn"};

ResourceBundle rb = ResourceBundle.getBundle("application");
for (int i=0; i<cols.length; i++) {
    if (rb==null) {
     out.print("null");
    } else {
     try {
      out.print(" " + rb.getString(cols[i]) + " : ");
     } catch (MissingResourceException ee) {
      ee.printStackTrace();
     }
    }
}

As stated above works perfectly in Windows, fails on item in Linnux Ubunthu. This is really an annoyance.

A: 

I found that this was working in my dev env, but not as a packaged EAR. The problem was that the included jsp utilized a bean tag. I removed this reference and utilize our custom tag similar to the bean tag and it worked.

Grep