7 Replies Latest reply: Feb 28, 2014 4:36 PM by Ricardo Av-Oracle RSS

    JVue applet integration/extension

    Docia

      I'm trying to communicate with the AutoVue applet in a browser.

       

      My initial efforts were based on the suggestions in http://docs.oracle.com/cd/E29155_02/otn/pdf/E29158_01.pdf. This document suggests writing a second applet and use getAppletContext().getApplet(”Jvue”) to access the Jvue applet.

      But in this document http://docs.oracle.com/javase/tutorial/deployment/applet/iac.html it is stated that getApplet should NOT be used for communication between applets. Probably because the security around applets has been tightened lately.

       

      Next attempt is to have only a single applet. To keep the existing look and functionality of AutoVue, I extend JVue and implement my own methods that can access the VueControllers and be called from javascript.

      The problem right now is to get this applet to launch.

      I have tried to use the APPLET tag in html, but couldn't get the loading of the extra jars to work.

       

      Now I'm trying to launch the applet with jnlp, but no matter what I do I get a SecurityException:

      java.lang.SecurityException: JAR manifest requested to run in all-permissons only: http://localhost/plugin/autovue/cfmAvue.jar

          at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)

          at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)

          at com.sun.deploy.security.SandboxSecurity.isPermissionGranted(Unknown Source)

          at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)

          at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)

          at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)

          at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)

          at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

       

       

      In my manifest for the applet jar I have tried "Permissions: Sandbox", "Permissions: All-permissions" and omitting the Permissions.

       

      In my jnlp I have tried  <security><all-permissions/></security> and omitting the security.

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jnlp spec="1.0+" >

          <information>

              <title>CoreFM AutoVue Applet</title>

              <vendor>Byggeweb/Docia</vendor>

              <homepage href="www.docia.com"></homepage>

          </information>

          <resources>

              <!-- Application Resources -->

              <j2se version="1.7+"

                  href="http://java.sun.com/products/autodl/j2se" />

              <jar href="cfmAvue.jar" main="true" />

              <jar href="jvue.jar"></jar>

              <jar href="jogl.jar"></jar>

              <jar href="gluegen-rt.jar"></jar>

          </resources>

          <applet-desc

               name="CoreFM AutoVue Applet"

               main-class="com.docia.cfm.autovue.CFM_Avue_Applet.class"

               width="1"

               height="1">

           </applet-desc>

           <update check="background"/>

      </jnlp>        

       

       

      In html I have tried "permissions: 'sandbox'", "permissions: 'all-permissions'" and omitting it.

      <script src="https://www.java.com/js/deployJava.js"></script>

      <script>

        var attributes = { code:'com.docia.cfm.autovue.CFM_Avue_Applet',  width:'100%',  height:'100%'} ;

        var parameters = {jnlp_href: '/plugin/autovue/cfmAvue.jnlp',

                          permissions: 'sandbox',

                          EMBEDDED: 'true',

                          VERBOSE: 'false',

                          ONINIT: 'onAppletInit();',

                          LOCALE: 'EN',

                          JVUESERVER: '<%= Configuration.getValue( "AUTOVUE_SERVLET_SERVER")%>'} ;

        deployJava.runApplet(attributes, parameters, '1.7');

      </script>               

       

       

      Can anyone tell me what combination will work?

      Preferably the solution should work for java 6 and all versions of java 7.

       

      Thanks

      Michael Bjerregaard-Pedersen

        • 1. Re: JVue applet integration/extension
          George AV

          When you tried to load the single applet in the APPLET HTML tag, what error did you get?

          Try to resign all JARs with the same certificate.

           

          What exactly are you trying to implement?

           

          Thanks,

           

          George

          • 2. Re: JVue applet integration/extension
            Docia

            What I'm trying to implement is just to be able to paint a polygon or highlight an IfcSpace in a drawing shown in AutoVue.

            As I don't much like the idea of implementing the bulk of the necessary code for this in javascript, I'm looking for a way to implement it in java and just use javascript to call highlevel functions from the webpage.

             

            When I use this applet tag:

            <APPLET

                NAME="JVue"

                CODE="com.docia.cfm.autovue.CFM_Avue_Applet"

                CODEBASE="//<%= Configuration.getValue("HostUrl")%>/plugin/autovue"

                ARCHIVE="cfmAvue.jar, jvue.jar,jogl.jar,gluegen-rt.jar"

                HSPACE="0" VSPACE="0"

                WIDTH="100%" HEIGHT="100%"

                MAYSCRIPT="on"

            >

            <PARAM NAME="EMBEDDED" VALUE="true">

            <PARAM NAME="VERBOSE" VALUE="false">

            <PARAM NAME="ONINIT" VALUE="onAppletInit();">

            <PARAM NAME="LOCALE" VALUE="EN">

            <PARAM NAME="JVUESERVER" VALUE="<%= Configuration.getValue( "AUTOVUE_SERVLET_SERVER")%>">

            <p><b>Requires a browser that supports Java.</b></p>

            </APPLET>

             

             

            to launch my applet that is basically just this:

            public class CFM_Avue_Applet extends JVue {

                public void init()

                {

                    super.init();

                }

             

                public void start()

                {

                    super.start();

                }

            }   

             

             

            Compiled with this manifest:

            Application-Name: CoreFM AutoVue Applet

            Manifest-Version: 1.0

            Permissions: all-permissions

            Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int corefm.dk byggeweb.dk docia.com

            Caller-Allowable-Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int corefm.dk byggeweb.dk docia.com

            Application-Library-Allowable-Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int corefm.dk byggeweb.dk docia.com

            Extension-List: jvue jogl gluegen-rt

            jvue-Extension-Name: com.cimmetry.jvue.JVue

            jvue-Specification-Version: 1.1

            jvue-Implementation-Version: 1

            jvue-Implementation-Vendor-Id: com.cimmetry

            jvue-Implementation-URL: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            jvue-Application-Name: JVue

            jvue-Permissions: all-permissions

            jvue-Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int corefm.dk byggeweb.dk docia.com

            jogl-Extension-Name: com.cimmetry.jvue.jogl

            jogl-Specification-Version: 1.1

            jogl-Implementation-Version: 1

            jogl-Implementation-Vendor-Id: com.cimmetry

            jogl-Implementation-URL: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            jogl-Application-Name: jogl

            jogl-Permissions: all-permissions

            jogl-Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int corefm.dk byggeweb.dk docia.com

            gluegen-rt-Extension-Name: com.cimmetry.jvue.gluegen-rt

            gluegen-rt-Specification-Version: 1.1

            gluegen-rt-Implementation-Version: 1

            gluegen-rt-Implementation-Vendor-Id: com.cimmetry

            gluegen-rt-Implementation-URL: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            gluegen-rt-Application-Name: gluegen-rt

            gluegen-rt-Permissions: all-permissions

            gluegen-rt-Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int corefm.dk byggeweb.dk docia.com

             

             

            I first get a warning that an applet will be running, which is OK.

            Then I get a message that the applet will load jvue.jar, which is annoying and will confuse all users. (as far as I can tell JNLP should solve this, but AutoVue is apparently not compatible with JNLP, says Oracle)

            After that I get this in the java console:

             

            Missing Application-Name: manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Permissions manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Codebase manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Application-Name: manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Permissions manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Codebase manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Application-Name: manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Permissions manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Codebase manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Application-Name: manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Permissions manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Codebase manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

            Missing Application-Name: manifest attribute for: http://www.byggeweb.dk/plugin/autovue/jvue.jar

             

            Something is looping.

             

            Thanks

            Michael

            • 3. Re: JVue applet integration/extension
              Ricardo Av-Oracle

              The sample is only feasible in JRE6u10 and lower version.

              Not feasible since then, simply because different applets run on different JVM

               

              Then About your deployment comments

              1. AutoVue is compatible with JNLP, your JNLP is not properly built, if there is a complaint

              2. There is no code base for the JNLP, so you should start by reviewing that part (either add it or use it from the html file)

              3. The manifest is definitively wrong, all entries point to jvue.jar (when resolving different jar like jogl and gluegen), so your problem is there and probably your endless loop too.

              • 4. Re: JVue applet integration/extension
                Docia

                Thanks.

                 

                Reducing the manifest to this and using Applet tag to load it has solved my immediate problem, at least on 7u51:

                Application-Name: CoreFM AutoVue Applet

                Manifest-Version: 1.0

                Permissions: all-permissions

                Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int *.corefm.dk *.byggeweb.dk *.docia.com

                Caller-Allowable-Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int *.corefm.dk *.byggeweb.dk *.docia.com

                Application-Library-Allowable-Codebase: executor.interlogic.com.ua testserver.corefm.dk mbp.corefm.int *.corefm.dk *.byggeweb.dk *.docia.com

                • 5. Re: JVue applet integration/extension
                  Ricardo Av-Oracle

                  In case you wish to use a JNLP, I would recommend you follow all the steps in the documentation and that you have a properly defined manifest

                  For reference documentation is available at

                  http://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html

                  You are essentially missing step 6 onwards

                  • 6. Re: JVue applet integration/extension
                    Docia

                    Give me some credit.

                    Step 6 says "Create the HTML page". You can't seriously think I haven't created the html . My OP even contains "deployJava.runApplet".

                     

                    As I wrote earlier: I have created an applet based on JVue and I can launch it using the applet tag.

                    JNLP is not necessary, just desirable. I can live with the applet tag for now.