MantisBT - VTK
View Issue Details
0007043VTK(No Category)public2008-05-17 13:012016-08-12 09:54
Jerome Robert 
Kitware Robot 
normalcrashalways
closedmoved 
 
 
0007043: [Wrapping JAVA of VTK] Bug with methods containing character '_'
The JNI library replace all "_" substrings in function names by "_1" and the parser of VTK doesn't do this so this error occurs :

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: vtk.vtkSelection.PROCESS_ID_36()J
        at vtk.vtkSelection.PROCESS_ID_36(Native Method)
        at vtk.vtkSelection.PROCESS_ID(vtkSelection.java:471)
        at testvtk.CascadeActorManager.selectOnSurface(CascadeActorManager.java:142)
        at testvtk.TestRubberBand$RubberBandHelper.doSelectionVisible(TestRubberBand.java:71)
        at testvtk.TestRubberBand$RubberBandHelper.mouseReleased(TestRubberBand.java:64)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
        at java.awt.Component.processMouseEvent(Component.java:6038)
        at java.awt.Component.processEvent(Component.java:5803)
        at java.awt.Component.dispatchEventImpl(Component.java:4410)
        at java.awt.Component.dispatchEvent(Component.java:4240)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
BUILD STOPPED (total time: 12 seconds)

Because the real name expected by the JNI is vtk.vtkSelection.PROCESS_1ID_36 and not vtk.vtkSelection.PROCESS_ID_36. This is a program that can cause this :

import vtk.vtkSelection;

public class BugPROPID
{
      static
  {
    System.out.println(System.getProperty("java.library.path"));
    System.loadLibrary("vtkCommonJava");
    System.loadLibrary("vtkFilteringJava");
    System.loadLibrary("vtkIOJava");
    System.loadLibrary("vtkImagingJava");
    System.loadLibrary("vtkGraphicsJava");
    System.loadLibrary("vtkRenderingJava");
  }
  public static void main(String[] args)
  {
            vtkSelection selection = new vtkSelection();
            System.out.println("TEST : " + selection.PROP_ID());
  }
}

I have made a patch to fix it (it add '1' after all '_' in name methods and name classes).
This bug has been posted as 6723 with wrong severity. I repost it with the good one to ensure it won't be forgotten.

I also fix the patch so it build with visual studio.
No tags attached.
patch vtkWrapJava.patch (5,480) 2008-05-17 13:01
https://www.vtk.org/Bug/file/6470/vtkWrapJava.patch
Issue History
2008-05-17 13:01Jerome RobertNew Issue
2008-05-17 13:01Jerome RobertFile Added: vtkWrapJava.patch
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036973
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved
2016-08-12 09:54Kitware RobotAssigned To => Kitware Robot

Notes
(0036973)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.