guy_without_a_name
guy_without_a_name

Reputation: 155

HTML embed not working for Java Applet

I've been researching on which to use between <applet>,<object>, or <embed>, but none seem to work.

When I tried to load JApplet through HTML I am got RuntimeException error java.lang.NoClassDefFoundError: com/sforce/ws/ConnectionException.

When I tried to run number1.class with the number1.class being in myfile.jar it needs the other 3 jar files for the library and that is what the error is. The files look like this:

tomcat-->webapps-->applet-->newhtml.html
applet-->lib-->(wsc-23,enterprise,partner)
applet-->applet_class-->(number1.class,myfile.jar)

Any help would be appreciated. I've also looked through majority of stackoverflow questions as well as other places, but still no luck!

<!DOCTYPE html>
<html>
   <body>
      <html type="application/x-java-applet;version=1.6"
         width="512" height="512"
         code="applet_class.number1.class"
         src="myfile.jar,applet/lib/wsc-23.jar,
         applet/lib/enterprise.jar,
         applet/lib/partner.jar"/></html>
   </body>
</html>

Upvotes: 0

Views: 265

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

The best way to deploy a JWS app. or applet is to use the Deployment Toolkit Script.

But looking at that element..

  <html type="application/x-java-applet;version=1.6"
     width="512" height="512"
     code="applet_class.number1.class"
     src="myfile.jar,applet/lib/wsc-23.jar,
     applet/lib/enterprise.jar,
     applet/lib/partner.jar"/></html>

The most basic form of the applet element (deprecated in HTML 4.01 is):

  <applet 
     width="512" height="512"
     code="applet_class.number1"
     archive="myfile.jar,applet/lib/wsc-23.jar,applet/lib/enterprise.jar,applet/lib/partner.jar"/>
 </applet>
  • Change html to applet.
  • Remove the type attribute.
  • Remove the .class from the end of the code attribute.
  • Change src to archive, and have all the archives in one line.

Upvotes: 1

Related Questions