1 2 3 4 Previous Next 45 Replies Latest reply: Dec 6, 2009 4:19 AM by 791266 Go to original post RSS
      • 30. Re: How to create a java plugin for Internet explorer
        843802
        I found a solution that get the applet started without any error but it doesn't seem to be doing anything -- just sits there and since I am not familiar with your code, I will turn it over to you and explain what and how I did it.

        1) here is my test html file

        <!--"CONVERTED_APPLET"-->
        <!-- HTML CONVERTER -->
        <OBJECT classid="clsid:CAFEEFAC-0013-0001-0000-ABCDEFFEDCBA"
        WIDTH = 202 HEIGHT = 177 codebase="http://java.sun.com/products/plugin/1.3.1/jinstall-131-win32.cab#Version=1,3,1,0">
        <PARAM NAME = CODE VALUE = "Vrml2" >
        <PARAM NAME = CODEBASE VALUE = "." >
        <PARAM NAME = ARCHIVE VALUE = "Vrml2.jar,Vrml97.jar" >

        <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.1">
        <PARAM NAME="scriptable" VALUE="false">
        <COMMENT>
        <EMBED type="application/x-java-applet;jpi-version=1.3.1" CODE = "Vrml2" CODEBASE = "." ARCHIVE = "Vrml2.jar,Vrml97.jar"
        WIDTH = 202 HEIGHT = 177 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3.1/plugin-install.html"><NOEMBED>

        </NOEMBED>
        </EMBED>
        </COMMENT>
        </OBJECT>

        <!--
        <APPLET CODE = "Vrml2" CODEBASE = "." ARCHIVE = "Vrml2.jar,Vrml97.jar" WIDTH = 202 HEIGHT = 177>
        </APPLET>
        -->
        <!--"END_CONVERTED_APPLET"-->


        2) put the Vrml97.jar file that comes with j3d in the same directory on the server as the html file.

        3) compile your Vrml2.java and jar it without having to sign it as follows:

        jar cvf Vrml2.jar Vrml2.class

        4) copy this jar file to the same place as ther others on the server.

        5) on the client's machine, use the policy tool to give your server's URL the following runtime permissions:

        a) modifyThread
        b) modifyThreadGroup
        c) create ClassLoader

        and that should be it (aside from the fact that you may have to do a little debugging of your program).
        Once you get the applet working, you can explore how to further refine the security handling procedures (e.g., you can either supply the client with a copy of a policy file that you have created).


        ;o)


        V.V.
        • 31. Re: How to create a java plugin for Internet explorer
          843802
          BTW, I have just tested the program/html files outside of my PWS or in a standalone mode and it works the same way -- i.e., keep HTML files, Vrml2.jar and Vrml97.jar in the same directory and use the policytool to give the permission for the path.

          After having spent a lot of time on this, I am dying to see what a heck it is that is supposed to be in that little applet window. Maybe I'll add a main method to the program and see if I can run it as an app .

          V.V.
          • 32. Re: How to create a java plugin for Internet explorer
            843802
            Wait a minute, your program already has a main method in there....but it doesn't even work as a standalone program does it? Here is the error message I got when I ran the program:

            C:\My Documents\signed>appletviewer test.htm
            wglMakeCurrent Failed: This function is only valid in Win32 mode.

            wglMakeCurrent Failed: This function is only valid in Win32 mode.


            C:\My Documents\signed>


            Now what was that all about?

            V.V.
            • 33. Re: How to create a java plugin for Internet explorer
              843802
              Sorry that was when I ran it thru the appletviewer (JDK1.3.1) and this is what I got for running it as an app:
              C:\My Documents\signed>java -cp . Vrml2
              java.lang.NoClassDefFoundError: com/sun/j3d/loaders/vrml97/VrmlLoader
                      at Vrml2.createSceneGraph(Vrml2.java:47)
                      at Vrml2.init(Vrml2.java:95)
                      at com.sun.j3d.utils.applet.MainFrame.run(MainFrame.java:297)
                      at java.lang.Thread.run(Unknown Source)

              C:\My Documents\signed>
              Note that vmrl97.jar is in the same directory as Vrml2.class. It's getting late and I've been looking at this thing for too long....I'll let you figure it out!

              V.V.
              • 34. Re: How to create a java plugin for Internet explorer
                843802
                I've moved your applet to my website shown below:

                http://home.attbi.com/~aokabc/test/Test2.htm

                The HTML file is slightly modified and it uses only one jar (unsigned). The following describe the steps involved in creating the new jar file:

                1) create a temp directory
                2) unjar Vrml97.jar and move the two folders (com and vrml) into the temp directory
                3) compile vrml2.java and move the class file to the temp directory
                4) cd to the temp directory
                5) jar cvf Vrml2.jar *
                6) move the Vrml2.jar to the web site along with the following test2.htm fuke:


                <!--"CONVERTED_APPLET"-->
                <!-- HTML CONVERTER -->
                <OBJECT classid="clsid:CAFEEFAC-0013-0001-0000-ABCDEFFEDCBA"
                WIDTH = 202 HEIGHT = 177 codebase="http://java.sun.com/products/plugin/1.3.1/jinstall-131-win32.cab#Version=1,3,1,0">
                <PARAM NAME = CODE VALUE = "Vrml2" >
                <PARAM NAME = CODEBASE VALUE = "." >
                <PARAM NAME = ARCHIVE VALUE = "Vrml2.jar" >

                <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.1">
                <PARAM NAME="scriptable" VALUE="false">
                <COMMENT>
                <EMBED type="application/x-java-applet;jpi-version=1.3.1" CODE = "Vrml2" CODEBASE = "." ARCHIVE = "Vrml2.jar"
                WIDTH = 202 HEIGHT = 177 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3.1/plugin-install.html"><NOEMBED>

                </NOEMBED>
                </EMBED>
                </COMMENT>
                </OBJECT>

                <!--
                <APPLET CODE = "Vrml2" CODEBASE = "." ARCHIVE = "Vrml2.jar" WIDTH = 202 HEIGHT = 177>
                </APPLET>
                -->
                <!--"END_CONVERTED_APPLET"-->

                But like before the applet is started with no error but I dont see anything.

                V.V.
                • 35. Re: How to create a java plugin for Internet explorer
                  843802
                  One more thing:

                  Once you've fully tested your applet, you can cache the Vrml97.jar on the client's machine with the technique described in the article shown at the link below.

                  http://java.sun.com/j2se/1.3/docs/guide/misc/appletcaching.html

                  With the loader being resident on the client's machine, you can probably get around all those permissions non-sense too!

                  V.V.
                  • 36. Re: How to create a java plugin for Internet explorer
                    843802
                    Hi,
                    I did not get it working.It is giving me a null pointer exception when i load this applet in the browser.I did everything wht u mentioned in the list.I guess it is taking too much of your time.Answer this only if you have time.
                    Is there any other way i can load the file using java plugin without using the applets.i.e Loading files in the browser without applets using java plugins.lemme know if u have any idea.

                    Thank you,
                    Deepti.
                    • 37. Re: How to create a java plugin for Internet explorer
                      843802
                      Did you forget the following important step:

                      5) on the client's machine, use the policy tool to give your server's URL the following runtime permissions:

                      a) modifyThread
                      b) modifyThreadGroup
                      c) create ClassLoader

                      If you did you will get a nullpointer exception and if you look at the next line you will see that it failed because of the lack of runtime create Classload permission.
                      Is there any other way i can load the file using java plugin without using the applets
                      Not that I know of.

                      V.V.
                      • 38. Re: How to create a java plugin for Internet explorer
                        843802
                        For purposes of testing the applet at the link shown in reply #34, cut-n-paste the follwoing

                        /* AUTOMATICALLY GENERATED ON Mon Mar 11 18:48:01 CST 2002*/
                        /* DO NOT EDIT */

                        grant {
                        permission java.io.FilePermission "<<ALL FILES>>", "write, read, write, delete, execute";
                        permission java.lang.RuntimePermission "modifyThread";
                        permission java.lang.RuntimePermission "modifyThreadGroup";
                        permission java.lang.RuntimePermission "createClassLoader";
                        };

                        and save it in your default policy file (for me, it's C:\WINDOWS\.java.policy) and see if you can get it to the point where the browser says Applet Started.

                        V.V.
                        • 39. Re: How to create a java plugin for Internet explorer
                          843802
                          Hi its giving me a null pointer exception,when i'm trying to run in the browser,the following is the error displayed in the console.i stored ur code in my c:\winnt\.java.policy but it does not seem to work.

                          caught security exception

                          java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)

                          java.lang.NullPointerException

                               at Vrml2.createSceneGraph(Vrml2.java:76)

                               at Vrml2.init(Vrml2.java:115)

                               at sun.applet.AppletPanel.run(Unknown Source)

                               at java.lang.Thread.run(Unknown Source)
                          ANY SUGGESTIONS
                          • 40. Re: How to create a java plugin for Internet explorer
                            843802
                            Hi:

                            Take a look at the discussions shown at the link below:

                            http://forum.java.sun.com/thread.jsp?forum=37&thread=231662

                            As I told you before I was able to compile and run your program with the .wrl file with no error but all I got was a blank screen altho when I drag the mouse in the applet window, it seemed to be doing something. Apparently the reason I couldn't get it to work fully is because I am using sdk1.3.1 where I should be using sdk1.4.

                            ;o)

                            V.V.
                            • 41. Re: How to create a java plugin for Internet explorer
                              843802
                              BTW, by using the signed applet, you can get rid of the policy file.

                              V.V.
                              • 42. Re: How to create a java plugin for Internet explorer
                                843802
                                I have created a self-signed version of your applet and put it up on my web-site, check it out at:

                                http://home.attbi.com/~aokabc/test/Vrml2.htm

                                The applet expects your input file to be in C:\My Documents\curves.wrl
                                On the HTML document, there are hyperlinks for downloading my self-signed certificate if you want -- you don't need to do that to run the applet, simply grant it the permission to use the classloader and read the input file from local disk (the lack of these permissions is what causes the null pointer exception). There is also a hyperlink to download a zipped file with the source code and the jar file.

                                Because I'm using JDK1.3.1, I don't get to see the picture but when I drag the mouse the applet area I can see my disk drive light flashing indicating that the mouse event handlers are working.

                                V.V.
                                • 43. Re: How to create a java plugin for Internet explorer
                                  843802
                                  hello deepti
                                  me don't replying to your question, since i don't know the ans
                                  but want to ask u a question:
                                  that how make simple 3D applications using java, wat should i install to run 3D programs in java, and plz also clear me of the instalation process

                                  till now i have been working on simple java jdk , making simple 2D applications and want to learn 3D now
                                  please help me know the answers to above question, i will be highly obliged to
                                  me Aman Jain
                                  (Begner in java 3D)
                                  • 44. Re: How to create a java plugin for Internet explorer
                                    793415
                                    Jain_Aman wrote:
                                    ..me Aman Jain
                                    No! Me Tarzan - You Jane. (I just could not resist that.)
                                    (Begner in java 3D)
                                    Note those words are..
                                    - ans - answer
                                    - u - you
                                    - plz - please
                                    - begner - beginner

                                    Please use the correct words, rather than these idiotic text-speak style abbreviations.

                                    Oh, and one other point. You are about *7 years too late* to get useful information from the contributors to this thread, assuming they ever had any useful advice to offer.