Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

xml class not found on applet l

I have a jsp page with an embedded java applet

one client has jdk installed at it works great

another client doesnt have it installed, I run the applet and it says no class def found for xmlparser.

My old instructor told me I need to apply a patch to download the current jre so it will run. How do I do this or this the wrong answer?

thanks,
nick
0
nick5454
Asked:
nick5454
  • 13
  • 11
  • 5
1 Solution
 
kennethxuCommented:
you need object and/or embed tags, and holp this link helps you to understand how:
http://java.sun.com/j2se/1.4/docs/guide/plugin/developer_guide/using_tags.html
0
 
kennethxuCommented:
for quick start, try out something like this:
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="200" height="200" align="baseline"
    codebase="http://java.sun.com/products/plugin/1.4/jinstall-14-win32.cab#Version=1,4,0,mn">
<PARAM NAME="code" VALUE="XYZApp.class">
<PARAM NAME="codebase" VALUE="html/">
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
<PARAM NAME="scriptable" VALUE="true">
<COMMENT>
    <EMBED type="application/x-java-applet;jpi-version=1.4" width="200"
       height="200" align="baseline" code="XYZApp.class"
       codebase="html/" model="models/HyaluronicAcid.xyz"
       pluginspage="http://java.sun.com/products/plugin/1.4/plugin-install.html">
    <NOEMBED>
    </COMMENT>
           No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
    </NOEMBED></EMBED>
</OBJECT>
0
 
nick5454Author Commented:
the error is ParserConfigurationException what does that mean?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
nick5454Author Commented:
what does model mean?
0
 
kennethxuCommented:
>>the error is ParserConfigurationException what does that mean?
can you post the code and error stacktrace? it means a parser cannot be created which satisfies the requested configuration.


have you tried to use object/embed tag to use plug-in?
0
 
nick5454Author Commented:
what does model mean.

my class name is spiritGrid and the jar file is spiritGraph.jar

nick
0
 
kennethxuCommented:
that's just a parameter you pass to your applet. you can ignore it, it's same as:
<APPLET code="XYZApp.class" codebase="html/" align="baseline"
    width="200" height="200">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
    No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
</APPLET>
0
 
nick5454Author Commented:
I'm still confused.

the center of the applet says NoClassDefFound javax/xml/parser/ParserConfigurationException

what does that mean

its only on non java clients. and its not outputting stack trace to the console

0
 
nick5454Author Commented:
okay lets step back a second.

1) the no class def found means the xml class isnt included but the answer to that is probably the jre isnt updated i guess. and no I dont get a stack trace on the client. if you know of a way to send it back top the server that would be nice

2) The real problem.

I dont understand this code you gave me

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
   width="200" height="200" align="baseline"
   codebase="http://java.sun.com/products/plugin/1.4/jinstall-14-win32.cab#Version=1,4,0,mn">

--> okay so what is the classid for an object or the downlodable update?

<PARAM NAME="code" VALUE="myApplet.class">
<PARAM NAME="codebase" VALUE="html/">
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4">

<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
--> and what in the heck is this parameter?

<PARAM NAME="scriptable" VALUE="true">
--> and what does scriptable mean?

--> and what does this comment do and what reasons is it triggered?
<COMMENT>
   <EMBED type="application/x-java-applet;jpi-version=1.4" width="200"
      height="200" align="baseline" code="XYZApp.class"
      codebase="html/" model="models/HyaluronicAcid.xyz"
      pluginspage="http://java.sun.com/products/plugin/1.4/plugin-install.html">
   <NOEMBED>
   </COMMENT>
          No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
   </NOEMBED></EMBED>
</OBJECT>

-->why is it duplicated?

I dont get it. I need this help and I still can bring up my applet. I have to know how before I walk into work tomorrow to keep my client happy and finish.

thanks,
nick
0
 
nick5454Author Commented:
lets suppose my applet is in the same folder and its called myApplet.class and transform it being simple, later on once I understand the basics I can study and add to it but simplicity is key for understanding

0
 
objectsCommented:
The <applet> tag will run the MS VM unless the plugin (>1.3 I think) has been installed *and* it is set to be the default VM used by the browser (this can be set using either the plugin control panel, or Tools>Internat Options>Advanced in IE).

The MS VM only supports Java 1.1, which does not include the XML classes that you are using so it will throw a no class def error trying to run your code.

If the plugin is installed, but it isn't set as the default VM then you can still force it use the plugin instead of the MS VM by using the <object> tag in IE, or the <embed> tag in NS.

