简体   繁体   中英

How to run a Java applet in Apache Wicket 6.5?

I am trying to run an applet in a web application using Apache Wicket. I put MyApplet.jar and the html page in the same directory but I got this error when deploying the page:

NullPointerException : An error occurred while running the application

Any help please ?? How can I track down to the point where the error happens, or what else can I try?

Thanks in advance.

My HTML page is

<html xmlns:wicket="http://wicket.apache.org/">


<body>
<wicket:extend>  

  <div class="intro-lead-in">Signing your Documents</div>  

        <applet code=wct.applet.Welcome.class
            archive="MyApplet3.jar"

            codebase="http://localhost:8080/wicketspringdemo"
            width=550 height=300>
        </applet>

</wicket:extend>



</body>

I have some experience serving applets from Wicket. It can get nasty, because there are many things that need to be setup correctly.

To tackle this kind of problem:

  1. Read and try to understand the stacktrace
  2. Check if the applet works in a applet-viewer (without embedding in HTML)
  3. Check if it works in a static HTML page to make sure it is a Wicket-related problem, not a java-applet-specific problem
  4. If it works in a static page, you can also save the page generated by Wicket and try if that works.
  5. Check if your java-applet-security settings allow running the applet (java-plugin console)

EDIT

This is my code (wicket 1.2, but should be upgradable)

<applet wicket:id="applet" codebase="applet"
    code="nl.valuecare.PasteApplet" width="20" height="20"
    archive="pasteappletsigned.jar" mayscript="mayscript"> </applet>

Where codebase is relativa path in the WAR

The mayscript is to allow java <> javascript communication.

I signed the Applet with a valid Code Signing Certificat because I need elevated permissions.

Maybe it is not allowed to use a absolute codebase?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM