Wednesday, September 1, 2010

java.util.MissingResourceException

This represents about 3 days of my life I'm never getting back.

So I use RAD 7.5 for my java development. I write code for web-based internal applications. The general rule is big on business logic and big on the ugly. User interface isn't a priority as the users have a very specific idea of what they want. Sometimes we steer them in the right direction, sometimes they win and other times they were right all along.

That's all well and good.

I was setting up my RAD to have 3 environments, matching the 3 we had on servers. DEV, QA, Production. Simple stuff. I used to think you created a new server per set of environment variables. But, I eventually realized that, at least in the sole websphere development configuration, you have to create a profile for each set of distinct environment variables.

We load some properties via resource bundle. I change this folder depending on the environment. This is working in two of my environments, but attempts to create and run the third fail. I keep getting MissingResourceException on the bundle - for about 3 days.

Eventually, I figured out how to make it work (but not how to solve the root problem). Server was trying to read "E:" drive. That’s fine, 2 other profiles were doing it for other servers within RAD workspaces. I moved the bundles to the C: drive and viola! success. For some inexplicable reason, WAS was unable to see "E:" for one profile only. Even when the last profile didn't work, starting up a server pointed at another profile happily found and loaded bundles on E.

Thoughts/"ideas":
  1. E:\ was created from subst command. Subst e: c:\resource\props or some such. Point of that was to keep websphere variables consistent between local dev and actual deployed server paths.

  2. I think at some point during this process I got previously revoked admin rights reinstated for use with another product.

  3. Old profiles were created probably without admin rights.

  4. They also introduced a continuous encryption process. And, I later found out I had 2 different encryption certs. Some of my files were encrypted with cert A and some with cert B.

After I solved this problem, I was all gung-ho to post about it because it took so long to remedy it. But now I realize it was probably only specific to my set of unique and unusual circumstances. If not, I hope I've led you down the right path.

No comments:

Post a Comment