C# and JNI

Are there any plans for JNI support of C#?

I think I can safely say that Sun will not ever directly support C# through JNI. There are commercial products that do this. I may be adding this to Jace ( http://jace.reyelts.com/jace ) soon through direct support for Managed C++.
God bless,
-Toby Reyelts

Similar Messages

  • Swing GUI and JNI

    Hello
    I am facing a problem related to Swing and JNI. Actually I have to call a native function on the action of a button, so I am using Swing to develop GUI. When I use Jframe and Jbuttons and on the action event of JButton when I call the native function of a different class, then the function works fine but suddenly program gets terminated. Program does not get terminated when I click on other buttons but when I click on the button containing native method, after clicking, the whole GUI frame gets removed and the program terminates. While debugging it does not give any error, infact the function works perfectly fine and the only thing that I came to know is that the application gets terminated and it displays "terminated, exit value : - 1073741819"
    Please help me out and reply as soon as possible.

    I imagine it depends on what's in the JNI code. Is this a JNI that you've created? Is it a large program? Can you post the code? Are you sure that you're compiling the C/C++ code with the correct parameters? (you may need to ask some of this in the JNI forum) Is it thread-safe? Are you calling its methods on the EDT?

  • Difference between JNA and JNI ?

    Hi All ,
    I am very new to both of JNA and JNI . Could you please help me to find out the differences between them.
    Thanks and Regards,
    Allwyn

    Google ( [jni jna|http://www.google.com/search?q=java+jni+jna] ).

  • How can I maintain a single connection between Forms 9i and JNI?

    I am creating a JNI interface into a legacy application written in Pro C. Currently this legacy system is accessed from Forms 6i through userexits. Under this setup the Pro C application is able to share the connection to the DB established by forms. I want to mimic this functionality over the web using JNI as the link between my web components and the legacy application.
    ie. I want to share the DB connection established by my web components with my Pro C application.
    Thus far I have been unable to find any documentation on how to do this.
    Any ideas would be very helpful.
    Information about how Oracle Forms shares its connection with userexits would also be helpful.

    The Pro*C application is linked in to Forms, and runs in the same process space, which is how the session is shared.
    You can't share the Forms session outside of Forms. So it's not possible to do what you want.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Invocation JVM and JNI library communication

    How do I communicate between my application that creates a VM, and the JNI libraries (with native functions) loaded by classes within the invoked VM?

    -Global variablesI doubt global variables inside the C app can be >accessed from JNI native methods.Whoops! Correct.
    -Primitives passed as argumentsSure, but there is an whole API in C I wan't to make
    available in Java.
    -Primitives as attributes in a classExplain? Attributes in class?Basically the same as the previous one. So probably no more useful.
    -C/C++ pointers passed as arguments or as class
    attributes using a java long to hold it.Yes, this is probably the way!You will probably find this is best.
    -Function callbacks.Presumably you control the code base for both sides of this. A JNI shared library can have normal shared library method calls in it. So use normal shared library protocols to access it. (I haven't tried it so there might be some interesting problems with initially resolving the thunks or there might not.)

  • Servlets And JNI.. real urgent help.

    Hi all,
    I have the JNI code integrated to the servlet .The servlet works fine at first time.but when i modified some source code of servlet (not native library) and redeploy it,then reload the same servlet in web browser ,i get "Native library already loaded in another classloader java.lang.UnsatisfiedLinkError" error.
    Any solution to this ???
    Thanks
    jetdvk

    Have you fixed this?
    I presume you are hot deploying the servlet ? if so then i also presume that you have either some static code or some run once code that loads your native code when your class is used for the first time.
    This code is being ran again as the class is being reloaded, therefore you have two choices,
    1) wrap the call loading the native library, and just ignore the exception. Then call a check method in the native code to make sure that the library was loaded.
    2) Move the code that loads the native library out to another class that is not hot deployed. Your servlet can call this when it is first accessed, and the other class will know whether it has already loaded the dll and will not attempt to load it again.

  • Servlets and JNI

    Hi,
    We have a C library which does financial computations and some of our customers have expressed the need to access our library from their servlets.
    This is why we have developed a JNI wrapper which encapsulates all functionality of our library.
    Now, do the specs allow using JNI in conjunction with servlets? I've studied the Java EE, JSP and servlet specs but JNI isn't mentioned anywhere...
    I've also found this thread with a quite similar question but without a clear answer whether it's allowed or not.
    -- Vincent

    yes, if the server's security policy allows it. In a basic server environment you can do just about anything you can do in a regular java application.

  • Map the XCreateWindow to Frame or window in C and JNI

    I am having a window which is created in C++ using 'XcreateWindow' function
    I am using JNI as a interface
    How do i get the Window Id / handle to java frame.
    If I am giving any actionlistener to my frame that has to be reflected in C window
    Anybody can send me the full source code too.

    Linux_Java wrote:
    How do i get the Window Id / handle to java frame.You can't get it from within Java, that much I know, and in fact since it is an OS construct it is meaningless in java. If you are working with MS Windows, I'm guessing that your best bet is to play with some of the functions in the User32 library, such as enumerateWindows and such, and by doing this you'll find out how to get a handle on the JFrame. If it's unix/linux (and given your name, that is a reasonable assumption) then I have no idea.
    If I am giving any actionlistener to my frame that has to be reflected in C windowNo idea what you mean here.
    Anybody can send me the full source code too.Doesn't this kind of go against the philosophy of these forums?
    Also, consider posting this sort of question in the JNI forum where you will have a much better chance of getting a JNI guru who actually knows what he's talking about instead of, well, me.

  • SAX and JNI

    I'm having problems using Java classes from C. I've managed to trace the problem as far as the SAX parser, but I have no idea why there's a problem at all.
    With the -verbose:jni option on, there's a message: "Unable to read from file" and then the JVM stops (crashes actually.)
    I create a VM as follows:
            JavaVM* jvm;
         JNIEnv* env;
         JavaVMInitArgs args;
         JavaVMOption options[3];
         int ret;
         args.version = JNI_VERSION_1_4;
         args.nOptions = 3;
         options[0].optionString = classPath;
         options[1].optionString = "-verbose:jni";
         options[2].optionString = "-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl";
         args.options = options;
         args.ignoreUnrecognized = JNI_TRUE;
         if ((ret = JNI_CreateJavaVM(&jvm, (void **)&env, &args)) < 0) {
                /* error */
            }classPath is just a char* that lists all the Jars the project uses. I wrote a Java main() to test my code and when you run it with the exact same classpath, it works.
    The Java code that creates and starts the SAX parser looks like:
         XMLHandler handler = new XMLHandler ();
         SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser saxParser = factory.newSAXParser();
            try {
                 saxParser.parse(f, handler);
            } catch (java.io.IOException e) {
                 e.printStackTrace ();
            } catch (Exception e) {
                 e.printStackTrace ();
            }Is there something about JNI that SAX stuff won't work with it?
    Any help is greatly appreciated.

    D'oh!
    The java test code that "worked" actually used the wrong file name so the file didn't exist so it didn't actually execute the broken code.
    When I hard-code the absolute path to the file, I still get "Unable to read from file". So I guess the problem isn't with the JNI but somewhere else in my code.
    Thanks.

  • Static libraries and JNI / recursive libraries

    Hi @all,
    I've built and linked the C++ code, that's called via JNI by my Java application as a so (shared lib). This lib however, links with other libs, that are not shared but static. When I run my java application it can't resolve symbols from those libs.
    What can I do to make my Java program find those symbols?
    Thx

    That is non-sensical.
    Static linkage means it is in the dll itself. There is no way for them to not be available.
    As a guess the linkage is not static.

  • Jca  and  jni

    I hope some one can answer this question , as there is no much to read about JCA
    my J2EE application needs to inetgerate with some C libraries, after some investigations , I found that calling native APIs direct from the EJBs might crash the EJB container when the JNI fails, as a better solution the JCA can be used as an intermediate layer, regarding the JCA-JNI communication I have 2 questions:
    1- Is this setup EJB->JCA->JNI->C failsafe against the failure in the JNI->C part?
    2- can the JNI wrapper be hosted on a remote server other than the application server or will I need to install the application server on the same machine as the C libraries

    1) If you mean, does the app server continue running if your native code coredumps, the answer is no - This is the tradeoff you pay for speed.
    2) Yes, but you're no longer going JCA->JNI. Rather, you're going JCA->X->JNI where X is some remotable protocol.
    JCA is no magic layer - It's just a Java API between application servers and whatever library you intend to expose to your app server clients.
    God bless
    -Toby Reyelts

  • Iostream and JNI

    I am trying to use iostream with JNI. I have read a lot of replys and bug reports on it. So here are my problems
    It says it can't find std::cout (*&(&(std_()(*()*cout*(HJHD(FH) really)
    JDK 1.4.1
    Solaris 2.8
    Forte
    I have tried
    -lc
    (did nothing whatsoever)
    -library=iostream,no%Cstd
    (worked but now I can't include <string> or use exit();
    -library=no%Cstd -lCstd.a and -lCstd.so
    (neither did anything)
    Another problem is I am using other peoples C++ librarys and I can't recompile all of them.???
    It's starting to make me wish I hadn't used java (well almost).
    Thanks
    Dan Schrimpsher

    For anyone who is interested the way I finally fixed it was
    1) I got the guy building the library to build it with
    -library=iostream,no%Cstd
    2) I have to manually link all the library I need (e.g, -lpthread) in the user librarys of forte instead of using the standard library section (if you use Work shop this should make sense). Aprantly when I remove Cstd a lot of stuff gets unloaded.
    It is a pain finding out which librarys to link in but it works.
    Dan Schrimpsher

  • Dlopen and JNI

    Hi all,
    im trying to make a code, that looks like this:
    - javaInterface dynamic library: a library that serves as an interface to some java functions
    - caller: a library that uses the java interface above and call functions
    - executable: calls dlopen to open caller and its functions
    JNI crashes while starting the JVM. The interesting thing is, if instead of using dlopen I compile executable linking with caller, it works. I heard there was an incompatibility with Thread Local Storage and dlopen, and the libc RH EL uses has TLS. Can anyone shed a light here?
    Thanks
    Matheus

    It is quite old, yes. We have to stick to version 1.3, the actual version is
    1.3.1_04 IIRC, because of something coded against specific swing
    peculiarities.
    Of course threads are more efficient, that's their reason to exist.
    However, I haven't been able to find any doc about that, except a single
    sentence mentioning that on Solaris the implementation was not using
    native threads. BTW, I haven't been able to find the source code for
    Linux libjvm either.
    Our C application continuously calls into the JVM to get user's input.
    Should it use mutexes? Catch signals? I cannot work it out without some
    detailed description. Isn't that relevant for programmers? Or is just me
    looking in the wrong places?

  • RMI and JNI

    Hi Everybody,
    I've been stuck on a problem for now 3 days.
    I'm using a C++ in my application, I've wrapped it using JNI and it works perfectly. Now I wanted to access these methods remotely, so I decided to use RMI (Remote Methode Invocation) to do the job.
    I have 3 files:
    CamControlImpl.java - RMI Methode Implementations
    CamControlServer.java - RMI Server Application
    CamControlMain.java - RMI Methode Interface
    Now I've loaded my dll in "CamControlImpl.java" using 'System.load("c:\\mydll.dll");'. When I start the server, and execute my RMIClient I kinda get an "java.lang.UnsatisfiedLinkError" Exception.
    The Dll works fine when calling methods locally without using RMI. Can JNI be used in RMI ? if yes, Any suggestions guys ?
    I'm really stuck here.
    Thanks in Advance
    Uday Moorjani

    You haven't said exactly what the operational link is between the client, the server, and the JNI code (if any). Nor have you shown anything about the code involved, directories involved, or methods of starting the server.
    Post some code fragments and other info.

  • Oracle Java Store Procedure and JNI

    Hi ! 'Is the anybody out there ?'
    We don't know. We are developing a java store procedure in Oracle 9i. We need to use a propetary .so file about cript/decript information (entrust file). So have to use in oracle a .jar file with all software infrastructure that use this .so file. But, we have a problem. 'Cause, in windows, we can use a .dll file from our java store procedure, but when we run under unix aix, we have problem about jni.
    java.library.path in oracle console is empty.
    So we cannot find our share object... have you got an idea ?
    thanks!!
    andrea

    Oracle lite does not support the use of PL/SQL procedures or triggers in the database, so unfortunately you just cannot use them.
    as an alternative you need to either
    a) include the setting on the client records when they are created
    b) use before insert/update triggers on the main oracle database to populate the columns. NOTE if doing this you will find that the user that is actually responsible for the inserts and updates to the main database is MOBILEADMIN (as it is running the apply process. If you just want to log the fact that it was client created fine, but will not tell you the creating user)
    c) you should be able to use pure java stored procedures on the client (if in the main oracle database, they should replicate across, but beware of jvm differences and any advanced stuff that may not be supported. you will also have to get any necessary jar files over to the client as well)
    We have used method a) as a standard method called for all inserts/updates in the java client APPLICATION software based on the existance of the audit columns, rather than within the database as it is simpler

  • CORBA IDL and JNI

    Hello everybody,
    I am trying to develop a CORBA server that implements a method written in C language. This method is making RPC calls to a UNIX remote host. The reason why I used a native language is because I did not find yet how to make RPC calls in Java (I guess it is not possible ...).
    When I run a client invoking the remote (native) method on the server everything works fine. But when I run more than one client at the same time the JVM exits with a message "An unexpected exception has been detected in native code outside the VM".
    I believe this is a problem with memory allocation in the native code but I have tested and re-tested the C code (by calling it from a java class) and it works fine. The problem only occurs when the client invokes the method using the ORB.
    Did anybody experience this problem? Is there any known incompatibility between JNI and CORBA?
    By the way, I am running in Red Hat Linux 7.0.
    If anybody has any tips please give me some help ASAP.
    Thanks,
    Jo�o

    1. I have CORBA clients invoking CORBA servers. CORBA servers use native code to process the request and callback the client.
    2. Right! The server crashes due to some kind of invalid memory reference in the C code. I checked and double checked and there is a problem with a strcmp() function in the C code. something I really can not understand ...
    I ended up by giving up on the JNI. I managed to make RPC calls directly from JAVA.
    Thanks for your reply,
    Jo�o

