The time now is And per the Solaris The reason is one function call in native code , say A , calls B , to create a client socket, and B return a wraper struct pointer of that socket, but in A , this pointer is always NULL. You can still use the javah command with the jni option to generate native method function prototypes needed for JNI-style native methods. Therefore, the code for native functions must always create stack frames as specified in the system calling conventions for non-leaf functions.

Uploader: Mujin
Date Added: 2 November 2004
File Size: 47.29 Mb
Operating Systems: Windows NT/2000/XP/2003/2003/7/8/10 MacOS 10/X
Downloads: 31030
Price: Free* [*Free Regsitration Required]

Additionally, the frame pointer register must always point to a valid stack frame. The value of errno shall be defined only after a call to a function for which it is explicitly stated ssolaris be set and until it is changed by the next function call or if the application assigns it a value. B is the function that creates the socket and connect it to the server. Note – A native method that violates this restriction can cause the VM to abort randomly.

Making the Transition From NMI to JNI

The time now is For example, an engineer who was unfamiliar with the application ported lines of C code in approximately two days. Coaching, problem solving, economical contract programming. But without a complete example that can be used to duplicate your problem, it’s impossible to tell. Because of these restrictions, the array elements can be accessed without pinning and without copying.

Sorry I didn’t make it clear, both A and B are in native code, and there are dozens of functions called between jni and A. We have disabled IPv6 on dolaris server, as we thought perhaps java was trying to force this protocol, but this didn’t make a difference either.


C programs use the generated header and source files to reference instance variables of an object from native source code.

Post as a guest Name. I’d look first for someone doing something dumb like redefining errno doing anything to a system’s definition of the errno macro results in undefined behavior The exact same libraries and executables will work on both servers, soolaris up until the jni socket call is made.

All forms of printf will fail if: Sign up or log in Sign up using Google. But where is Bon the Java side or is it in the native library too? The failure is around socket connect at or soon after that. The odds that the problem is in Solaris 11 and not in your code are very, very low. I have a native library and a java app that uses JNI to access the native library, my java app works fine on Solaris 8 and earlier SUN solaris releases, however on Solaris 9 it failed native app also works fine.

The dprintf function will fail if: If anyone solzris the similar problem before and knows the solution, please help me out here.

It never reaches the second fprintf statement. Login to Your Account.

Java Native Interface (JNI) (Java 2 SDK for Solaris Developer’s Guide)

Sign up using Facebook. You can also just preprocess solaeis code instead of compiling it all the way, just to see if there are some macros screwing things up.


Certain optimizations that might be performed by compilers compiling native methods can cause the VM to fail. I’ve added xolaris to see what exactly is being sent to the connect call and it looks like the call is getting everything it needs: Please let me know what else you need to see and I’ll post it.

Rather the -old flag is parsed and, if it is found, an -old not supported message occurs and javah exits. JNI does not require header information or stub files. Post Your Answer Discard By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued use of the website is subject to these policies.

Try to extract the troublesome logic into a standalone program and debug it the traditional way. JNI problem on Solaris 9 I have a native library and a java app that uses JNI to access the native library, my java app works fine on Solaris 8 and earlier Solari solaris releases, however on Solaris 9 it failed native app also works fine.