File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Getting MissingResourceException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Getting MissingResourceException" Watch "Getting MissingResourceException" New topic

Getting MissingResourceException

Mallikarjuna Chejerla

Joined: Jul 24, 2006
Posts: 16

I have written simple servlet,Where in init() method of this servlet i have written the following code in the try block..

ResourceBundle resB = ResourceBundle.getBundle("com.pack1.fileprops");

I placed servlet, in the com/pack1 package under my src folder of the application.

After making build the servlet class file, files are moving to WEB-INF/classes/com/pack1.

I am making war file and deploying this under tomcat.I am accessing this servlet from the JSP page written in the application.At this point in init()method of servlet where getBundle() method call exist.. I am getting following Error

java.util.MissingResourceException: Can't find bundle for base name com.pack1.fileprops, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(
at java.util.ResourceBundle.getBundleImpl(
at java.util.ResourceBundle.getBundle(
at Source)
at javax.servlet.GenericServlet.init(
at org.apache.catalina.core.StandardWrapper.loadServlet(
at org.apache.catalina.core.StandardWrapper.allocate(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardValveContext.invokeNext(
at org.apache.catalina.core.StandardPipeline.invoke(
at org.apache.catalina.core.StandardContextValve.invokeInternal(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardValveContext.invokeNext(
at org.apache.catalina.core.StandardPipeline.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.core.StandardValveContext.invokeNext(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardValveContext.invokeNext(
at org.apache.catalina.core.StandardPipeline.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.core.StandardValveContext.invokeNext(
at org.apache.catalina.core.StandardPipeline.invoke(
at org.apache.catalina.core.ContainerBase.invoke(
at org.apache.coyote.tomcat5.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protoco
at org.apache.tomcat.util.threads.ThreadPool$
Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(
at java.util.Properties.load0(
at java.util.Properties.load(
at java.util.PropertyResourceBundle.<init>(
at java.util.ResourceBundle$Control.newBundle(
at java.util.ResourceBundle.loadBundle(
at java.util.ResourceBundle.findBundle(
at java.util.ResourceBundle.findBundle(
at java.util.ResourceBundle.findBundle(
at java.util.ResourceBundle.getBundleImpl(
... 27 more

Plese Tell me the solution for this.. I am unable to understand why tomcat is not able to find out and load the resource that exist in the application WEB-INF/classes/com/pack1

Thanks in Advance!
[ September 26, 2008: Message edited by: Mallikarjuna Chejerla ]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
According to this:

The file is being read but the Properties class loadConvert module has hit text in the "\uxxxx" format which it can not interpret.

Looking at the java.util.Properties class for Java 6 - legal formats would have a 0-9 number or a-f or A-F hex digit following \u

Therefor your problem is in the content of your file, not where it is.

Don't get me started about those stupid light bulbs.
subject: Getting MissingResourceException
Similar Threads
In Tomcat 5, example of JSP1.2 working but example of JSP 2.0 is not working
Tomcat + NullPointerException
web app
i looked at log file and not know to correct
ServletException and Wrapper cannot find servlet class