Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MissingResourceException thrown from SimpleDateFormat

10 views
Skip to first unread message

Dan Wilks

unread,
Aug 24, 2000, 3:00:00 AM8/24/00
to
Has anyone ever seen SimpleDateFormat throw a MissingResourceException?
Every once in a while I'm seeing this exception in the logging code
(protomatter) that we're using. Each log entry constructs a new
SimpleDateFormat (seem's pretty bad to me, but that's not the issue).
Yesterday I saw two exceptions twenty minutes apart. The stack trace is...

java.util.MissingResourceException: Can't find resource for bundle
java.text.resources.LocaleElements_en, key Eras
at java.util.ResourceBundle.getObject(ResourceBundle.java:322)
at java.text.DateFormatSymbols.initializeData(DateFormatSymbols.java:458)
at java.text.DateFormatSymbols.<init>(DateFormatSymbols.java:109)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:286)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:275)
at
com.protomatter.syslog.SimpleSyslogTextFormatter.formatLogEntry(SimpleSyslog
TextFormatter.java:72)
at com.protomatter.syslog.TimeRolloverLog.log(TimeRolloverLog.java:303)
at com.protomatter.syslog.Syslog.log(Syslog.java:544)
at com.intuit.util.Log.doSyslog(Log.java:276)
at com.intuit.util.Log.debug(Log.java:384)

What's even stranger is that we logged the MissingResouceException and it
*didn't* throw this exception.

If anyone's seen something like this, could you please let me know. Feel
free to contact me directly at dan_...@intuit.com.

Thanks.

Dan Wilks

unread,
Aug 24, 2000, 3:00:00 AM8/24/00
to
What I forgot to mention was that this is running under Java 1.2 Hotspot on
a Sun Ultra 60 running SunOS 2.7 native threads.

Tony Dahlman

unread,
Aug 27, 2000, 3:00:00 AM8/27/00
to Dan Wilks
[mailed and posted]
Have never seen this, Dan, so this is just guessing....

If the description you supplied means that a new SimpleDateFormat
object is created every time a log entry is created, then you
may be seeing two logging threads competing for the same resource
at the same time.

The exception would then be the way java.text package prevents
your code from deadlocking. In this case the author of the
com.protomatter.syslog package should be asked to fix/upgrade
the code to something more sensible.

Sorry, I don't have time to look at the source, but you could do
that. Generally a formatter just needs to be created once. A
reference to it in the object that does the logging should "live on"
between log events whether for weeks or for milliseconds.

- Tony Dahlman

0 new messages