Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Classnotfound exception when loading applet with object tag in java 1.7

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running into class not found exception on IE and have the jars signed with Trusted-Library attribute. We have java 1.7 installed and following is my object tag.

var objectHtml = '<OBJECT  ID ="TestAppletS" classid="clsid:CAFEEFAC-0017-0000-FFFF-ABCDEFFEDCBA"' +
  ' width="1" height="1" align="baseline" codebase="http://java.sun.com/update/1.7_64/jinstall-7u51-windows-i586.cab#Version=1,7,0,0"; Permissions="all-permissions">' +
  ' <PARAM name="code" value="com.test.rec.applet.PrintApplet.class">' +
  ' <PARAM name="codebase" value="<%= request.getContextPath() + "/rec/jsp/html/" %>">' +
  ' <PARAM name="type" value="application/x-java-applet;version=1.7">' +
  ' <PARAM id="arcid" name="archive" value="TestApplet.jar, test_doc.jar">' +
  ' <PARAM name="scriptable" value="true">'

'</OBJECT>';

What could be wrong?
 
Master Rancher
Posts: 3876
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 class not found exception


Can you copy the full contents of the error message and paste it here.  It should show the name of the class that was not found.

Note: A class name does not end with .class.  Filenames end with .class
 
Rads Test
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.ClassNotFoundException: com.test.rec.applet.PrintApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Ignored exception: java.lang.ClassNotFoundException: com.test.rec.applet.PrintApplet.class
 
Norm Radder
Master Rancher
Posts: 3876
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

java.lang.ClassNotFoundException: com.test.rec.applet.PrintApplet.class


Did you see the Note at the end of my last post?

Try a giving a class name without the ending .class

Are you sure the .class file is in the correct location for the JVM to be able to find it?
 
Rads Test
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes tried without having .class initially. this was just a try. Yes, the class is signed and the jar is posted in the same folder as jsp.

Never ran into issues with previous versions of java.
 
Norm Radder
Master Rancher
Posts: 3876
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried it with an <APPLET tag?
 
Rads Test
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. But I believe object tag is preferred over applet tag and applet tag was deprecated at some point of time in html4.
 
Norm Radder
Master Rancher
Posts: 3876
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The object of the test with applet tag and appletviewer is to make sure the paths are good and that the JVM can find the class.
 
Rads Test
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will try and get back. sure.
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic