[vtkusers] VTK + OSGi & RenderCreate native method

Jérémie Turbet jet at artenum.com
Mon Oct 11 08:29:05 EDT 2010


	Hi all,

Before my question, a small description of the context: 
  I'm trying to create an OSGi bundle displaying some VTK stuff using Java wrapping.
  The service class is a simple POJO (OSGi classes and configuration are managed using iPOJO). when I test it out of OSGi environment, it works well, load libraries, and displays a beautiful 3D cone in a window. When I ask to the OSGi container to launch my service, libraries are loaded, objects are instantiated, but as soon as I ask a rendering (using vtkPanel::Render() ) I get this error "Invalid memory access of location 0x0 rip=0x10109cdcc" which looks like a null pointer exception...
  
  For a debugging purpose, I have made a copy/paste of vtkPanel class into MyVtkPanel (which is in my application package) and replace the vtkPanel by MyVtkPanel into my small test application. I expected no change in the resulting behaviour, instead I have an unsatisfied link error on RenderCreate() method.
This method is declared as native, but my DYLD_LIBRARY_PATH points to the VTK libs. I thought it should have found this method....

Does someone has an idea of why this error occurs, is there some access restriction due to the class location (which is the only change... I guess...) ?

to summarise:
vtkPanel panel = new vtkPanel()
panel.Render()
works fine
 
vtkPanel panel = new vtkPanel()
panel.Render()
leads to "Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: test.vtk.impl.MyVtkPanel.RenderCreate(Lvtk/vtkRenderWindow;)I
	at test.vtk.impl.MyVtkPanel.RenderCreate(Native Method)"


>nm libvtkRenderingJava.dylib  | grep RenderCreate
0000000000047b9b T _Java_vtk_vtkPanel_RenderCreate

Tested under Mac OSX snow leopard with VTK 5.40, 5.6.0 and 5.6.1

	Regards,

		JeT

PS: if someone has some experience with VTK + OSGi, some tips would be of great help. I'm a little bit stuck with it...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101011/4993a592/attachment.htm>


More information about the vtkusers mailing list