Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

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

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(ClassLoader.java:538)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:157)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:93)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:174)
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:93)
at java.util.prefs.XmlSupport.load(XmlSupport.java:210)
at java.util.prefs.XmlSupport.importPreferences(XmlSupport.java:181)
at java.util.prefs.Preferences.importPreferences(Preferences.java:1171)
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 'http://java.sun.com/dtd/preferences.dtd'>

<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