Menu

#98 java.lang.ClassNotFoundException: com.sun.jna.Library

New
nobody
None
Medium
Defect
2014-12-31
2013-11-01
Anonymous
No

Originally created by: Overmind...@gmail.com

What steps will reproduce the problem?
1. Download WebcamStudio
2. `ant clean jar`
3. Run WebcamStudio

What is the expected output?
It launching without exception

What do you see instead?
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/jna/Library
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:788)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:447)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at webcamstudio.exporter.vloopback.VideoDevice.openDevice(VideoDevice.java:44)
        at webcamstudio.exporter.vloopback.VideoDevice.loadInfo(VideoDevice.java:38)
        at webcamstudio.exporter.vloopback.VideoDevice.<init>(VideoDevice.java:34)
        at webcamstudio.exporter.vloopback.VideoDevice.getDevices(VideoDevice.java:145)
        at webcamstudio.exporter.vloopback.VideoDevice.getInputDevices(VideoDevice.java:104)
        at webcamstudio.components.OutputPanel.<init>(OutputPanel.java:59)
        at webcamstudio.WebcamStudio.<init>(WebcamStudio.java:56)
        at webcamstudio.WebcamStudio$11.run(WebcamStudio.java:606)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
        at java.awt.EventQueue.access$200(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:694)
        at java.awt.EventQueue$3.run(EventQueue.java:692)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:447)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at webcamstudio.exporter.vloopback.VideoDevice.openDevice(VideoDevice.java:44)
        at webcamstudio.exporter.vloopback.VideoDevice.loadInfo(VideoDevice.java:38)
        at webcamstudio.exporter.vloopback.VideoDevice.<init>(VideoDevice.java:34)
        at webcamstudio.exporter.vloopback.VideoDevice.getDevices(VideoDevice.java:145)
        at webcamstudio.exporter.vloopback.VideoDevice.getInputDevices(VideoDevice.java:104)
        at webcamstudio.components.OutputPanel.<init>(OutputPanel.java:59)
        at webcamstudio.WebcamStudio.<init>(WebcamStudio.java:56)
        at webcamstudio.WebcamStudio$11.run(WebcamStudio.java:606)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
        at java.awt.EventQueue.access$200(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:694)
        at java.awt.EventQueue$3.run(EventQueue.java:692)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.ClassNotFoundException: com.sun.jna.Library
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 34 more

The Operating system you are using (Linux, Windows etc)?
Linux <snip> 3.8.0-29-generic #42-Ubuntu SMP Tue Aug 13 19:40:39 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

What version ofWebcamStudioare you using?
Same issue with both the webcamstudio_0.61.tar.bz2 download as well as the latest svn source

What version of Java are you using?
Tried OpenJDK7 25, OpenJDK6, and SunJDK6, all same error

I was able to fix it in the latest source by correcting the manifest, which appears to be missing the JNA library.

Discussion

  • Anonymous

    Anonymous - 2013-11-01

    Originally posted by: Overmind...@gmail.com

    Same thing with the AWT code, missing manifest link or code inclusion.

     
  • Anonymous

    Anonymous - 2013-11-03

    Originally posted by: soylent...@gmail.com

    Hi,
    i use NetbeansIde to modify WS code so i compile with it and it build and runs well. I try to checkout the svn and `ant clean jar` and i got the same issues.
    Please can you provide me the correct changes i have to make to let WS svn run well compilig with ant?
    Sorry but i don't have much time to look for this issue.
    Thanks.
    Karl.

     
  • Anonymous

    Anonymous - 2013-11-14

    Originally posted by: groca...@gmail.com

    same problem for in fedora19
    how did u fix the problem?

     
  • Anonymous

    Anonymous - 2013-11-20

    Originally posted by: johnfwhi...@gmail.com

    same problem in openSuse 12.2 with openJDK 1.7 although not 100% sure of build and execution instructions. I'm just using "java -jar dist/WebcamStudio.jar"

     
  • Anonymous

    Anonymous - 2013-12-13

    Originally posted by: donperfe...@gmail.com

    same problem in ubuntu 13.10 w/openjdk1.7

    Code untouched

     
  • Anonymous

    Anonymous - 2013-12-17

    Originally posted by: Overmind...@gmail.com

    Oh sorry for the delay, I fixed it by one-jar'ing the build so it included all the library jars inside it, the easy way for the lazy programmer.

     
  • Anonymous

    Anonymous - 2013-12-18

    Originally posted by: soylent...@gmail.com

    Thank you very much OvermindDL1.
    karl.

     
  • Anonymous

    Anonymous - 2014-01-02

    Originally posted by: wwwc...@gmail.com

    again. on the contents of the manifest.fm does not respond. Not seeing jna !

    java -jar /usr/lib/webcamstudio/WebcamStudio.jar
    Welcome to WebcamStudio 0.65 build 519 ...
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/jna/Library
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            at webcamstudio.exporter.vloopback.VideoDevice.openDevice(VideoDevice.java:46)
            at webcamstudio.exporter.vloopback.VideoDevice.loadInfo(VideoDevice.java:40)
            at webcamstudio.exporter.vloopback.VideoDevice.<init>(VideoDevice.java:36)
            at webcamstudio.exporter.vloopback.VideoDevice.getDevices(VideoDevice.java:147)
            at webcamstudio.exporter.vloopback.VideoDevice.getInputDevices(VideoDevice.java:106)
            at webcamstudio.components.OutputPanel.paintWSCamButtons(OutputPanel.java:588)
            at webcamstudio.components.OutputPanel.<init>(OutputPanel.java:96)
            at webcamstudio.WebcamStudio.<init>(WebcamStudio.java:78)
            at webcamstudio.WebcamStudio$25.run(WebcamStudio.java:1528)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
            at java.awt.EventQueue.access$200(EventQueue.java:103)
            at java.awt.EventQueue$3.run(EventQueue.java:694)
            at java.awt.EventQueue$3.run(EventQueue.java:692)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
    Caused by: java.lang.ClassNotFoundException: com.sun.jna.Library
            at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            ... 35 more

     
  • Anonymous

    Anonymous - 2014-01-03

    Originally posted by: soylent...@gmail.com

    Hi wwwcase,
    can you get the program running by simply type in terminal:

    $ webcamstudio

    I imagine that you installed WS from PPAs on Ubuntu.

    Here is is the WebcamStudio launcher, maybe useful:

    # Check if webcamstudio or v4l2loopback module are available...
    lsmod | grep webcamstudio >/dev/null
    if [ "$?" -eq "1" ]; then
        lsmod | grep v4l2loopback >/dev/null
        if [ "$?" -eq "1" ]; then
            echo "None of the kernel modules webcamstudio/v4l2loopback are loaded..."
            zenity --warning --text "None of the kernel modules webcamstudio/v4l2loopback are loaded...\nThe virtual webcam will not be available..."
        fi
    fi

    # Include java-wrappers
    . /usr/lib/java-wrappers/java-wrappers.sh

    JAVA_CLASSPATH="${INSTALLDIR}/*:${INSTALLDIR}/lib/*"
    JAVA_ARGS="-Djna.nosys=true -splash:start.gif"

    find_java_runtime openjdk sunmin5

    find_jars AbsoluteLayout \   AppFramework \   commons-cli \   commons-codec \   commons-httpclient \   commons-lang3 \   jcl-over-slf4j \   jsr305 \   log4j-1.2 \   netty \   slf4j-api \   slf4j-log4j12 \   swing-worker

    cd ${INSTALLDIR}

    run_java webcamstudio.WebcamStudio "$@"

    karl

     
  • Anonymous

    Anonymous - 2014-01-05

    Originally posted by: wwwc...@gmail.com

    Thanks, I install java-wrappers from deb-package on archlinux and run webcamstudio nice!

     
  • Anonymous

    Anonymous - 2014-01-17

    Originally posted by: Drayg...@gmail.com

    Why are several of you using OpenJDK? It had been known to cause problems with multiple different Java applications on both Linux and OSX. As soon as I get a Gentoo or Arch system up and running, I immediately get JDK 7 from Oracle's website and install it through portage or pacman. And, even when I used to use Ubuntu, I removed OpenJDK and installed JDK7 anyways since it saved me a lot of headaches in the long-run.

    Now, mind you, it's been quite some time since I last used OpenJDK, so it may now be fully functional and equal to the real thing. But, I'm curious about this since I primarily use Java for development purposes anyways.

     
  • Anonymous

    Anonymous - 2014-08-30

    Originally posted by: ryanvade...@gmail.com

    Is there any fix?  Installing java-wrappers from the ubunt repos did nothing for me on Arch.

    Also, openjdk is just as good as jdk. And for the most part works better for me than jdk.

     
  • Anonymous

    Anonymous - 2014-12-31

    Originally posted by: sheganin...@gmail.com

    Note, this post has high relavance to this thread, solved my problem (Gives changes to manifest, not just implies them): https://plus.google.com/106438997055822510250/posts/CiaGVe5FFaQ

     

Log in to post a comment.