-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.util.MissingResourceException: Can't find bundle for base name Bundle, locale en #5078
Comments
This sounds similar to an issue that was fixed in the PR. It is odd that I'm not seeing this on linux systems, but that it shows up on os x. |
Yep. It's a weird one. @sekmiller also mentioned that when he changes Bundle.properties like we always have the changes aren't reflected so he updated the new JVM option to point to the traditional location of Bundle.properties as a workaround. |
Reviewing the code, it looks as if the issue hinges on the existence of the directory. Regardless of whether you have the setting, the code looks for a directory (either what you set or /tmp/lang). If the directory exists, but is empty, you would see this exception. If the directory doesn't exist, it attempt to use the standard location, i.e. use the included bundle. If this is accurate (and @sekmiller is going to run some tests), it would mean that when @pdurbin first tried above, he actually already had a /tmp/lang directory, but it was empty. Moving the directory so it doesn't exist anymore would solve the problem. So this likely wouldn't effect developers since they wouldn't have a /tmp/lang directory. That said, we prefer to be more explicit, i.e. if you don't set the setting it won't assume /tmp/lang but attempt to the standard location / included bundle. If you do set the setting, and the directory does not exist it, shoudl through an exception. |
After reviewing our hypothesis above, I made the changes outlined. Removed the code that set the directory to "tmp/lang" in the absence of the of the jvmOption. Now if the option is set, but the directory is missing or the directory designated in the jvmOption exists, but does not contain the expected bundle a catastrophic deployment error will occur. |
I spent quite a bit of time today struggling with my dev environment on Mac after pulling the latest from the "develop" branch, commit d0cb402, which was the merge for pull request #5023 for #4892.
I was unable to deploy to Glassfish and saw this error in Glassfish's server.log:
This was coming from line 50 of BundleUtil:
bundle = ResourceBundle.getBundle(defaultBundleFile, bundle_locale, loader);
Here's a handy link:
dataverse/src/main/java/edu/harvard/iq/dataverse/util/BundleUtil.java
Line 50 in d0cb402
In desperation, I almost completely rebuilt my dev environment, which the exception of Solr:
What seemed to fix it was the following:
Why
/tmp/lang
? Because that's what the code defaults to if you don't have the newdataverse.lang.directory
JVM option defined (the installer doesn't set it):dataverse/src/main/java/edu/harvard/iq/dataverse/util/BundleUtil.java
Lines 29 to 32 in d0cb402
The extra weird thing is that now that I can deploy to Glassfish again, I don't seem to be able to get back to seeing MissingResourceException. For example, I tried moving the lang directory aside, stopping Glassfish, and removing the "generated" folder. I expected the error to come back but it didn't. I can still deploy. Very strange.
Also very strange is the fact that this problem only seems to happen on Mac rather than Linux.
I'm concerned that new developers will have a bad experience trying to get their dev environments set up, so I think we should do something, but I'm not sure what.
If anyone out there runs into this problem too, please let us know.
The text was updated successfully, but these errors were encountered: