This discussion is archived
1 2 3 Previous Next 36 Replies Latest reply: May 14, 2011 9:33 AM by 858788 Go to original post RSS
  • 30. Re: How can I run an applet for accessing the PC camera
    858788 Newbie
    Currently Being Moderated
    I didn't implement EJB, portal technology was required for this project(my master coordinator required it), and I've implemented Spring portlets on JBOSS, because at work I worked few months on a project where Spring portlets were implemented on WPS (WebSphere Portal Server).
  • 31. Re: How can I run an applet for accessing the PC camera
    sabre150 Expert
    Currently Being Moderated
    dariusgeo wrote:
    I didn't implement EJB, portal technology was required for this project(my master coordinator required it), and I've implemented Spring portlets on JBOSS, because at work I worked few months on a project where Spring portlets were implemented on WPS (WebSphere Portal Server).
    Looks like I totally misunderstood the object of your project. Does this mean that 'face recognition' is not the end in itself but is only a secondary part of your project with the primary part being secure login utilising face recognition?

    I do hope that identification using face recognition is not so open to fraud as identification using fingerprint recognition proves to be - http://www.optel.com.pl/top.htm .
  • 32. Re: How can I run an applet for accessing the PC camera
    858788 Newbie
    Currently Being Moderated
    Hi gentlemen,
    First of all, thank you gentlemen.

    yes, baftos, it was about a 404. I hardly test it (it toked me 2 days to find the way to test it), but it was about a 404, because in my application I have all the web resources under WEB-INF. In Spring this is possible by declaring a view resolver.
    Something like
         <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
              <property name="viewClass">
                   <value>org.springframework.web.servlet.view.JstlView</value>
              </property>
              <property name="prefix">
                   <value>/WEB-INF/jsp/</value>
              </property>
              <property name="suffix">
                   <value>.jsp</value>
              </property>
         </bean>
    for the Spring framework. So, I put the jar applet under WEB-INF (without thinking, because I'm too familiar with the application, I've worked on it for over 6 months), and SURE it wasn't available for a regular HTTP request.
    So, I moved it outside of WEB-INF and I called it as follow
    <APPLET
    codebase="http://localhost:8080/FaceRecWeb"
    CODE="CameraApplet.class"
    archive="signedApplet.jar"
    WIDTH=300 HEIGHT=300>
    <PARAM NAME=TEXT VALUE="Hi There">
    <P>Hi There<P>
    </APPLET>
    and it works
    So, lot of thanks, Sir.

    If you haven't seen me active for the last 2 days, it is because I've studied how physical resources are get in a portal. Normally users access portal pages in a portal, something like
    http://localhost:8080/portal/auth/portal/faceRec_portal/RecognitionPage, but for physical resources the Tomcat which JBOSS is using respond for the HTTP requests. So, I found the applet jar at http://localhost:8080/FaceRecWeb/signedApplet.jar instead of http://localhost:8080/portal/auth/portal/faceRec_portal/RecognitionPage or http://localhost:8080/portal/auth/portal/faceRec_portal/ (where FaceRecWeb is the name of the application as it is defined in web.xml or in the defined context) .

    For sabre150
    If you are interest about this subject - face recognition - or whatever I used in my application, please post your e-mail address. I'll be glad to keep the touch.

    For all three of you
    Thank you, thank you, thank you.
    I recommend this thread to anybody wants to develop an applet. In my opinion it covers a lot of things and issues.
  • 33. Re: How can I run an applet for accessing the PC camera
    858788 Newbie
    Currently Being Moderated
    Hi,
    i messed up the applet (again). I receive
    javax.media.NoPlayerException: Error instantiating class: com.sun.media.protocol.vfw.DataSource : java.lang.RuntimeException: No permission to capture from applets
         at javax.media.Manager.createPlayerForContent(Manager.java:1362)
         at javax.media.Manager.createPlayer(Manager.java:417)
         at CameraApplet$1.run(CameraApplet.java:53)
    where line 53 is
         MediaLocator ml = new MediaLocator("vfw://0");
         System.out.println("****** MediaLocator OK");
    player=Manager.createPlayer(ml); ===>> line 53

    I receive this not matter what I did : i signed the jar, i put in java.policy of the JRE which FF is using, the following lines

    grant principal javax.security.auth.x500.X500Principal "cn=name_given_when_i_created_the_ceritificate" {
    permission java.security.AllPermission;
    };
    .................
    //For all-java audio playback:
    permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
    permission java.lang.RuntimePermission "accessClassInPackage.sun.audio";
    permission java.lang.RuntimePermission "accessClassInPackage.javax.media";
    .........................
    permission java.net.SocketPermission "*", "connect,accept";
    According with this suggestions
    http://www.oracle.com/technetwork/java/javase/index-135148.html#jmf2-applet-run >> Q: Are there any security issues running JMF applets with Java 2?

    I downgraded from java 1.6 u24 to java 1.6 u14, because i found there is a bug for code running in
    SwingUtilities.invokeLater(new Runnable() {
                   
         public void run() {
    //code here
    }
    });

    Here, Andrew, you suggested :
    jmf video capture in an Applet
    >
    The applet will need to be digitally signed by the developer, and trusted by the end user (when prompted to trust the applet, they click 'OK').
    >

    I had this applet running in java 1.6 u24, but I don't know what I did, but it doesn't work no more.
  • 34. Re: How can I run an applet for accessing the PC camera
    baftos Expert
    Currently Being Moderated
    I know almost nothing about JMF, but:
    1 - Confirm, by readng/writing to file that your applet is still trusted.
    2 - In his last message, Andrew seems to imply that JMF must be configured somehow to allow capture from applets. I take it as: even trusted applets will not be able to capture, unless JMF is configured to allow it.
    3 - Google for "No permission to capture from applets". There are some hits that may help. Andrew is involved in some.
    4 - You can also ask in the JMF forum, but make sure you cross-link this thread and the new one, so that people would not see it as a cross-post.

    Edited by: baftos on May 14, 2011 11:01 AM

    Edited by: baftos on May 14, 2011 11:04 AM
  • 35. Re: How can I run an applet for accessing the PC camera
    858788 Newbie
    Currently Being Moderated
    Thank for your hints.
    Strange is, I still have the working applet and it works further. But I need to change the code in it. And everything I'm signing at home is no longer working.
    I'll follow what you wrote.
    1 - Confirm, by reading/writing to file that your applet is still trusted.
    Is working
    2 - In his last message, Andrew seems to imply that JMF must be configured somehow to allow capture from applets. I take it as: even trusted applets will not be able to capture, unless JMF is configured to allow it.
    I checked in JMFStudio -> Peferences both : Allow capture from applets & Allow file writing from applets
  • 36. Re: How can I run an applet for accessing the PC camera
    858788 Newbie
    Currently Being Moderated
    Hi,
    I added

    System.setProperty("java.class.path", "C:\\Program Files\\JMF2.1.1e\\lib\\jmf.jar");

    before

    MediaLocator ml = new MediaLocator("vfw://0");
    System.out.println("****** MediaLocator OK");
    player = Manager.createPlayer(ml);

    and I'm back in business. :))
1 2 3 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points