World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 01-23-2009, 12:20 AM   #1
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Arrow WWJ Applet Recommended Setup and Guidelines

We just updated the WWJ applet package for the new java plugin support available since Java 6_10 which improved robustness solves a number of issues. Please find the updated applet package documentation here.

The following code samples allow you to use the new Java plugin whenever it is available on the client browser and to fall back on the JNLPAppletLauncher otherwise.

HTML applet declaration for backward compatibility with 'old' plugin using the JNLPAppletLauncher:
Code:
 <applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
      width=600
      height=400
      archive="http://download.java.net/media/applet-launcher/applet-launcher.jar,
               http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,
               http://download.java.net/media/gluegen/webstart/gluegen-rt.jar,
               http://my.web.server.com/WWJApplet/worldwind.jar">
               http://my.web.server.com/WWJApplet/myapplet.jar">
   <param name="jnlp_href" value="WWJApplet.jnlp"> <!-- Picked up by new plugin -->
   <param name="codebase_lookup" value="false">
   <param name="subapplet.classname" value="gov.nasa.worldwind.examples.applet.WWJApplet">
   <param name="subapplet.displayname" value="World Wind Applet">
   <param name="noddraw.check" value="true">
   <param name="progressbar" value="true">
   <param name="jnlpNumExtensions" value="1">
   <param name="jnlpExtension1"
          value="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp">
 </applet>
The corresponding WWJApplet.jnlp file:
Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
       <jnlp href="WWJApplet.jnlp">
        <information>
            <title>World Wind Java Applet Demo</title>
            <vendor>NASA</vendor>
            <homepage href="http://worldwind.arc.nasa.gov"/>
            <description>World Wind Java Applet Demo</description>
            <description kind="short">World Wind Java Applet Demo</description>
            <offline-allowed/>
        </information>
        <security>
            <all-permissions/>
        </security>
         <resources os="Windows">
           <property name="sun.java2d.noddraw" value="true"/>
         </resources>
         <resources>
            <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+" initial-heap-size="512m"
                  max-heap-size="512m"/>
            <property name="sun.java2d.noddraw" value="true"/>
            <jar href="WWJApplet.jar" main="true"/>
            <jar href="worldwind.jar"/>
            <extension name="jogl"
                       href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp"/>
         </resources>
         <!-- Width and heigth are overwritten by the surrounding web page -->
         <applet-desc
             name="WWJ Applet"
             main-class="gov.nasa.worldwind.examples.applet.WWJApplet"
             width="800" height="600">
            <param name="separate_jvm" value="true" />
         </applet-desc>
       </jnlp>
The Next Generation Plugin allows considerable flexibility in defining the applet context. For instance, a minimal JRE version can be specified along with initial heap memory size (Java 5 and 512M in the above example). A parameter can also direct the plugin to use a different JVM for each applet instance (param separate_jvm above). World Wind applets should always set this parameter and set its value to true.

As of January 2009 the Next Generation Plugin works with Internet Explorer 6 and 7 on Windows XP or Vista, Firefox 3 on Windows, Solaris and Linux. You can read the new plugin release notes at Release Notes for the Next Generation Java Plug-In Technology.

When using javascript to java communication it is recommended to use the following javascript code to access the applet:

Code:
    var theApplet = null;

    function getWWJApplet()
    {
       if (theApplet == null) {
          theApplet = document.getElementById('wwjApplet');
       }
       // See if we're using the old Java Plug-In and the JNLPAppletLauncher
       try {
          theApplet = theApplet.getSubApplet();
       } catch (e) {
          // Using new-style applet -- ignore
       }
    return theApplet;
    }

    // Call someAppletMethod() via the getWWJApplet() method

    getWWJApplet().someAppletMethod();
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 12-01-2009, 05:55 PM   #2
lisamarietuck
Junior Member
 
Join Date: Dec 2009
Posts: 2
lisamarietuck is on a distinguished road
Default

As a Newbie, I am always searching online for stuff that can help me. Thank you for your help.
__________________
LMT
lisamarietuck is offline   Reply With Quote
Old 06-08-2011, 01:54 PM   #3
factor3
Guest
 
Posts: n/a
Default A small problem with signing

Greetings:

I have tried several Applet examples and keep getting this persistent problem, even with the next generation launcher:

The examples fail to run due to signing problems!

Either I get failures due to "different jar files in the JNLP being signed with different certs", or in some cases the DLLs have signatures that can't be verified.

Could someone put in a description of how these problems can be resolved??? Thank you.
  Reply With Quote
Old 06-14-2011, 02:14 PM   #4
hicks
Junior Member
 
hicks's Avatar
 
Join Date: Mar 2011
Location: UK
Posts: 27
hicks is on a distinguished road
Default

Quote:
Originally Posted by factor3 View Post
Greetings:

I have tried several Applet examples and keep getting this persistent problem, even with the next generation launcher:

The examples fail to run due to signing problems!

Either I get failures due to "different jar files in the JNLP being signed with different certs", or in some cases the DLLs have signatures that can't be verified.

Could someone put in a description of how these problems can be resolved??? Thank you.
this page has some useful information on using applets.
The important thing to note is that all jars used by the applet must be signed with the same certificate, as indicated in the error message.
hicks is offline   Reply With Quote
Old 06-15-2011, 04:06 AM   #5
Enzian
Junior Member
 
Join Date: Jun 2011
Posts: 1
Enzian is on a distinguished road
Default

Helpful applet info - thank you Patmurris.
Enzian is offline   Reply With Quote
Old 08-22-2011, 10:18 AM   #6
vrnew
Junior Member
 
Join Date: Dec 2009
Posts: 23
vrnew is on a distinguished road
Default

How can I deploy the worldwind.xml and worldwind.layers.xml out of worldwind.jar.
vrnew is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:16 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.