[vtkusers] awt_Lock

philipp.batchelor at kcl.ac.uk philipp.batchelor at kcl.ac.uk
Sat Apr 5 09:20:17 EST 2003


I tried Cone.java on the command line where it works, in Matlab it doesn't 
(Matlab claims not to find the class), but as Cone.java has a 'main' method, it is not too surprising. 
 I tried again the other route,  i.e. to force matlab to use jdk1.4.1, but 
it hangs, so I suppose I'll have to try to recompile vtk with 1.3.1. 
But this raises one question, does vtk need jre, or full jdk? (well, I'll 
find out by trying) Matlab only comes  with jre1.3.1.
Thanks for inputs already, certainly helps pin down.

P

 On Fri, 4 Apr 2003, Jeff Lee wrote:

> 
> 
> philipp.batchelor at kcl.ac.uk wrote:
> 
> >I did compile vtk myself, and used the java on our system. Matlab was 
> >installed on our system, it comes with its own jvm. I wasn't able
> >to get Matlab to use 1.4.1, normally there is an env variable called 
> >MATLAB_JAVA for this, but matlab doesn't start if I set it to 1.4.1. But 
> >the fact that the java example without vtkPanel works seems to imply that 
> >it is not the main issue.
> >
> It seems to be the main issue for me - your original "hello world" 
> example did no graphics or jawt drawing.  I suspect that your build of 
> vtk with java1.4.1 headers is somehow conflicting with the 1.3.1 jvm.  
> Perhaps if you tried compiling vtk against jdk1.3.1 this might go away....
> 
> >I did test Cone.java, which worked fine, I'll try more examples
> >
> inside matlab, or from the command-line?
> -Jeff
> 
> >
> >P
> >
> > On Fri, 4 Apr 2003, Jeff Lee wrote:
> >
> >  
> >
> >>did you compile vtk yourself, or are you using a nightly?  it looks odd 
> >>that matlab is running a 1.3.1 jvm and you are using vtk binaries linked 
> >>against java1.4.1.  have you tried any of the java examples that came 
> >>with vtk?
> >>-Jeff
> >>
> >>philipp.batchelor at kcl.ac.uk wrote:
> >>
> >>    
> >>
> >>>>What does the stack trace look like?  awt_Lock comes from java libs.  
> >>>>Can you post the offensive code and also include a copy of the vtkPanel 
> >>>>you are using?  Is this vtk4.2?
> >>>>-Jeff
> >>>>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>Yes, sorry, vtk 4.2, (gcc 3.2).
> >>>In matlab, the whole error message is:
> >>><BEGIN MATLAB ERROR>
> >>> 
> >>>
> >>>      
> >>>
> >>>>h = javaObject('HelloWorldApp')
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>??? Error using ==> javaObject
> >>>Java exception occurred:
> >>>java.lang.UnsatisfiedLinkError: 
> >>>/projects/vtk/linux2.2/vtkNightly/VTK-4.2.1/bin/libvtkRenderingJava.so: 
> >>>/usr/local/java/j2sdk1.4.1/jre/lib/i386/libjawt.so: undefined symbol: 
> >>>awt_Lock
> >>>       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> >>>       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
> >>>       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1306)
> >>>       at java.lang.Runtime.loadLibrary0(Runtime.java:749)
> >>>       at java.lang.System.loadLibrary(System.java:820)
> >>>       at vtk.vtkPanel.<clinit>(vtkPanel.java:31)
> >>>       at HelloWorldApp.<init>(HelloWorldApp.java:22).
> >>>
> >>><END MATLAB>
> >>>The HelloWorldApp.java is
> >>><BEGIN JAVA CLASS>
> >>>import vtk.*;
> >>>public class HelloWorldApp {
> >>>   public HelloWorldApp() {System.out.println("Hello Yalin!"); };
> >>>   public static void hello() {
> >>>       System.out.println("Hello World! 2"); //Display the string.
> >>>   }
> >>>   protected vtkPanel renPanel = new vtkPanel();
> >>>  
> >>>}
> >>><END>
> >>>
> >>>Without the vtkPanel line, matlab runs the class as expected. 
> >>>Doing  System.loadLibrary("vtkRenderingJava"); leads to the same error 
> >>>message.
> >>>Cheers,
> >>>P
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>vtk 
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>mailing list led me to try putting a > >
> >>> 
> >>>
> >>>      
> >>>
> >>>>>'protected vtkPanel renPanel = new vtkPanel();'
> >>>>>
> >>>>>just before. This then causes the error message 
> >>>>>'...libvtkRenderingJava.so: 
> >>>>>/usr/local/java/j2sdk1.4.1/jre/lib/i386/libjawt.so: undefined symbol: awt_Lock
> >>>>>
> >>>>>and a search for 'awt_Lock' doesn't find much, the most relevant maybe 
> >>>>>http://www.thalion-graphics.de/jgraph/doc/devel/graph3d-jniconstraints.html
> >>>>>
> >>>>>All the other vtk libraries do not generate complaints from matlab, so the 
> >>>>>problem really seems to come from
> >>>>>System.loadLibrary("vtkRenderingJava");  
> >>>>>
> >>>>>I greped the vtk source for 'awt', but I'm not sure what to look for, I 
> >>>>>also ldd'ed the libraries, this looks ok. 
> >>>>>I'm not an everyday user of java, so maybe I'm missing something? 
> >>>>>
> >>>>>Versions:
> >>>>>linux: RH 7.1, 2.4.7-10
> >>>>>java: jdk1.4.1
> >>>>>matlab: 6.5r13,
> >>>>>typing version -java in matlab produces 'Java 1.3.1 with Blackdown 
> >>>>>Java-Linux Team Java HotSpot(TM) Server VM'
> >>>>>I noticed in vtkJavaAwt.h 'awt.version = JAWT_VERSION_1_3;'
> >>>>>could it be a version problem?
> >>>>>
> >>>>>any suggestion welcome...and sorry as I realise that it is as much a java 
> >>>>>question as a vtk one.
> >>>>>
> >>>>>P. Batchelor
> >>>>>




More information about the vtkusers mailing list