Results 1 to 7 of 7
  1. #1
    landon.silla is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default NoSuchMethodError for PickTool method

    I ran into a small bug in my application. Here is the stack trace:

    Java Code:
    Exception in thread "J3D-BehaviorScheduler-1" java.lang.NoSuchMethodError: javax.media.j3d.BranchGroup.pickAll(IILjavax/media/j3d/PickShape;)[Ljavax/media/j3d/PickInfo;
    	at com.sun.j3d.utils.pickfast.PickTool.pickAll(PickTool.java:377)
    	at pointCloudTest.PickMeasureBehavior.processStimulus(PickMeasureBehavior.java:82)
    	at javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:174)
    	at javax.media.j3d.J3dThread.run(J3dThread.java:250)
    Here is the code that is causing it (in file PickMeasureBehavior):

    Java Code:
    MouseEvent event = (MouseEvent)events[events.length-1];
    pickCanvas.setShapeLocation(event);
    PickInfo[] allPick = pickCanvas.pickAll();

    With the last line being like 82.

    What's going on here? This (PickTool (Java 3D 1.3.2)) shows the method exists and it's been there since version 1.3.2 which is super old. I'm developing this on a mac in eclipse and it is all compiling correctly.

    I'm a passable java programmer. I mostly do web application work (php), so my skills aren't great for java. It seems this is hopefully an easy question ... if you have, at least, modest java skills. Can somebody help me here?

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    is is possible the version of picktool you are using in eclipse is somehow different than the one that is actually being found on the classpath at run time. For example, it might be an older version of this jar file is being accidentally found and used instead of the one you intend to use.

    Try printing out the system property "classpath" by dumping system properties,
    e.g.
    Java Code:
    public static void dumpSystemProperties() {
            
            Properties p = System.getProperties();
            Map<String, String> sortedProperties = new TreeMap<String, String>();
            for (Object key : p.keySet()) {
              sortedProperties.put(key.toString(), p.getProperty(key.toString()));
            }
            for (String key: sortedProperties.keySet()) {
              System.out.println(key  + ":" + sortedProperties.get(key));
            }
        }

  3. #3
    landon.silla is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Ok, I did that and printed it below. It's all pretty Greek to me. One other thing to note: This seems to be a Mac only problem (I'm developing this on a mac). I have this as a live product on my website and it runs fine on a pc, but when I run it on a mac, it always breaks like this. That seems weird to me, isn't java, pretty much platform independent? Why would it break on a mac and not on a pc? (Yes, both environments have sufficiently high versions of java)

    Java Code:
    -- listing properties --
    java.runtime.name=Java(TM) SE Runtime Environment
    sun.boot.library.path=/System/Library/Java/JavaVirtualMachi...
    java.vm.version=17.1-b03-307
    awt.nativeDoubleBuffering=true
    gopherProxySet=false
    mrj.build=10M3261
    java.vm.vendor=Apple Inc.
    java.vendor.url=http://www.apple.com/
    path.separator=:
    java.vm.name=Java HotSpot(TM) 64-Bit Server VM
    file.encoding.pkg=sun.io
    user.country=US
    sun.java.launcher=SUN_STANDARD
    sun.os.patch.level=unknown
    java.vm.specification.name=Java Virtual Machine Specification
    user.dir=/Users/landonsilla/Sites/3dviewer
    java.runtime.version=1.6.0_22-b04-307-10M3261
    java.awt.graphicsenv=apple.awt.CGraphicsEnvironment
    java.endorsed.dirs=/System/Library/Java/JavaVirtualMachi...
    os.arch=x86_64
    java.io.tmpdir=/var/folders/LP/LP+pipmuGzSkCHxYJ2vx0...
    apple.awt.graphics.UseOpenGL=false
    line.separator=
    
    java.vm.specification.vendor=Sun Microsystems Inc.
    os.name=Mac OS X
    sun.jnu.encoding=MacRoman
    java.library.path=.:/Library/Java/Extensions:/System/Li...
    java.specification.name=Java Platform API Specification
    java.class.version=50.0
    sun.management.compiler=HotSpot 64-Bit Server Compiler
    os.version=10.6.5
    http.nonProxyHosts=local|*.local|169.254/16|*.169.254/16
    user.home=/Users/landonsilla
    user.timezone=America/Los_Angeles
    java.awt.printerjob=apple.awt.CPrinterJob
    java.specification.version=1.6
    file.encoding=MacRoman
    user.name=landonsilla
    java.class.path=/Users/landonsilla/Sites/3dviewer/bin...
    apple.awt.graphics.UseQuartz=false
    java.vm.specification.version=1.0
    sun.arch.data.model=64
    java.home=/System/Library/Java/JavaVirtualMachi...
    java.specification.vendor=Sun Microsystems Inc.
    user.language=en
    awt.toolkit=apple.awt.CToolkit
    java.vm.info=mixed mode
    java.version=1.6.0_22
    java.ext.dirs=/Library/Java/Extensions:/System/Libr...
    sun.boot.class.path=/System/Library/Java/JavaVirtualMachi...
    java.vendor=Apple Inc.
    file.separator=/
    java.vendor.url.bug=http://bugreport.apple.com/
    sun.cpu.endian=little
    sun.io.unicode.encoding=UnicodeLittle
    mrj.version=1060.1.6.0_22-307
    socksNonProxyHosts=local|*.local|169.254/16|*.169.254/16
    ftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16
    sun.cpu.isalist=
    sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio...
    apple.awt.graphics.UseOpenGL:false
    apple.awt.graphics.UseQuartz:false
    awt.nativeDoubleBuffering:true
    awt.toolkit:apple.awt.CToolkit
    file.encoding:MacRoman
    file.encoding.pkg:sun.io
    file.separator:/
    ftp.nonProxyHosts:local|*.local|169.254/16|*.169.254/16
    gopherProxySet:false
    http.nonProxyHosts:local|*.local|169.254/16|*.169.254/16
    java.awt.graphicsenv:apple.awt.CGraphicsEnvironment
    java.awt.printerjob:apple.awt.CPrinterJob
    java.class.path:/Users/landonsilla/Sites/3dviewer/bin:/Users/landonsilla/Library/Jars/j3dutils.jar:/Users/landonsilla/Library/Jars/j3dcore.jar:/Users/landonsilla/Library/Jars/jnlp.jar:/Users/landonsilla/Library/Jars/vecmath.jar
    java.class.version:50.0
    java.endorsed.dirs:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/endorsed
    java.ext.dirs:/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
    java.home:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    java.io.tmpdir:/var/folders/LP/LP+pipmuGzSkCHxYJ2vx0U+++TI/-Tmp-/
    java.library.path:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    java.runtime.name:Java(TM) SE Runtime Environment
    java.runtime.version:1.6.0_22-b04-307-10M3261
    java.specification.name:Java Platform API Specification
    java.specification.vendor:Sun Microsystems Inc.
    java.specification.version:1.6
    java.vendor:Apple Inc.
    java.vendor.url:http://www.apple.com/
    java.vendor.url.bug:http://bugreport.apple.com/
    java.version:1.6.0_22
    java.vm.info:mixed mode
    java.vm.name:Java HotSpot(TM) 64-Bit Server VM
    java.vm.specification.name:Java Virtual Machine Specification
    java.vm.specification.vendor:Sun Microsystems Inc.
    java.vm.specification.version:1.0
    java.vm.vendor:Apple Inc.
    java.vm.version:17.1-b03-307
    line.separator:
    
    mrj.build:10M3261
    mrj.version:1060.1.6.0_22-307
    os.arch:x86_64
    os.name:Mac OS X
    os.version:10.6.5
    path.separator::
    socksNonProxyHosts:local|*.local|169.254/16|*.169.254/16
    sun.arch.data.model:64
    sun.awt.exception.handler:apple.awt.CToolkit$EventQueueExceptionHandler
    sun.boot.class.path:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar
    sun.boot.library.path:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries
    sun.cpu.endian:little
    sun.cpu.isalist:
    sun.io.unicode.encoding:UnicodeLittle
    sun.java.launcher:SUN_STANDARD
    sun.jnu.encoding:MacRoman
    sun.management.compiler:HotSpot 64-Bit Server Compiler
    sun.os.patch.level:unknown
    user.country:US
    user.dir:/Users/landonsilla/Sites/3dviewer
    user.home:/Users/landonsilla
    user.language:en
    user.name:landonsilla
    user.timezone:America/Los_Angeles

  4. #4
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    ok, so the java.class.path one,

    java.class.path:/Users/landonsilla/Sites/3dviewer/bin:/Users/landonsilla/Library/Jars/j3dutils.jar:/Users/landonsilla/Library/Jars/j3dcore.jar:/Users/landonsilla/Library/Jars/jnlp.jar:/Users/landonsilla/Library/Jars/vecmath.jar
    we see contains

    (looks like the your project folder classes)

    /Users/landonsilla/Sites/3dviewer/bin


    and the .jar files:

    /Users/landonsilla/Library/Jars/j3dutils.jar
    /Users/landonsilla/Library/Jars/j3dcore.jar
    /Users/landonsilla/Library/Jars/jnlp.jar
    /Users/landonsilla/Library/Jars/vecmath.jar

    So, is eclipse using these same jar files in this path (e.g. in your workspace). ?

    Though I was looking into this javax.media.j3d package a bit more, I didn't realize this is built into the Java runtime now.

    : Class BranchGroup

    It is possible since this API might be in some kind of beta mode, or that the Apple folks have not gotten around to fully implementing or supporting all of the stuff in this API, Since you mentioned it is Apple specific.

    Though you also appear to be running the lates 1.6.0_22 Java VM, so It might be we just have to wait until Apple issues an updated Java VM, or if Oracle ever starts to build Java VM for Mac OS.

    I also use a Mac, and this kind of different Java VM bugs me sometimes too, I have problems with Javax.media Audio and RTP video API as well.

  5. #5
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    and, another idea, if it is possibe to somehow find a .jar file of this javax.media.j3d API on its own, like a stand alone .jar file release, it might be possible to shove this into your classpath... e.g. Download j3dcore.jar : j3dcore.jar**JKL**Jar File Download

  6. #6
    landon.silla is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Quote Originally Posted by travishein View Post
    It is possible since this API might be in some kind of beta mode, or that the Apple folks have not gotten around to fully implementing or supporting all of the stuff in this API, Since you mentioned it is Apple specific.

    Yeah, that's what I've been presuming as well. You said that I should take a jar and put it in the classpath? Well aren't I doing that:

    /Users/landonsilla/Library/Jars/j3dcore.jar

    I have two main questions, (1) How do I get this to work in my eclipse build and (2) How do I bundle the jar so that I can serve it to everybody and it will work (pc's and mac's)?

  7. #7
    landon.silla is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Quote Originally Posted by landon.silla View Post
    I have two main questions, (1) How do I get this to work in my eclipse build and (2) How do I bundle the jar so that I can serve it to everybody and it will work (pc's and mac's)?


    Can somebody kindly help me? This problem has been killing me for months!

Similar Threads

  1. error java.lang.NoSuchMethodError: main
    By Mars in forum New To Java
    Replies: 8
    Last Post: 10-05-2010, 05:37 PM
  2. Execution error: NoSuchMethodError: Main
    By kjharn in forum New To Java
    Replies: 4
    Last Post: 11-02-2009, 08:23 PM
  3. NoSuchMethodError AxisFault.makeFault
    By deepak_gurav22 in forum Advanced Java
    Replies: 1
    Last Post: 08-21-2009, 05:42 AM
  4. [error] java.lang.NoSuchMethodError: main
    By jon80 in forum New To Java
    Replies: 1
    Last Post: 04-29-2009, 11:21 PM
  5. NoSuchMethodError : Main (isn't that a blatant lie)
    By havfunonline in forum New To Java
    Replies: 8
    Last Post: 07-28-2008, 02:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •