473,320 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help needed in JNI function call

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.

Jul 17 '05 #1
2 4825
The thought that comes to mind is that as a service, other services or
programs it expects to be there might not be running yet when it launches.
JNI seems to not be initialized properly yet when your program comes up as a
service.
"parthan" <sa*********@indiatimes.com> wrote in message
news:57**************************@posting.google.c om...
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.

Jul 17 '05 #2
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

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
4
by: Terencetrent | last post by:
I having been using Access '97/2002 for about 4 years now and have never really had the need or the time to learn visual basic. Well, I think the time has finally come. I need help with Visual...
6
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
19
by: Mark Richards | last post by:
I've been programming for many years, but have only recently taken a deep "C" dive (bad pun, i know) and need a lot of explanation from an expert. My questions center around those mysterious...
5
by: SStory | last post by:
Hi all, I really needed to get the icons associated with each file that I want to show in a listview. I used the follow modified code sniplets found on the internet. I have left in...
7
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from...
9
by: Terry Olsen | last post by:
I'm running an asynchronous Socket. In the ReceiveCallback method, I need to append what is received to a textbox on the main form. I have this code: Private Sub ToChatWindow(ByVal msg As...
0
by: swtstrawberry | last post by:
here are the directions and below the direction is what I have so far. I need help with (B) the bisect function. I've only posted part of my program, if more information is needed please let me...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
3
by: TC | last post by:
Hey All, I have some classes that I recently built for a website which uses the HttpWebRequest & HttpWebResponse objects from the System.Net namespace. Basically, the classes rap submitted data...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.