Search code examples
javaappletzk

java.lang.NoClassDefFoundError in applet class using ZK


I got a problem that is taking me days!

I have a applet class that import classes in a external JAR.

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamPanel;
import com.github.sarxos.webcam.WebcamResolution;

public class AppletTela extends JApplet 
{
    private static final long serialVersionUID = 3517366452510566924L;

    private Dimension size = WebcamResolution.QVGA.getSize();
    private Webcam webcam = null;
    private WebcamPanel panel = null;

I export my applet project for a .Jar file, and try to use it in a web project. So in my .Zul file, I put the following coding

<applet code="AppletTela" codebase="."  archive="teste.jar" codemsg="ZK is Simple and Rich!" id="ticker"
            width="400px" style="border: 1px" />

and my teste.jar is under my WebContent folder. And Im getting the java.lang.NoClassDefFoundError for the WebcamPanel.

Help me guys.!


Solution

  • You should add jar with Webcam classes to your applet tag. This your looks like this:

    <applet archive="teste.jar,webcamjar.jar" ... />