I really need help here, i have a bundle that basically load the right locale property file in order to load the right language.
Now, these files, FlashcardsMessages_es.properties,FlashcardsMessages_de.properties are in a separated package as a fragment but for some reason it seems that my bundle is not finding the fragment.
java.util.MissingResourceException: Can't find bundle for base name de.tud.cs.se.flashcards.ui.FlashcardsMessages, locale es_MX
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at de.tud.cs.se.flashcards.ui.Messages.getMessage(Messages.java:65)
This is the error i got.
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: FlashCardOSGiED
Bundle-SymbolicName: FlashCardOSGiED
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: Activator
Export-Package: .,
de.tud.cs.se.flashcards.model,
de.tud.cs.se.flashcards.model.learning,
de.tud.cs.se.flashcards.model.learning.basic,
de.tud.cs.se.flashcards.persistence,
de.tud.cs.se.flashcards.ui,
de.tud.cs.util
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: javax.imageio,
javax.swing,
javax.swing.border,
javax.swing.event,
org.osgi.framework,
org.osgi.util.tracker
This is my bundle's manifest
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LocaleFragment
Bundle-SymbolicName: LocaleFragment;singleton:=true
Bundle-Version: 1.0.0.qualifier
Fragment-Host: FlashCardOSGiED
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: de.tud.cs.se.flashcards.ui
And this is my fragment's manifest.
If someone could give me some idea what could be wrong t would be awesome.
EDIT: I found the problem, so eclipse or java wont put any resource like properties files or images files inside the jar when the the compiler runs, so my solution was to put the properties files inside the "classes" folder and then after compiling eclipse did put the files inside the jar files correctly. I found this in some other website but some of the suggestions here inspired me into looking in to that direction so thanks a lot.