tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Williams" <>
Subject Help!!! tomcat doesn't support JNI... does it!?
Date Fri, 01 Nov 2002 06:00:41 GMT
Hi everyone!

I've looked all over the place for the past two days and I can't find any 
answers to my problem. I'm almost to the stage of taring my hair out but i 
thought that before i do that, i'll give list an email and see if anyone 
here can help.

Basically what I what to do is instantiate an Java object that I have 
written. I can do this is JSPs but not servlets... how come!?

int something = 0;
BlahBlah useThis = new BlahBlah();
something = useThis.getSomeValue();

The above will work in JSP but not when I write it in a servlet. I really 
don't understand why. It's quite frustrating.

However, the only reason I tried using a servlet over a JSP to instantiate 
my object is that my object uses JNI. Assume that the method getSomeValue() 
of BlahBlah uses a native static method also in BlahBlah. If I get rid of 
the native method (and references to it) in BlahBlah, the JSP will run fine 
and the output of getSomeValue() will work and be output to HTML and 
returned to the client. However, if my getSomeValue() uses a native method, 
it will die. It will compile, but give many errors when you try and load the 
JSP through a browser.

Is it possible that JNI is not supported by JSP? If not, is it supported by 
using a Servlet? If so, how can I instatiate an object in a Servlet?

I'm using JDK 1.4, Tomcat 4.1.12 on a windows XP machine.

Please help, i don't know what to do!

many thanks!

Pete from Melbourne, Australia

Unlimited Internet access -- and 2 months free!  Try MSN.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message