{"action":"created","issue":{"url":"https://api.github.com/repos/sarxos/webcam-capture/issues/299","labels_url":"https://api.github.com/repos/sarxos/webcam-capture/issues/299/labels{/name}","comments_url":"https://api.github.com/repos/sarxos/webcam-capture/issues/299/comments","events_url":"https://api.github.com/repos/sarxos/webcam-capture/issues/299/events","html_url":"https://github.com/sarxos/webcam-capture/issues/299","id":55722203,"number":299,"title":"Failed to initialize BridJ","user":{"login":"amroamer","id":1145117,"avatar_url":"https://avatars.githubusercontent.com/u/1145117?v=3","gravatar_id":"","url":"https://api.github.com/users/amroamer","html_url":"https://github.com/amroamer","followers_url":"https://api.github.com/users/amroamer/followers","following_url":"https://api.github.com/users/amroamer/following{/other_user}","gists_url":"https://api.github.com/users/amroamer/gists{/gist_id}","starred_url":"https://api.github.com/users/amroamer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amroamer/subscriptions","organizations_url":"https://api.github.com/users/amroamer/orgs","repos_url":"https://api.github.com/users/amroamer/repos","events_url":"https://api.github.com/users/amroamer/events{/privacy}","received_events_url":"https://api.github.com/users/amroamer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-01-28T07:10:55Z","updated_at":"2015-01-29T08:48:28Z","closed_at":null,"body":"Dear @sarxos  \r\n\r\nI am trying to use the webcam-capture Applet Example , i am following your example : \r\n\r\nfirst i am writing this applet class like the following : \r\n\r\n    public class WebcamCapture extends JApplet implements ActionListener {\r\n    \r\n    \r\n\r\n    private Webcam webcam = null;\r\n    private WebcamPanel webcamPanel = null;\r\n    private Dimension size = WebcamResolution.VGA.getSize();\r\n    private JButton takePictureButton = null;\r\n\r\n    private Dimension[] nonStandardResolutions = new Dimension[] {\r\n        WebcamResolution.PAL.getSize(), WebcamResolution.HD720.getSize(), new Dimension(2000, 1000),\r\n        new Dimension(1000, 500),\r\n    };\r\n\r\n\r\n    public WebcamCapture() {\r\n        super();\r\n    }\r\n\r\n\r\n    @Override\r\n    public void start() {\r\n        //        WebcamSecurityManager securityManager = new WebcamSecurityManager();\r\n        //        System.setSecurityManager(securityManager);\r\n        super.start();\r\n        System.out.println(\"WebcamApplet ======> start()\");\r\n\r\n\r\n        setSize(WebcamResolution.HD720.getSize());\r\n        webcam =  Webcam.getDefault();\r\n\r\n  \r\n\r\n     \r\n\r\n        webcam.setCustomViewSizes(nonStandardResolutions);\r\n        webcam.setViewSize(WebcamResolution.HD720.getSize());\r\n\r\n\r\n        webcamPanel = new WebcamPanel(webcam, false);\r\n        webcamPanel.setFPSDisplayed(true);\r\n        webcamPanel.setSize(WebcamResolution.HD720.getSize());\r\n\r\n        takePictureButton = new JButton(\"Take Picture\");\r\n        takePictureButton.addActionListener(this);\r\n        webcamPanel.add(takePictureButton);\r\n\r\n        add(webcamPanel);\r\n\r\n\r\n        if (webcam.isOpen()) {\r\n            webcam.close();\r\n        }\r\n\r\n        int i = 0;\r\n        do {\r\n            if (webcam.getLock().isLocked()) {\r\n                System.out.println(\"Waiting for lock to be released \" + i);\r\n                try {\r\n                    Thread.sleep(2000);\r\n                } catch (InterruptedException e1) {\r\n                    return;\r\n                }\r\n            } else {\r\n                break;\r\n            }\r\n        } while (i++ < 3);\r\n\r\n        webcam.open();\r\n        webcamPanel.start();\r\n\r\n\r\n    }\r\n\r\n    @Override\r\n    public void destroy() {\r\n\r\n        System.out.println(\"WebcamApplet ======> destroy() \");\r\n        webcam.close();\r\n        System.out.println(\"WebcamApplet ======> destroyed \");\r\n    }\r\n\r\n    @Override\r\n    public void init() {\r\n     System.out.println(\"WebcamApplet ======> init()\");\r\n    }\r\n\r\n    @Override\r\n    public void stop() {\r\n\r\n        System.out.println(\"WebcamApplet ======> stop()\");\r\n        webcam.close();\r\n        System.out.println(\"WebcamApplet ======> Stopped\");\r\n    }\r\n\r\n\r\n    @Override\r\n    public void actionPerformed(ActionEvent e) {\r\n        if (e.getSource() == takePictureButton) {\r\n            System.out.println(\"TakePicture Button actionPerformend\");\r\n        }\r\n    }\r\n    } \r\n\r\nand i signed my applet using the jarsigner .\r\nand as you said in the tutorial grant the permissions required so in my java.policy i added this : \r\n\r\n     permission java.security.AllPermission;\r\n\r\nand i placed my applet tag inside my JSF page like the following : \r\n\r\n \t<?xml version='1.0' encoding='UTF-8'?>\r\n\t<!DOCTYPE html>\r\n\t<f:view xmlns:f=\"http://java.sun.com/jsf/core\" xmlns:af=\"http://xmlns.oracle.com/adf/faces/rich\">\r\n\t<af:document title=\"testPage.jsf\" id=\"d1\">\r\n\t<af:form id=\"f1\">\r\n\t<APPLET code=\"clientapplet.WebcamCapture.class\" id=\"cameraApp\"\r\n\t\t\t\t    name=\"webcameraApplet\" height=\"100\" width=\"100\"\r\n\t\t\t\t    archive=\"/applet/webcamapplet.jar,/applet/webcam-capture-0.3.11-20141227.105512-4.jar,/applet/bridj-0.6.2.jar,/applet/slf4j-api-1.7.10.jar,/applet/slf4j-simple-1.7.10.jar\">\r\n\t</APPLET>\r\n\r\n\r\n\t</af:form>\r\n\t</af:document>\r\n\t</f:view>\r\n\r\n\r\nand then tried to run my applet and i got the following stacktrace : \r\n\r\n\tjava.lang.RuntimeException: Failed to initialize BridJ\r\n\t\tat org.bridj.Platform.initLibrary(Platform.java:370)\r\n\t\tat org.bridj.Platform.<clinit>(Platform.java:175)\r\n\t\tat com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:59)\r\n\t\tat com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)\r\n\t\tat com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81)\r\n\t\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\t\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\t\tat java.lang.Thread.run(Unknown Source)\r\n\tCaused by: java.lang.UnsatisfiedLinkError: C:\\Users\\user\\AppData\\Local\\Temp\\BridJExtractedLibraries7384257206371869727\\bridj.dll: %1 is not a valid Win32 application\r\n\t\tat java.lang.ClassLoader$NativeLibrary.load(Native Method)\r\n\t\tat java.lang.ClassLoader.loadLibrary0(Unknown Source)\r\n\t\tat java.lang.ClassLoader.loadLibrary(Unknown Source)\r\n\t\tat java.lang.Runtime.load0(Unknown Source)\r\n\t\tat java.lang.System.load(Unknown Source)\r\n\t\tat org.bridj.Platform.initLibrary(Platform.java:347)\r\n\t\t... 7 more\r\n\tcom.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task\r\n\t\tat com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:124)\r\n\t\tat com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:826)\r\n\t\tat com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:889)\r\n\t\tat com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:866)\r\n\t\tat com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:844)\r\n\t\tat clientapplet.WebcamCapture.start(WebcamCapture.java:54)\r\n\t\tat com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.start(Unknown Source)\r\n\t\tat sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)\r\n\t\tat java.lang.Thread.run(Unknown Source)\r\n\tCaused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task\r\n\t\tat java.util.concurrent.FutureTask.report(Unknown Source)\r\n\t\tat java.util.concurrent.FutureTask.get(Unknown Source)\r\n\t\tat com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:116)\r\n\t\t... 8 more\r\n\tCaused by: com.github.sarxos.webcam.WebcamException: Cannot execute task\r\n\t\tat com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:72)\r\n\t\tat com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:140)\r\n\t\tat com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:46)\r\n\t\tat com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.newGrabber(WebcamDefaultDriver.java:46)\r\n\t\tat com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver.getDevices(WebcamDefaultDriver.java:118)\r\n\t\tat com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:36)\r\n\t\tat com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)\r\n\t\tat java.util.concurrent.FutureTask.run(Unknown Source)\r\n\t\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\t\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\t\t... 1 more\r\n\tCaused by: java.lang.UnsatisfiedLinkError: org.bridj.Platform.sizeOf_ptrdiff_t()I\r\n\t\tat org.bridj.Platform.sizeOf_ptrdiff_t(Native Method)\r\n\t\tat org.bridj.Platform.<clinit>(Platform.java:179)\r\n\t\tat com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:59)\r\n\t\tat com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)\r\n\t\tat com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81)\r\n\t\t... 3 more\r\n\tIgnored exception: com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task\r\n\r\n\r\n\r\ni dont know whats wrong , or what should i do , i tried every possible solution and tried to go all over the issues that are already solved , but nothing works for me .\r\n\r\ni have checked the issue #28  , but this issue is with Raspbian  , for me i am working with the following : \r\nwindows 7 64 bit \r\njava jre1.8.0_31 \r\nJdeveloper 12.1.3.0.0 \r\nweblogic 12c \r\n\r\nHope that you can help me with this . \r\n\r\nRegards"},"comment":{"url":"https://api.github.com/repos/sarxos/webcam-capture/issues/comments/71989377","html_url":"https://github.com/sarxos/webcam-capture/issues/299#issuecomment-71989377","issue_url":"https://api.github.com/repos/sarxos/webcam-capture/issues/299","id":71989377,"user":{"login":"sarxos","id":472658,"avatar_url":"https://avatars.githubusercontent.com/u/472658?v=3","gravatar_id":"","url":"https://api.github.com/users/sarxos","html_url":"https://github.com/sarxos","followers_url":"https://api.github.com/users/sarxos/followers","following_url":"https://api.github.com/users/sarxos/following{/other_user}","gists_url":"https://api.github.com/users/sarxos/gists{/gist_id}","starred_url":"https://api.github.com/users/sarxos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarxos/subscriptions","organizations_url":"https://api.github.com/users/sarxos/orgs","repos_url":"https://api.github.com/users/sarxos/repos","events_url":"https://api.github.com/users/sarxos/events{/privacy}","received_events_url":"https://api.github.com/users/sarxos/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T08:48:28Z","updated_at":"2015-01-29T08:48:28Z","body":"Maybe you should consider shading JAR as I did in the example? Can you verify if the JAR generated from example works in your case (you need to build it with maven)?"}}