Maybe you are looking for

  • Reading frames in avi files

    When reading large AVI files, I get an error when trying to read frame 870 or higher:  Error -1074395967 occurred at IMAQ AVI2 Read Frame Possible reason(s): IMAQ Vision: (Hex 0xBFF604C1) Error reading AVI frame Is this a limitation of the system? I

  • Applets

    i have a simple question when writing an applet in java is it possible to input codes in applets same as codes for java. and if not how do we write for example do while()code thank you in advance

  • Safari Tab management

    Hello all. Thanks in advance for any thoughts you have. I'll be blunt. Is there any way to disable the new tab management in Safari? It used to be there was a pop-up menu list to the right if you had a lot, like with the bookmarks. I have a loooot of

  • Adobe illustrator cs5 compatible with my computer

    Hi , I was wanting to see if you thought that my Lenovo G570  with Windows 7 ,Intel Pentium cpu B940 @ 2.00Ghz, with 10.0 GB Installed Memory (Ram), 500 GB HHD, 64bit operating system, Intel HD Graphics, would work with Adobe Illustrator CS5. Thanks

  • SCCM 2012 R2 How to exclude IE 11 from SUP group?

    I'm able to create search criteria for my Windows 7 updates, but how do I exclude IE 11 updates without excluding IE 10 updates?