1 2 3 Previous Next 36 Replies Latest reply: May 14, 2011 11:33 AM by 858788 Go to original post RSS
      • 15. Re: How can I run an applet for accessing the PC camera
        793415
        sabre150 wrote:
        That RoseIndia site is giving bad advice since it will compromise the security of the client machine. In general don't trust anything you read on Rose India.
        ++
        ..What I am hinting at is that start with something very very simple and then gradually expand it. Don't just use the big bang approach; it rarely works.
        ++
        • 16. Re: How can I run an applet for accessing the PC camera
          793415
          baftos wrote:
          user985724 wrote:
          @Andrew Thompson
          I'm used with the superiority american attitude, because i'm working daily with american people, beside this attitude they have nothing.
          I was about to help, but forget it. Replace 'american' with whatever nation, race or religion you wish and this would be considered abuse. By the way, he's not american, nor am I.
          ++

          Hoping not to offend a number of excellent Americans I know (who are more interested in helping people than imposing American standards on the rest of the world), but I am deeply offended to be branded 'American' (or Venezuelan, or Tanu Tuvan etc.). My nationality is not up for discussion - I consider myself to be a 'citizen of the world'. Borders are stupid (except for the purpose of quarantine control). Our planet is too small, and our pollution too large, to make such arbitrary distinctions.

          If the OP cannot deal with that, tough.

          BTW - Thanks to those who are prepared to deal with a racist/nationalist. I guess all valid questions deserve an answer.

          As for me, I am not that forgiving. Good luck with it.
          ----------------------------------------------
          I stand by the implication of my original post though. If you are asking such 'newbie' questions about such complex subjects, expect to fail.
          • 17. Re: How can I run an applet for accessing the PC camera
            858788
            Hi,
            I fixed it on Win 7. Seems that was something wrong with the certificate. I generated another one, I signed the applet, etc... and it just had worked on Win 7, also.

            Thank you for your help.
            • 18. Re: How can I run an applet for accessing the PC camera
              793415
              user985724 wrote:
              ..Thank you for your help.
              I find it odd that you replied to me in thanks. Wasn't it sabre150 who provided most help? If the answer is 'yes', a couple of 'helpful' markings as well as a 'correct' on those posts would be most beneficial.

              (Glad you got it sorted, BTW.)
              • 19. Re: How can I run an applet for accessing the PC camera
                858788
                Andrew,
                Digging into this problem, I found some other of your posts. I saw you wrote on this subject. Other thing is I'm not 16 or 18 years old, I have over 5 years of IT, and over 2 years of Java programming, but no experience with applets, because where I work, either the applets are bought(they must be signed) or they are written by other teams.
                And, yes, your answer really disappointed me. Being ironic is not the solution.
                Alright, I want to say sorry, wasn't properly from my side. I shouldn't get some of my frustration on you.
                But, look, sabre150 treated the subject straight and his advices really, really, helped me.
                So...
                Again, sorry, wasn't the best thought or attitude I usually have.
                At the end this thread really helped me. I was stacked into this for few weeks.
                Andrew, again, I'm sorry.

                thank you.
                • 20. Re: How can I run an applet for accessing the PC camera
                  793415
                  user985724 wrote:
                  ..Andrew, again, I'm sorry.
                  OK, I'm over it (especially since it seems you have learned something from this thread about ascribing nationality to people).

                  Good call on adding credit where credit is due. :-)
                  • 21. Re: How can I run an applet for accessing the PC camera
                    baftos
                    user985724 wrote:
                    Andrew,
                    Alright, I want to say sorry, wasn't properly from my side. I shouldn't get some of my frustration on you.
                    With the risk of sounding over-politically correct, I find this is totally missing the point. Andrew's response was a bit harsh for my standards and you are entitled to react. What I don't accept, is the 'Americans' part. I was hoping you learn something about not mixing technical issues with political ones. All you seem to have learned is that the guy named Andrew is not so bad after all. If I am not mistaken, the most useful help came from the US.
                    • 22. Re: How can I run an applet for accessing the PC camera
                      sabre150
                      baftos wrote:
                      If I am not mistaken, the most useful help came from the US.
                      You are mistaken (unless we became the 51st state since I last looked).
                      • 23. Re: How can I run an applet for accessing the PC camera
                        858788
                        Gentlemen,
                        I said I'm sorry. Andrew passed over it, I passed over it, well... wasn't the best way to know each other.
                        The next episode of my applet's life is : I made it work on Tomcat (as learning phase), step by step (first a writing a file applet, then the camera capturing applet). Now, I've moved it in my application which uses Spring portlets on JBOSS portal server (2.7.2, which has JBOSS AS 4.2.3). Basically, shouldn't be any problem, since JBOSS has a Tomcat under hood, but I'm getting :

                        network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/CameraApplet.class with cookie "JSESSIONID=2E0E37F19809053455A78F476CD2A829"
                        network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/, version: null]
                        basic: error: Incompatible magic value 168430090 in class file CameraApplet.
                        java.lang.ClassFormatError: Incompatible magic value 168430090 in class file CameraApplet
                             at java.lang.ClassLoader.defineClass1(Native Method)
                             at java.lang.ClassLoader.defineClassCond(Unknown Source)
                             at java.lang.ClassLoader.defineClass(Unknown Source)
                             at java.security.SecureClassLoader.defineClass(Unknown Source)
                             at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
                             at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
                             at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
                             at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
                             at java.lang.ClassLoader.loadClass(Unknown Source)
                             at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
                             at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
                             at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
                             at java.lang.Thread.run(Unknown Source)
                        Exception: java.lang.ClassFormatError: Incompatible magic value 168430090 in class file CameraApplet
                        Ignored exception: java.lang.ClassFormatError: Incompatible magic value 168430090 in class file CameraApplet

                        Here :
                        Incompatible magic value 1008813135 in class file MyApplet
                        >
                        The class file seems to be corrupted. The "magic value" are the first 4 bytes in the file and they should always be 0xCA 0xFE 0xBA 0xBE.
                        Instead, they are 0x3C 0x21 0x44 0x4F (1008813135 converted to hex). They correpond to the ASCII sequence <!DO, which seem to be the start of an XML document.

                        Why it happens and why only on your PC and why only recently, I don't know, but the above analysis may help you find the cause.
                        >
                        This time, thank you, baftos.
                        I started from the scratch, recompile, re-jaring, resign the applet, so on..

                        In eclipse I use JDK 1.6_u24
                        JBOSS echos :

                        JBoss Bootstrap Environment
                        JBOSS_HOME: E:\jboss-portal-2.7.2
                        JAVA: C:\Program Files\Java\jdk1.6.0_24\bin\java
                        JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -XX:MaxPermSize=1
                        28m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
                        CLASSPATH: C:\Program Files\Java\jdk1.6.0_24\lib\tools.jar;E:\jboss-portal-2.7
                        .2\bin\run.jar

                        The Java Console says :
                        Java Plug-in 1.6.0_25
                        Using JRE version 1.6.0_25-b06 Java HotSpot(TM) Client VM
                        User home directory = C:\Users\my_user

                        If the class is compiled, jarred and signed with u24, but executed with u25, shouldn't be the : minor / major version (the exception doesn't says this).
                        If, I get it from the scratch, the corruption should disappear, so...
                        Any idea?
                        • 24. Re: How can I run an applet for accessing the PC camera
                          baftos
                          Not that it helps much, but you seem to have this problem: Any reason for: StreamCorruptedException: invalid stream header: 0A0A0A0A? not the one from my old post.
                          If you try to download the jar manually, by putting the jar URL in your browser address bar, what happens?
                          Do you get it? And if yes, is it the uncorrupted original?
                          • 25. Re: How can I run an applet for accessing the PC camera
                            858788
                            ok,
                            running with appletviewer I'm getting :

                            E:\jboss-portal-2.7.2\server\default\tmp\deploy\tmp6807566461397933462faceRecEAR
                            .ear-contents\faceRec-exp.war\WEB-INF\jsp\recognition>appletviewer main.jsp
                            ****** MediaLocator OK
                            java.lang.RuntimeException: No permission to capture from applets
                            java.lang.RuntimeException: No permission to capture from applets
                            javax.media.NoPlayerException: Error instantiating class: com.sun.media.protocol
                            .vfw.DataSource : java.lang.RuntimeException: No permission to capture from appl
                            ets
                            at javax.media.Manager.createPlayerForContent(Manager.java:1362)
                            at javax.media.Manager.createPlayer(Manager.java:417)
                            Ok, I know my lesson : my first applet in JBOSS, my first writing a file applet in JBOSS, my first signed applet in JBOSS, so on... :)
                            • 26. Re: How can I run an applet for accessing the PC camera
                              858788
                              baftos,
                              For the all three ways : normal running, accessing the jar or accessing the class file in browser, e.g.
                              http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar
                              http://localhost:8080/portal/auth/portal/faceRec_portal/CameraApplet.class
                              after authentication step ( because I defined user/user roles on portal) I'm getting this content of Java Console

                              Java Plug-in 1.6.0_24
                              Using JRE version 1.6.0_24-b07 Java HotSpot(TM) Client VM
                              User home directory = C:\Users\my_user

                              ----------------------------------------------------
                              c: clear console window
                              f: finalize objects on finalization queue
                              g: garbage collect
                              h: display this help message
                              l: dump classloader list
                              m: print memory usage
                              o: trigger logging
                              q: hide console
                              r: reload policy configuration
                              s: dump system and deployment properties
                              t: dump thread list
                              v: dump thread stack
                              x: clear classloader cache
                              0-5: set trace level to <n>
                              ----------------------------------------------------

                              security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
                              security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
                              security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
                              security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
                              security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
                              security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
                              security: property package.definition value null
                              security: property package.definition new value com.sun.javaws
                              security: property package.definition value com.sun.javaws
                              security: property package.definition new value com.sun.javaws,com.sun.deploy
                              security: property package.definition value com.sun.javaws,com.sun.deploy
                              security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
                              security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
                              security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
                              security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
                              security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
                              basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@82c01f
                              basic: Plugin2ClassLoader.addURL parent called for http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar, version: null]
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with proxy=DIRECT
                              network: Connecting http://localhost:8080/ with proxy=DIRECT
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with cookie "JSESSIONID=E44B7047BFCF884CA5C7F9499EB50207"
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar, version: null]
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar, version: null]
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with proxy=DIRECT
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with cookie "JSESSIONID=E44B7047BFCF884CA5C7F9499EB50207"
                              network: Downloading resource: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar
                                   Content-Length: -1
                                   Content-Encoding: null
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar, version: null]
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with proxy=DIRECT
                              network: Connecting http://localhost:8080/ with proxy=DIRECT
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with cookie "JSESSIONID=E44B7047BFCF884CA5C7F9499EB50207"
                              network: Downloading resource: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar
                                   Content-Length: -1
                                   Content-Encoding: null
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar, version: null]
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with proxy=DIRECT
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with cookie "JSESSIONID=E44B7047BFCF884CA5C7F9499EB50207"
                              network: Downloading resource: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar
                                   Content-Length: -1
                                   Content-Encoding: null
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar, version: null]
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with proxy=DIRECT
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar with cookie "JSESSIONID=E44B7047BFCF884CA5C7F9499EB50207"
                              network: Downloading resource: http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar
                                   Content-Length: -1
                                   Content-Encoding: null
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/, version: null]
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/CameraApplet.class, version: null]
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/CameraApplet.class with proxy=DIRECT
                              network: Connecting http://localhost:8080/ with proxy=DIRECT
                              network: Connecting http://localhost:8080/portal/auth/portal/faceRec_portal/CameraApplet.class with cookie "JSESSIONID=E44B7047BFCF884CA5C7F9499EB50207"
                              network: Cache entry not found [url: http://localhost:8080/portal/auth/portal/faceRec_portal/, version: null]
                              basic: error: Incompatible magic value 168430090 in class file CameraApplet.
                              java.lang.ClassFormatError: Incompatible magic value 168430090 in class file CameraApplet
                                   at java.lang.ClassLoader.defineClass1(Native Method)
                                   at java.lang.ClassLoader.defineClassCond(Unknown Source)
                                   at java.lang.ClassLoader.defineClass(Unknown Source)
                                   at java.security.SecureClassLoader.defineClass(Unknown Source)
                                   at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
                                   at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
                                   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
                                   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
                                   at java.lang.ClassLoader.loadClass(Unknown Source)
                                   at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
                                   at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
                                   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
                                   at java.lang.Thread.run(Unknown Source)
                              Exception: java.lang.ClassFormatError: Incompatible magic value 168430090 in class file CameraApplet
                              Ignored exception: java.lang.ClassFormatError: Incompatible magic value 168430090 in class file CameraApplet
                              security: Accessing keys and certificate in Mozilla user profile: null
                              • 27. Re: How can I run an applet for accessing the PC camera
                                baftos
                                But what happens if, after authentication, you just put http://localhost:8080/portal/auth/portal/faceRec_portal/signedApplet.jar
                                in the browser address bar. If you do this, the Java console should not be involved at all.
                                The browser should normally ask you if you want to download the file. If it does, download it and compare it carefully with the original. If instead, the browser comes up with a 'resource not found message' or anything else, it would mean that, for some reason, the jar is not accessible, not to you and not to the Java plug-in. And if this is the case, you can concentrate on something being misconfigured on the server.

                                Edit: I googled for the exact text " Incompatible magic value 168430090" and the second hit seems to be up to something. They basically say that the server is configured to return an empty HTML page (therefore the 0A0A0A0A, which is just a bunch of line-feeds) when the resource (the jar) is not accessible.

                                Edited by: baftos on May 8, 2011 9:42 AM
                                • 28. Re: How can I run an applet for accessing the PC camera
                                  793415
                                  dariusgeo wrote:
                                  ..java.lang.RuntimeException: No permission to capture from applets
                                  From what I recall, the set-up EXE for Windows pops an option asking the user if they want to allow capture from applets. It defaults to 'no'. I vaguely recall there is an app. connected with JMF that allows you to inspect & change those options.
                                  • 29. Re: How can I run an applet for accessing the PC camera
                                    sabre150
                                    dariusgeo wrote:
                                    The next episode of my applet's life is : I made it work on Tomcat (as learning phase), step by step (first a writing a file applet, then the camera capturing applet). Now, I've moved it in my application which uses Spring portlets on JBOSS portal server (2.7.2, which has JBOSS AS 4.2.3).
                                    I would be interested to know why you think you need to use EJB within this project. I have been involved with two large commercial projects that involved EJB and in neither case could I see any real advantage obtained from the EJB layer.

                                    I await the flames.