Re: JNI interoperating with .net DLL?



Tan Choong Leong wrote:
My solution is:

1. java (JNI) C++ Win32 DLL using LoadLibrary(), GetProcAddress() to call 2.
2. CLR DLL which export extern "C" function API to call 3.
3. Actual .Net DLL in question.

It works by calling as a standalone java class.

Next, what I need is to call functions in this class from a TOMCAT environment. This fails with unknown reason.

I realised that if I remov the "Actual .NET" function call in the CLR DLL in step 2. with some dummy data, there is no problem in the Tomcat environment.

What does the actual implementation do ?

It just beats me that why as a standalone Java class it works but not in a Tomcat environment.

1. Could it be some security issue?
2. or path problem?

All Dlls are in C:/windows/system32

An excerpt from the error logs:
#
# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (0xe0434f4d), pid=508, tid=3964
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_01-b06 mixed mode, sharing)
# Problematic frame:
# C [kernel32.dll+0x12a5b]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#

--------------- T H R E A D ---------------

Current thread (0x03704c00): JavaThread "http-8081-1" daemon [_thread_in_native, id=3964]

siginfo: ExceptionCode=0xe0434f4d, ExceptionInformation=0x80070002

Registers:
EAX=0x04e4eb3c, EBX=0x00083a60, ECX=0x00000000, EDX=0x00000025
ESP=0x04e4eb38, EBP=0x04e4eb8c, ESI=0x04e4ebc8, EDI=0xe0434f4d
EIP=0x7c812a5b, EFLAGS=0x00000202
Blah blah blah.....

Arne
.



Relevant Pages

  • Re: Java programmer lured back by .Net (Questions)
    ... in .NET a form is simply a class so yes it could easily be placed into a DLL and then use Ngen to make a native image of it. ... Of course it learned a lot from Java, and improved upon many things which Java is slowly catching up on. ... As far as code security you're in the same boat as Java since it compiles down to MSIL instead of bytecode of which both can reverse engineered very easily. ... I would like to be able to place my executable on my remote server and then "load" the executables on demand from accross the internet - so that there are no executables on the local machine for prying eyes to reverse engineer. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Java programmer lured back by .Net (Questions)
    ... in .NET a form is simply a class so yes it could easily be placed into a DLL and then use Ngen to make a native image of it. ... Of course it learned a lot from Java, and improved upon many things which Java is slowly catching up on. ... As far as code security you're in the same boat as Java since it compiles down to MSIL instead of bytecode of which both can reverse engineered very easily. ... My backend is pure Java running on Unix - but because SWING is so ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: JNI EXCEPTION_ACCESS_VIOLATION
    ... I am not experienced in coding a dll and access it via ... Java, but, I would say to you that, if you do not mind, try to use the ... The code will crash when running under XP Service Pack 2 ... The code will NOT crash when running under Windows 2000 Service Pack 4 ...
    (comp.lang.java.programmer)
  • Re: JNI interoperating with .net DLL?
    ... CLR DLL which export extern "C" function API to call 3. ... what I need is to call functions in this class from a TOMCAT environment. ... I realised that if I remov the "Actual .NET" function call in the CLR DLL in step 2. ... It just beats me that why as a standalone Java class it works but not in a Tomcat environment. ...
    (comp.lang.java.programmer)
  • Re: JNI Loading a Library 2 times
    ... I am having good success converting this Model to a dll and then loading the dll in Java using "System.loadLibrary". ... Allows me to keep the 2 memory locations separate, And allows me to call functions on both instances of the libraries. ... TankModel tank_A = new TankModel; ...
    (comp.lang.java.programmer)