The JDK comes with a htmlconverter which can convert your html to use the <object> and/or <embed> tag instead of the <applet> tag.
In your case the html will look something like the following (though I'd suggest you use htmlconverter):

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
  width="200" height="200" align="baseline"
  codebase="http://java.sun.com/products/plugin/1.4/jinstall-14-win32.cab#Version=1,4,0,mn">
<PARAM NAME="code" VALUE="spiritGrid.class">
<PARAM NAME="archive" VALUE="spiritGraph.jar">
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4">
<COMMENT>
  <EMBED type="application/x-java-applet;jpi-version=1.4" width="200"
     height="200" align="baseline" code="spiritGrid.class"
     archive="spiritGraph.jar"
    pluginspage="http://java.sun.com/products/plugin/1.4/plugin-install.html">
  <NOEMBED>
  </COMMENT>
         No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
  </NOEMBED></EMBED>
</OBJECT>


The reason it seems to appear twice is simply to support both IE and NS. IE uses <object> tag, while NS use <embed> tag. The <comment> tag is used to tell IE to ignore the <embed> tag.

0
 
kennethxuCommented:
did you have the chance read the tutorial?
most of you question is answered in the tutorial, and I have answered your model question in my previous post.

the scriptable is about if you want you applet talk to javascript.
0
 
kennethxuCommented:
let me know if you have further enquires after you read the tutorial.
0
 
kennethxuCommented:
basically, what object said is correct. the tutorial link I provided you in my first post includes all what object said plus more details, I would suggest you to read it through, it is rather short and helpful.
0
 
objectsCommented:
The XML API's were only added in 1.4 (from memory), so you'll need to ensure the vm being used is 1.4 or later.
0
 
kennethxuCommented:
>> The XML API's were only added in 1.4 (from memory), so you'll need to ensure the vm being used is 1.4 or later.
I think the classid+codebase for IE and type+pluginspage for NS should have ensured that, correct me if I'm wrong.
0
 
objectsCommented:
> I think the classid+codebase for IE and type+pluginspage
> for NS should have ensured that

No the classid specified above would load any plugin version. There is no way to specify a minimum vm version directly using the object tag, only a specific version or any version.

0
 
kennethxuCommented:
than what is this means:
PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4">
0
 
nick5454Author Commented:
so is model an object specific or my user defined class specific?
0
 
kennethxuCommented:
yes, the classid is the same since 1.2. but the codebase and type does any help or not at all?
0
 
kennethxuCommented:
>> so is model an object specific or my user defined class specific?
that's applet specific parameter, model is just an example, you can pass any parameter to you applet or none.
0
 
nick5454Author Commented:
sorry I'm just trying to make sense of it all
0
 
objectsCommented:
> but the codebase and type does any help or not at all?

no, they have nothing to do with what vm is run.

> so is model an object specific or my user defined class specific?

model is irrelevant to you. See the tag I posted above which just contains the relevant parts.


0
 
nick5454Author Commented:
Ok so heres another moronic ? I downloaded the 1.2 plugin, inorder to get the convert html program I have to install it but that will override my 1.4.1. Is this correct and I downloaded the wrong version?

thanks
nick
0
 
kennethxuCommented:
nick, I would again suggest that you read the tutorial to avoid unnecessary effort. in the very beginning of the tutorial, there is a link to HTML Converter.

The fact is the converter is already come with jdk1.4:
C:\sdk1.4\lib>..\bin\java -jar htmlconverter.jar -gui

0
 
objectsCommented:
> I downloaded the 1.2 plugin, inorder to get the convert html program

It is not a part of 1.2.
It is however included with 1.4.

<jdk>/bin/HtmlConverter.exe
0
 
nick5454Author Commented:
One thing if there is a link to the exe I missed it completelyu cause I tried everyone

But I had it on my system. was looking ofr .java but it was an EXE imagine that

I'm gonna test it real fast then shovel the points out
0
 
nick5454Author Commented:
>> that's applet specific parameter, model is just an example, you can pass any parameter to you applet or none

this would have been so much easier for me to grasp if you said its user defined specific. Applet specific is interpreted as a method of the applet class, not a property defined by the user in side the applet class. Thats what threw me off.

But I appreciate the help a lot. After using htmlconverter it was simple and no more errors. Unemployment comes back again tomorrow since I have the entire web site finished

PS. there isnt a link inside the tutorial

Objects --> for your gracious help I put up a question for you.
0
 
kennethxuCommented:
sorry for misunderstanding, I meant per applet specific.

>> PS. there isnt a link inside the tutorial
there are 2 links to the converter in the tutorial :)
1. open the tutorial, you'll see a dropdown box right after the title. there two choices about HTML Converter. Chapter 4 and Appendix 3.
2. open the tutorial, right below the Introduction (1st section), there is a Note in bold font, says "There is a Java Plug-in HTML Converter", it is a link.

once you get into "More About HTML Converter", the first section is "Running the GUI version of the HTML Converter" and you'll see the command that I posted earlier.

Thanks for the points.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 13
  • 11
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now