Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-2008, 02:58 AM
Member
 
Join Date: Dec 2008
Posts: 1
Rep Power: 0
kumari is on a distinguished road
Default intermittent error in JNI_CreateJavaVM
I have a C++ a class that is using JNI Invocation mechanism to create a JVM and call methods in a java application. I am using IBM Java 1.4.2 version with the Visual Age C++ 9.0 compiler and running the application in Windows XP.
We had the JVM created using the main application thread at the very beginning when the application initializes. We also invoked the JNI method once at the application initialization so that it will load all the Java DLLs, needed Java classes to run the method into memory. When a button is clicked on the UI (from different threads) this JNI method gets invoked. Therefore we had to use attachcurrentthread prior to invoking the method and detachcurrentthread after invoking the method.
Everything worked fine.
But then we had to move the JVM creation/initial invocation of the JNI method to a different thread. This thread gets spawned by the main application thread and it will keep running till the application terminates. But now we are seeing an intermittent problem that sometime JVM is failing to get created (return with -1). Or sometimes the JVM gets created successfully but when the Java method get invokes it fails with link error or class not found error.
We have close to 2500 machines running with this code, but whenever the application starts up only about 30 machines fails with the error and it is occurring randomly.
Here is the error that Java is throwing for the cases where it is able to create the JVM but still unable to invoke the method.

Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\IBM\WebSphere\AppClient\java\jre\bin\nio.dll : The segment is already unlocked
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:2144)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :2004)
at java.lang.Runtime.loadLibrary0(Runtime.java:824)
at java.lang.System.loadLibrary(System.java:910)
at sun.security.action.LoadLibraryAction.run(LoadLibr aryAction.java:76)
at java.security.AccessController.doPrivileged1(Nativ e Method)
at java.security.AccessController.doPrivileged(Access Controller.java:287)
at sun.nio.ch.Util.load(Util.java:280)
at sun.nio.ch.Net.<clinit>(Net.java:231)
at sun.nio.ch.WindowsSelectorImpl.<clinit>(WindowsSel ectorImpl.java:73)
at sun.nio.ch.WindowsSelectorProvider.openSelector(Wi ndowsSelectorProvider.java:52)

Has anyone ever seen a similar error. I googled and search lot of web sites but could not find anything related to this spefic problem.
So any help is greatly appreciated.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

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

BB 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
Problem with Socket Client - Intermittent Truncated Response in AIX cheongww Networking 4 10-02-2008 07:32 PM
error 530 error authentication required rgale JavaServer Pages (JSP) and JSTL 0 05-12-2008 05:28 PM


All times are GMT +2. The time now is 10:08 PM.



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