cychiang / webcamstudio

Automatically exported from code.google.com/p/webcamstudio
GNU General Public License v3.0
1 stars 0 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 of WebcamStudio are 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.

Original issue reported on code.google.com by Overmind...@gmail.com on 1 Nov 2013 at 10:29

GoogleCodeExporter commented 9 years ago
Same thing with the AWT code, missing manifest link or code inclusion.

Original comment by Overmind...@gmail.com on 1 Nov 2013 at 11:46

GoogleCodeExporter commented 9 years ago
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.

Original comment by soylent...@gmail.com on 3 Nov 2013 at 8:04

GoogleCodeExporter commented 9 years ago
same problem for in fedora19
how did u fix the problem?

Original comment by groca...@gmail.com on 14 Nov 2013 at 6:44

GoogleCodeExporter commented 9 years ago
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"

Original comment by johnfwhi...@gmail.com on 21 Nov 2013 at 4:12

GoogleCodeExporter commented 9 years ago
same problem in ubuntu 13.10 w/openjdk1.7

Code untouched

Original comment by donperfe...@gmail.com on 13 Dec 2013 at 9:58

GoogleCodeExporter commented 9 years ago
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.

Original comment by Overmind...@gmail.com on 18 Dec 2013 at 1:13

GoogleCodeExporter commented 9 years ago
Thank you very much OvermindDL1.
karl.

Original comment by soylent...@gmail.com on 18 Dec 2013 at 6:25

GoogleCodeExporter commented 9 years ago

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

Original comment by wwwc...@gmail.com on 2 Jan 2014 at 11:46

GoogleCodeExporter commented 9 years ago
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

Original comment by soylent...@gmail.com on 3 Jan 2014 at 4:36

GoogleCodeExporter commented 9 years ago
Thanks, I install java-wrappers from deb-package on archlinux and run 
webcamstudio nice!

Original comment by wwwc...@gmail.com on 5 Jan 2014 at 10:59

GoogleCodeExporter commented 9 years ago
Thanks for the feedback.
karl

Original comment by soylent...@gmail.com on 6 Jan 2014 at 8:27

GoogleCodeExporter commented 9 years ago
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.

Original comment by Drayg...@gmail.com on 17 Jan 2014 at 4:47

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
 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. 

Original comment by ryanvade...@gmail.com on 31 Aug 2014 at 6:11

GoogleCodeExporter commented 9 years ago
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

Original comment by sheganin...@gmail.com on 31 Dec 2014 at 11:38