Not able to load a properties file

Joined
Jul 27, 2008
Messages
1
Reaction score
0
when i am trying to load the properties file in to my class, my program is not able to identify the properties file, i even tryed by passing the entire path but there is no luck. Please find the code that i am facing problem

Code:

public static String mymethod(String ss)
{
ResourceBundle resources = ResourceBundle.getBundle(ss);
String s = resources.getString("USER");
System.out.println(s);
return s;
}

public static void main(String[] args) {
String st =mymethod("DBase");
System.out.println(st);
}

The Exception i am getting is :

java.util.MissingResourceException: Can't find bundle for base name DBase, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at dev_java.examples.HelloWorld.mymethod(HelloWorld.java:13)
at dev_java.examples.HelloWorld.main(HelloWorld.java:25)

---------------- Exception Ends ------------

Any help can be appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top