[vtkusers] VTKJava - UnsatisfiedLinkError in a servlet
Roberto Gori
r.gori at cineca.it
Thu Jun 21 05:27:13 EDT 2001
Hello, vtkUsers!
I am doing servlet programming. Inside the servlet I'm using certain
kitware package classes vtk.jar.
class vrmlexporter {
static { System.loadLibrary("vtkJava"); }
static void export(String infile, String outfile, double thr) {
vtkDataSetReader reader = new vtkDataSetReader();
reader.SetFileName(infile);
vtkContourFilter cf = new vtkContourFilter();
//vtkMarchingCubes cf = new vtkMarchingCubes();
cf.SetInput(reader.GetOutput());
cf.SetValue(0, thr);
cf.ComputeScalarsOff();
vtkPolyDataMapper mapper = new vtkPolyDataMapper();
mapper.SetInput(cf.GetOutput());
vtkActor actor = new vtkActor();
actor.SetMapper(mapper);
vtkRenderer ren1 = new vtkRenderer();
ren1.AddActor(actor);
vtkRenderWindow renWin = new vtkRenderWindow();
renWin.AddRenderer(ren1);
vtkVRMLExporter vrml = new vtkVRMLExporter();
vrml.SetRenderWindow(renWin);
vrml.SetFileName(outfile);
//vrml.SetSpeed(5.5);
vrml.Write();
}
}
The class compiles well, but when I
run the servlet, it says the server gave an invalid response.
I found that the point where I instantiate any of the VTK classes,
it gives me an error during runtime. I check my classpath etc. It is all OK and loading vtkJava library causes no errors.
java.lang.UnsatisfiedLinkError: VTKInit
at vtk.vtkDataSetReader.VTKInit(Native Method)
at vtk.vtkObject.(vtkObject.java:97)
at vtk.vtkProcessObject.(vtkProcessObject.java:78)
at vtk.vtkSource.(vtkSource.java:82)
at vtk.vtkDataReader.(vtkDataReader.java:259)
at vtk.vtkDataSetReader.(vtkDataSetReader.java:50)
at vrmlexporter.export(primo.java:1424)
at primo.doGet(primo.java:169)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
Could you please advice?
Thanks in advance.
Roberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010621/bbdf855e/attachment.htm>
More information about the vtkusers
mailing list