parthan wrote:
We are running our c++ program as Windows services which uses JNI.
Program is getting CLASSPATH env variable correctly and also
initializes JVM successfully. After initializing JVM, programs makes a
JNI call FindClass() for getting java class.But FindClass method
returns NULL even though java class exists in the CLASSPATH.
Same program when is run from command window, FindClass method call is
working fine.
Is there any difference between running a program thru command window
and as a windows service ?
Incase you have any idea on how to resolve this issue, kindly get back
ASAP.
There is a great deal of difference between running as a service and
running in the command window.
First of all, consider who the service is running as. Is it the same
user as you are using to run the command prompt?
Second, consider that the service does not "log in" before it is
executed. This can cause some environmental differences. (E.g., when
you log in, your administrator may have set up a number of mapped drives
that are automatically activated. If no one is logged in, the drives
are not mapped.)
In your specific problem, I recommend attempting to discover if the
class can be loaded within "standard" java (i.e no JNI) using a
reference to the class and then using Class.forName().
Ray