title: ClassNotFoundException in Java Applet using <object> tag
body: <p>I'm trying to embed a Java Applet using the &lt;OBJECT&gt; tag, which is the XHTML Strict way of doing it.</p>
  <p>After browsing lots of sites, I tried <a href="http://ww2.cs.fsu.edu/%7Esteele/XHTML/appletObject.html" rel="nofollow noreferrer">this example</a> which seems to work pretty well:</p>
  <pre><code>&lt;!--[if !IE]&gt; Firefox and others will use outer object --&gt;
    &lt;object classid=&quot;java:Sample2.class&quot; 
            type=&quot;application/x-java-applet&quot;
            archive=&quot;Sample2.jar&quot; 
            height=&quot;300&quot; width=&quot;450&quot; &gt;
      &lt;!-- Konqueror browser needs the following param --&gt;
      &lt;param name=&quot;archive&quot; value=&quot;Sample2.jar&quot; /&gt;
    &lt;!--&lt;![endif]--&gt;
      &lt;!-- MSIE (Microsoft Internet Explorer) will use inner object --&gt; 
      &lt;object classid=&quot;clsid:8AD9C840-044E-11D1-B3E9-00805F499D93&quot; 
              codebase=&quot;http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab&quot;
              height=&quot;300&quot; width=&quot;450&quot; &gt; 
        &lt;param name=&quot;code&quot; value=&quot;Sample2&quot; /&gt;
        &lt;param name=&quot;archive&quot; value=&quot;Sample2.jar&quot; /&gt;
        &lt;strong&gt;
          This browser does not have a Java Plug-in.
          &lt;br /&gt;
          &lt;a href=&quot;http://java.sun.com/products/plugin/downloads/index.html&quot;&gt;
            Get the latest Java Plug-in here.
          &lt;/a&gt;
        &lt;/strong&gt;
      &lt;/object&gt; 
    &lt;!--[if !IE]&gt; close outer object --&gt;
    &lt;/object&gt;
    &lt;!--&lt;![endif]--&gt;
  </code></pre>
  <p>I downloaded that Sample2.jar and works perfectly on localhost.</p>
  <p>Now, I replaced Sample2.class for the one I need to use (ar.uba.exactas.infovis.ivides.Scatterplot.class) and using my own JAR files (archive=&quot;piccolo.jar piccolox.jar netscape.jar scatterplot.jar&quot;):</p>
  <pre><code>&lt;!--[if !IE]&gt; Firefox and others will use outer object --&gt;
  &lt;object
      classid=&quot;java:ar.uba.exactas.infovis.ivides.Scatterplot.class&quot;
      type=&quot;application/x-java-applet&quot;
      archive=&quot;piccolo.jar piccolox.jar netscape.jar scatterplot.jar&quot;
      height=&quot;300&quot; width=&quot;450&quot; &gt;
      &lt;!-- Konqueror browser needs the following param --&gt;
      &lt;param name=&quot;archive&quot; value=&quot;piccolo.jar piccolox.jar netscape.jar scatterplot.jar&quot; /&gt;
  &lt;!--&lt;![endif]--&gt;
      &lt;!-- MSIE (Microsoft Internet Explorer) will use inner object --&gt;
      &lt;object classid=&quot;clsid:8AD9C840-044E-11D1-B3E9-00805F499D93&quot;
                      codebase=&quot;http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab&quot;
                      height=&quot;300&quot; width=&quot;450&quot; &gt;
          &lt;param name=&quot;code&quot; value=&quot;ar.uba.exactas.infovis.ivides.Scatterplot&quot; /&gt;
          &lt;param name=&quot;archive&quot; value=&quot;piccolo.jar piccolox.jar netscape.jar scatterplot.jar&quot; /&gt;
          &lt;strong&gt;
              This browser does not have a Java Plug-in.
              &lt;br /&gt;
              &lt;a href=&quot;http://java.sun.com/products/plugin/downloads/index.html&quot;&gt;
                  Get the latest Java Plug-in here.
              &lt;/a&gt;
          &lt;/strong&gt;
      &lt;/object&gt;
  &lt;!--[if !IE]&gt; close outer object --&gt;
  &lt;/object&gt;
  &lt;!--&lt;![endif]--&gt;
  </code></pre>
  <p>After doing so, I'm gettin this log dump:</p>
  <pre><code>java.lang.ClassNotFoundException: ar.uba.exactas.infovis.ivides.Scatterplot.class
      at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
      at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
      at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.io.IOException: open HTTP connection failed:http://localhost/infovisUBA/2008-2C/tpfinal/bin/ar/uba/exactas/infovis/ivides/Scatterplot/class.class
      at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
      at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
      at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      ... 7 more
  Excepción: java.lang.ClassNotFoundException: ar.uba.exactas.infovis.ivides.Scatterplot.class
  </code></pre>
  <p>The only difference I see is that I'm using a class inside a package.</p>
  <p>Also, please note I did make this work using the &lt;APPLET&gt; tag, but I cannot make it with &lt;OBJECT&gt;.</p>
  <p>Any clue?</p>