tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Petr Jiricka <petr.jiri...@netbeans.com>
Subject [PATCH] MissingResourceException -> NoClassDefFoundError
Date Fri, 23 Jun 2000 13:17:32 GMT
Hello,

I was getting a MissingResourceException and consequently a
NoClassDefFoundError because LoadOnStartupInterceptoris trying to load a
nonexisting bundle. It looks like a similar bug is also in WebXmlReader.

The following patch fixes this.

Thanks
Petr

cvs diff -u *.java 
Index: LoadOnStartupInterceptor.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnSta
rtupInterceptor.java,v
retrieving revision 1.14
diff -u -r1.14 LoadOnStartupInterceptor.java
--- LoadOnStartupInterceptor.java	2000/06/23 02:16:17	1.14
+++ LoadOnStartupInterceptor.java	2000/06/23 12:45:29
@@ -74,7 +74,7 @@
  */
 public class LoadOnStartupInterceptor extends BaseInterceptor {
     private static StringManager sm =
-	StringManager.getManager("org.apache.tomcat.context");
+	StringManager.getManager("org.apache.tomcat.resources");
     
     public LoadOnStartupInterceptor() {
     }
Index: WebXmlReader.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/context/WebXmlRea
der.java,v
retrieving revision 1.25
diff -u -r1.25 WebXmlReader.java
--- WebXmlReader.java	2000/06/22 00:14:59	1.25
+++ WebXmlReader.java	2000/06/23 12:45:30
@@ -22,7 +22,7 @@
     public static final String defaultWelcomeList[]={"index.jsp",
"index.html", "index.htm"};
     public static final int DEFAULT_SESSION_TIMEOUT=30;
 
-    private static StringManager sm
=StringManager.getManager("org.apache.tomcat.core");
+    private static StringManager sm
=StringManager.getManager("org.apache.tomcat.resources");
     boolean validate=true;
 
     public WebXmlReader() {


BTW, these are the exceptions I got:

java.lang.ExceptionInInitializerError: java.util.MissingResourceException:
Can't find bundle for base name org.apache.tomcat.context.LocalStrings,
locale en_US
        at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:7
15)
        at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:687)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:554)
        at
org.apache.tomcat.util.StringManager.<init>(StringManager.java:112)
        at
org.apache.tomcat.util.StringManager.getManager(StringManager.java:263)
        at
org.apache.tomcat.context.LoadOnStartupInterceptor.<clinit>(LoadOnStartupInt
erceptor.java:77)
        at
org.apache.tomcat.startup.EmbededTomcat.initDefaultInterceptors(EmbededTomca
t.java:339)
        at
org.apache.tomcat.startup.EmbededTomcat.initContextManager(EmbededTomcat.jav
a:290)
        at
org.apache.tomcat.startup.EmbededTomcat.addContext(EmbededTomcat.java:145)
        ......
java.lang.NoClassDefFoundError
        at
org.apache.tomcat.startup.EmbededTomcat.initDefaultInterceptors(EmbededTomca
t.java:339)
        at
org.apache.tomcat.startup.EmbededTomcat.initContextManager(EmbededTomcat.jav
a:290)
        at
org.apache.tomcat.startup.EmbededTomcat.addContext(EmbededTomcat.java:145)
        ......


Mime
View raw message