You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Arieh Markel <Ar...@central.sun.com> on 2000/08/25 21:55:34 UTC

Runtime problem with not finding resource bundles (unloaded method)

During my work on bringing my application to try to work with 3.2,
I am running with a number of significant problems.

Some of them are causing me a total rewrite of the servlets I was using
before.

For some context:

. our application embeds Tomcat in itself. It includes two contexts: the
  default one, for a 'console', the second one, for services, that are
  'dynamic' (i.e. servlets for them are instantiated upon discovery or
  access to those components).
  
. A single login servlet is used to control access to the application.
  On that servlet, a sessionid is established, that is used as a key
  for data structures that are mapped to each session.
  
. We need to be able to function with cookies turned off

-----
Our application was performing nicely under the 3.1 codebase.

I thought I managed to make all changes necessary to make it work under
3.2.

That is when problems started to appear.

1. The initial servlet never showed any output.

   What appeared to happen is that a response.setHeader("Location", )
   appeared not to take effect.
   
2. I got the following exception (no idea why it is being generated)
   
<h1>Error: 500</h1>
<h2>Location:/tools</h2><b>Internal Servlet 
Error:</b><br><pre>java.lang.ExceptionInInitializerError: 
java.util.MissingResourceException: Can't find resource for base name 
org.apache.tomcat.core.LocalStrings, locale en_US
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.lang.RuntimeException.<init>(RuntimeException.java:47)
        at 
java.util.MissingResourceException.<init>(MissingResourceException.java:54)
        at java.util.ResourceBundle.getBundle(Compiled Code)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:339)
        at org.apache.tomcat.util.StringManager.<init>(StringManager.java:112)
        at org.apache.tomcat.util.StringManager.getManager(Compiled Code)
        at <Unloaded Method>
        at 
org.apache.tomcat.facade.ServletContextFacade.getRequestDispatcher(ServletContex
tFacade.java:157)
        at com.sun.esm.web.console.tools.ToolTabs.doGet(Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at com.sun.esm.web.servlet.CMCServlet.service(CMCServlet.java:395)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.tomcat.facade.ServletWrapper.doService(ServletWrapper.java:417)
        at 
org.apache.tomcat.facade.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Compiled Code)
        at 
org.apache.tomcat.facade.ServletWrapper.service(ServletWrapper.java:387)
        at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
        at org.apache.tomcat.core.ContextManager.service(Compiled Code)
        at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Compiled 
Code)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Compiled Code)
        at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)
<b>Root cause:</b>
java.util.MissingResourceException: Can't find resource for base name 
org.apache.tomcat.core.LocalStrings, locale en_US
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.lang.RuntimeException.<init>(RuntimeException.java:47)
        at 
java.util.MissingResourceException.<init>(MissingResourceException.java:54)
        at java.util.ResourceBundle.getBundle(Compiled Code)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:339)
        at org.apache.tomcat.util.StringManager.<init>(StringManager.java:112)
        at org.apache.tomcat.util.StringManager.getManager(Compiled Code)
        at <Unloaded Method>
        at 
org.apache.tomcat.facade.ServletContextFacade.getRequestDispatcher(ServletContex
tFacade.java:157)
        at com.sun.esm.web.console.tools.ToolTabs.doGet(Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at com.sun.esm.web.servlet.CMCServlet.service(CMCServlet.java:395)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.tomcat.facade.ServletWrapper.doService(ServletWrapper.java:417)
        at 
org.apache.tomcat.facade.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Compiled Code)
        at 
org.apache.tomcat.facade.ServletWrapper.service(ServletWrapper.java:387)
        at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
        at org.apache.tomcat.core.ContextManager.service(Compiled Code)
        at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Compiled 
Code)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Compiled Code)
        at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)
</pre>


3. After logging in through the initial screen, I expect the printWriter
   to output my HTML. I added trace statements to verify that I reach the
   section of code, yet nothing gets printed out.
  
Here are some traces for the execution
 
com.sun.esm.web.console.login.Login:1 theSession: null
createURLSession 1: urlSession gi3y0fkor1
createURLSession 2: urlSession gi3y0fkor1
com.sun.esm.web.console.login.Login:2 theSession: 
org.apache.tomcat.session.StandardSession@b379d4
com.sun.esm.web.console.login.Login:5 theSession: 
org.apache.tomcat.session.StandardSession@b379d4
Login: doGet: 0
Login: doGet: 8
Login: doGet: 9
updateLoginScreen 1
updateLoginScreen 2
replaceAndPrint: 1 file 
/ws/wwwfw_work/amarkel/usr/proto/etc/opt/SUNWesm/www/console/login/login.html
updateLoginScreen 3
Login: doGet: 10

(The replaceAndPrint is the invocation of the servlet outputting the
contents of login.html, which is a form).


com.sun.esm.web.console.login.Login:3 theSession: 
org.apache.tomcat.session.StandardSession@b379d4
com.sun.esm.web.console.login.Login:5 theSession: 
org.apache.tomcat.session.StandardSession@b379d4
Login: doPost: 0
replaceAndPrint: 1 file 
/ws/wwwfw_work/amarkel/usr/proto/etc/opt/SUNWesm/www/console/MainFrame.html

This is the next step, when the MainFrame.html file is output by the
servlet.

However, nothing happens.

The replaceAndPrint method is a utility method that opens the file passed
and outputs it through the request printWriter.


----

I thought that migration from 3.1 to 3.2 was going to be a reasonable
task.

Following the work I have been doing over the past 3 days, it appears to
me that we will not be able to take advantage of 3.2.

To continue the thought, the result will end up being to rewrite our
application, or stick with the 3.1 version.

----

Is there a document explaining the behavior changes from 3.1 to 3.2 ?

I am at a loss to even begin understanding what is the reason for the 
behaviors I see.


Arieh
--
 Arieh Markel		                Sun Microsystems Inc.
 Network Storage                        500 Eldorado Blvd. MS UBRM11-194
 e-mail: arieh.markel@sun.COM           Broomfield, CO 80021
 Let's go Panthers !!!!                 Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)