Closed Thread Icon

Topic awaiting preservation: XMLDSO.class - JNI issue? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24328" title="Pages that link to Topic awaiting preservation: XMLDSO.class - JNI issue? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: XMLDSO.class - JNI issue? <span class="small">(Page 1 of 1)</span>\

 
Lord_Fukutoku
Paranoid (IV) Inmate

From: Back in West Texas... How disappointing
Insane since: Jul 2002

posted posted 12-08-2004 04:05

I've been looking around for a bit for this, but after staring at this bloody screen all day fixing others problems, my enthusiasm is wavering, so I bailed for now, and am going to try and take the easy way out ::enter you::

The problem:
I have this applet:

code:
<applet code="com.ms.xml.dso.XMLDSO.class"
ID="states"
WIDTH="400" HEIGHT="20"
MAYSCRIPT="TRUE"
codebase="./">
<PARAM NAME="URL" VALUE="test.xml">
</applet>



I haven't (knowingly/directly) used any native functions/classes in Java before, so I'm not even sure I'm barking up the right tree.
But when run it throws a ClassNotFoundException for com.ms.xml.dso.XMLDSO.class
Caused by: FileNotFoundException: "source dir"\com\ms\xml\dso\XMLDSO\class.class (The system cannot find the path specified)


Is there a problem with the system path?
A problem with Windows? (yea yea, I know that's a loaded question)

I ran it on a laptop here earlier and it works fine, but that's the only computer it worked on. On all the lab computers and everyone elses laptop it will throw that ClassNotFoundException. Unfortunately, the guy whose laptop it ran on left, so I can't go through and compare systems to see if there's something obvious I missed.

Ideas/comments/suggestions/a slap with a whiskery catfish/anything is appreciated,
LF
_____
Cogito ergo spud: "I think, therefore I yam"

(Edited by Lord_Fukutoku on 12-08-2004 04:06)

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 12-08-2004 07:39

Your issue is that when you give class paths you only do the class name not the class name dot path. You put the path in the codebase attribute.

Ie

code:
<applet code="XMLDSO.class"

...
CODEBASE="/com/ms/xml/dso"


Codebase is going to be relative to the current directory.

The clue should have been this line:

FileNotFoundException: "source dir"\com\ms\xml\dso\XMLDSO\class.class <-- (class.class?)


Check out this



.:[ Never resist a perfect moment
]:.

(Edited by bitdamaged on 12-08-2004 07:46)

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 12-08-2004 07:49

I should say I'm not familiar with using system files as applets (sounds like a bad idea generally). So I don't know how to do this using the system path variable.



.:[ Never resist a perfect moment ]:.

Lord_Fukutoku
Paranoid (IV) Inmate

From: Back in West Texas... How disappointing
Insane since: Jul 2002

posted posted 12-08-2004 20:43

Still throwing "FileNotFoundException: \com\ms\xml\dso\XMLDSO\class.class"

Changed "applet code='XMLDSO.class' " to "applet code='XMLDSO' ", and it throws "FileNotFoundException: \com\ms\xml\dso\XMLDSO.class"

Actually, looking at what I posted, "codebase='.\' " wasn't in the original file the professor gave us. That was one of the later things I started changing when I was running out of ideas. Even with no codebase attribute defined, it still threw a FileNotFoundException: "source dir"\com\ms\xml\dso\XMLDSO\class.class , so that would lead me to believe that the default codebase is ".\", yes? (I've never been a big fan of applets). But it still worked on that one machine, default values and all.

I'm not familiar with using system files as applets either, and I was thinking the same thing about it being somewhat of a bad idea when I saw it.

This "project" isn't actually going to be graded, but the prof doesn't know what the problem is, so naturally I get to figure it out.

Back on topic, it looking for "XMLDSO/class.class" kinda threw me off too, but leaving off the ".class" from the code attribute at least made it look for the right file. However, I'm thinking that's not the right problem to be chasing since I remember having to put "classname.class" when using an applet, even though running a app through the cmd line, you're supposed to leave off ".class"

Thanks for the effort bit, but no luck so far.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 12-08-2004 21:56

Actually I know the answer to this one now. (Stupid red wine last night) You can't access .class files that are outside your html root. Otherwise anyone can run class files on your system.

You need to move the class to your public html folder.



.:[ Never resist a perfect moment ]:.

Lord_Fukutoku
Paranoid (IV) Inmate

From: Back in West Texas... How disappointing
Insane since: Jul 2002

posted posted 12-09-2004 00:51

Oooooh, ok, that makes sense. The laptop that it worked on must have been logged on as admin.
Actually, I had started copying the classes to my source dir last night, but after searching for 20-25 files individually, it got too tedious, and I gave up on it for the evening. I finished copying all the necessary classes to my directory this morning and it finally loaded the applet, however, now it's just complaining that it can't find the xml file. I've played with it a bit and changed where the file is located (even gave it the absolute path to the file), but no luck so far.

That thought about being admin/root occurred to me last night when I first started working on it last night, but for some reason I didn't follow it up. ... Except a quick test run on another computer as admin doesn't work either...

It's always the irritating little things like this that the most frustrating since you know it should be something simple, then when you do find it, you just want to bang your head on the desk...

Here's a zip of my directory: http://www.ssuds.info/last.zip
The only two files in the original project are: ch19_03.xml and ch19_09.html (and those are the two that worked on the one laptop)
I also have all the class files (XMLDSO.class, etc) in their respective place relative to the working directory. Since this was just the last little "project" the prof had us do (no grade for it or anything, just something to do), I don't mind posting it here for help. So you don't have to worry about thinking that I'm asking someone here to do my homework

Thanks again bit for the ideas/help,
LF

BTW, if anyone here bothers to take the time to dl that zip (84k) and it works as is, I'd appreciate hearing about it (or if you change something to make it work, I'd be very interested in what you did). Meanwhile, I have other projects to work on right now (that are actually going to be graded). ... ::sigh:: Only another week and a half...

« BackwardsOnwards »

Show Forum Drop Down Menu