Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Preferences API and Mac (maybe XP also?!) OS, oddity/issue?

Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

At the company I work for, we've got this software, written in Java, that's supposed to work with all OSes, all browsers, etc.

Apparently not.

The issue seems to be with the Preferences API, but I wanted to know if this was a known issue, or something unusual I didn't account for.

I get the following message when the applet starts, but only in the Mac running Firefox. Firefox on Windows runs just fine, as does IE 6 and Opera on Windows.

Here's what I get:

Java(TM) Plug-in: Version 1.4.2_09
Using JRE version 1.4.2_09 Java HotSpot(TM) Client VM
User home directory = /Users/admin
Proxy Configuration: No proxy

c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
MRJ Plugin for Mac OS X v1.0.1
java.lang.NoClassDefFoundError: Illegal name: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
at java.lang.ClassLoader.defineClass(
at sun.applet.AppletClassLoader.findClass(
at java.lang.ClassLoader.loadClass(
at sun.applet.AppletClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at javax.xml.parsers.FactoryFinder.newInstance(
at javax.xml.parsers.FactoryFinder.find(
at javax.xml.parsers.DocumentBuilderFactory.newInstance(
at java.util.prefs.XmlSupport.load(
at java.util.prefs.XmlSupport.importPreferences(
at java.util.prefs.Preferences.importPreferences(
at (a line in my code that calls Preferences.importPreferences(myinputstream)


Now, on top of the fact that this problem doesn't occur on any browser in Windows, what's weirder still is that the .xml file referred to by myinputstream doesn't have the line:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

anywhere in it at all!

It actually starts with:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE preferences SYSTEM ''>

<preferences EXTERNAL_XML_VERSION="1.0">
<root type="user">
... etc

That 4.01 transitional stuff is in the web-page source itself . . which my applet is NOT trying to read!

Is there some sort of known issue with Java Plugin or the JRE on Mac OS 10.3.9? Is there a workaround?

Thanks in advance...

EDIT: I seem to have gotten a similar error using WinXP, with any browser. Same line, though, Preferences.importPreferences(myInputStream)

Anyone ever see something like this?
[ December 15, 2006: Message edited by: Joe Vahabzadeh ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!