Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-26-2007, 11:42 PM
Member
 
Join Date: Nov 2007
Posts: 2
SFLeBrun is on a distinguished road
JNI - No System.out for ExceptionDescribe
The Environment:
  • Operating System: Win2k3
  • Java SDK: 1.5.0_11
  • JNI: JNI_VERSION_1_4
  • The code is a C++/Java plugin to a third-party process that is running as a Windows Service.

The Problem:

The plugin is design to handle requests from the third-party process and return a response. The interface to the third-party process is a C++ base class. The plug-in works by receiving a request, passing the request to the Java code in the plug-in using JNI. The Java code passes on the request to another Windows Service for processing. The Java code passes the response of the other Windows Service back to the C++ code in the plugin as the results of the JNI method call. The C++ uses the reponse to formulate a response to the third-party process using a callback object.

This configuration of third-party process -- C++/JNI/Java Plug-In -- other process has worked under load in the past. Recently, I added logging in the plug-in in the Java code and the C++ code accesses logging using JNI. Now, the configuration runs successfully for several requests, and then on the next request each JNI call fails. An Exception is passed back to the C++ code from the JNI when each error occurs is unreadable. In other words, it appears to have no exception message or exception class type associated with it.

Using the JNI ExceptionDescribe() method is not working. ExceptionDescribe() only writes to System.out (or System.err) but because the code is running as a plug-in to a Windows Service, all System.out messages are sent to the equivalent of /dev/null (the proverbial bit bucket).

The Question:

How can I obtain information about the error that is occurring?

I have tried redirecting both System.out and System.err to files using System.setOut() and System.setErr(). This works fine for the Java classes in the plug-in but JNI is not using the redirected streams. I have also tried closing System.out and System.err before redirecting them to new file output streams.

I have also added code to call the JNI ExceptionClear() before each JNI call it insure that there are no exceptions pending when a JNI call is made.

I have even tried JNI version JNI_VERSION_1_2.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
System class (II) JavaForums Java Blogs 0 12-27-2007 03:41 PM
Getting System Properties Java Tip Java Tips 0 11-19-2007 06:00 PM
system information nitinborge5 New To Java 1 08-07-2007 10:25 AM
where is the system.property osval Advanced Java 2 08-06-2007 04:54 AM
Running a system ai_2007 Advanced Java 1 06-29-2007 04:16 PM


All times are GMT +3. The time now is 07:20 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org