Hi,I need to return three different values (int, byte, string) from a C++ function over JNI into Java. Is it possible to put them into one jObjectArray without converting them?Best RegardsRolf
Hello,anyone have any clues on how to debug a JNI dll from visual studio? Just attach to the Java process in question, and place your breakpoint?Regards,Helge Fredriksen
Both bytecode operations checkcast and instanceof take an objectref on the operand stack to check it against some time refered to via the constant pool. While their principal purpose and function are clear, there is, however, a somewhat puzzling section in the spec:The following rules are used ...
815 byte By
vhbsca at 2007-10-3 2:30:13
We applied Microsoft patch MS06-040 as part of our corporate patching policy. After the patch, java apps that were running fine started to give the following error.java -Xms512M -Xmx1024M -versionError occurred during initialization of VMCould not reserve enough space for object heap(See ...
175 byte By
KevEadya at 2007-10-3 2:33:13
Hi everbody,Does anyone know if there is a download for Java 1.5 on Windows Intel 64 bit ?I can only find the AMD 64bit one.Thanks in anticipation.
51294 byte By
tessa at 2007-10-3 2:33:16
Hi,We are running an RCP application under windows which uses SWT components .Intermittently the JVM carshes.I doubt SWT is the prime suspect or JVM?We are unable to identify the exact sequence in which the crash occurs.I'm attaching some hs_err_pdi* log files for the abnormal crash.Any ...
Hello, I am trying to link a Java application to some Modula-2 DLLs and I am using a wrapper I have written in Delphi. I have downloaded the Delphi unit JNI.pas from http://home.pacifier.com/~mmead/jni/delphi/JEDI/DOCS/delphi-jni-1.html -> this contains methods to connect Delphi and Java.I ...
I've been using this guide: http://java.sun.com/j2se/1.4.2/docs/guide/awt/1.3/AWT_Native_Interface.htmlI didn't see this doc in the 1.5 stuff and have read lots about deprecated methods, etc. But I'm a bit confused as to whether or not this should work.I realize a canvas with a button. When ...
Rewriting the C/C++ program is out of the question, but my company wants a plugin that's in Java, using the JNI. The interaction for this plugin requires calling Java methods from the existing C/C++ code, instead of simply calling a separate program. So, I'm writing a test application to make ...
Hi, I am terribly stuck up at a point in my code where I need to do some passing around of strings.I have a java program which passes a string to my C++ dll (through JNI).In the C++ dll i convert thi string i.e. the jstring to a char* as follows:char* cText = (char ...
I have following files1. aaa.java2. aaa.class3. aaa.h4. aaajni.cIf source code of aaajni.c has only printf("xxx");everything works fineBut I have to write my source code in aaajni.cto call function in5. bbb.dllEverytime I try to compile my aaajni.cD:\workspace\TestJniDll>cl ...
Hi,Please can anyone help me with this problem. I have searched net but couldnt find an answer. I have a C code. this function when called in a for loop for 238th time it fails at exactly myjstr = (jstring) env->CallObjectMethod(obj, mid,args,args1);c code:char* getComplexTag(JNIEnv *env, ...
I'm using the RXTX COMM jar/DLL for Windows XP (replacement for javax.comm API) from: http://www.rxtx.org/This uses JNI to talk to the Windows SerialPort/COM devices. When I use the stock binaries from the developer (built with GCC 2.95), they seem to work in all situations I test them.For a ...
We have been trying to determine what objects are filling up our perm space. We ran jmap and monitored the growth of objects. The ones that are continue to grow are named * ConstMethodKlass, * ConstantPoolKlass and * ConstantPoolCacheKlass. Does anyone know what these are from and what is ...
Expected YGC times are around 0.1s. "Sometimes" my YGC times jump to 10s level and stay there. Because the YGC is long and frequent JVM spends high portion (10%+) of time in GC. It is not a lonely GC peak, it is a GC duration that is consistenly above some level (3s, 5s, 10s or even 20s).Our ...
Hi,In my project I need to access methods from third party C++ DLL using JNI.For that I will have to write a JNI Wrapper DLL.I am a java programmer and have no idea about C++ programming and creating DLLs.Is there any tool available that can generate wrapper DLL for me out of that third party ...
Hi,The ClassLoader java doc says: Subclasses of ClassLoader are encouraged to override findClass(String), rather than the loadClass(String, boolean) method. I assumed that the user-defined findClass method will be invoked by the loadClass defined in the parent - ClassLoader. Thus I implemented ...
Just curious. Why the code like: public static void main(String[] args) throws Exception {new mk.Dup1(); }is translated/compiled by javac into (using Jasmin syntax): .method public static main([Ljava/lang/String;)Vnew mk/Dup1dupinvokespecial mk/Dup1.<init>()Vpopreturn .end methodAre not ...
Hello,I am trying to check the available memory before loading a table into memory, but I am getting "Memory full" error the first time I run this code and try to load a table but after running the same code couple of times I am able to allocate memory without "Memory full" error. Can anybody ...
2190 byte By
denismoa at 2007-10-3 2:58:41
Hi,we've got an application which is a text processing and analysis tool. It has a main analysis cycle where the application spends most of its time. As it goes, it collects some data and saves them in memory data structures (mostly, hash tables). The amount of the data is big - gigabytes, and ...
For the past 6 months or so I have been running a JVM with -Xmx at 1024m which was working fine. Recently it just stopped working. There have been no changes to any configuration that I am aware of and I could only get it to launch back up at 512mThe error it was giving is the Could not reserve ...
2376 byte By
egc2224a at 2007-10-3 3:06:31
I get this error message and don't know what to do:-- Cannot start Java debug process VM --com.sun.jdi.connect.VMStartException: VM initialization failed for: "C:\Program Files\Java\jdk1.5.0_05\bin\javaw" -classpath "C:\Documents and ...
326 byte By
Amodnka at 2007-10-3 3:11:18
Dear All,I have created a java swing application. application.bat file is created to execute this application on mouse double click. Now we need to integrate this with our parent application which is created in VC++. Could any one help me on how to invoke / call bat file from VC++ code.Thanks ...
1610 byte By
atul_pa at 2007-10-3 3:14:37
I have a main method in a VC++ class, in which i am creating\instantiating JVM.In main method i am calling a method of my own utility class to create JVM.I am cacheing JVM pointer in a private member variable.While creating JVM i get one environment variable env i.e. JNIEnv interface pointer ...
Hi thereI have a java core dump generated because of OutOfMemory. I created a heap dump out of this core, but it's not readable by a text editor. The core and heap dump are generated on an AIX.How do I convert the heap dump into something readable?Thanks,Remo
Hello everyone,I'm just starting with JNI.I'd like to know how to keep C pointer between JNI Call.So :I've a C merthod wich create a handle to a specific hardware (a connection).But i don't want to always recreate such handle, i would like to keep it.So, what's the solution ? jniEnv ...
Hi guys,Might Xms - Xmx parameters cause some performance decrease in JDK5.0 theoritacally?I have been doing some benchmarks on our application and noticed such a performance problem. I have put the tests and results into my blog. ...
Is there a way I can create a DLL to a running instance of my Java server that another C++ application could load in order to make calls to my Java server?Basically, I want to add a C api for a few methods into my Java server.
346 byte By
omyna at 2007-10-3 3:19:29
howdy, im a linux n00b, and just started a java class in school.i am running ubuntu atm, and so far ive found most of it pretty user friendly.im trying to run java_vm but i get an error:"java_vm process: You need to set both JAVA_HOME and PLUGIN_HOME"does anyone know what i need to do to fix ...
Anybody know ?
I'm trying to find a performance bottleneck in my java application.Between 30% and 60% of the execution time are always in "Unknown: thread_state":E.g. (excerpt): Thread-local ticks: 0.2%35 Blocked (of total) 0.0%2 Class loader 0.0%3 Compilation 38.6% 5521 Unknown: thread_stateFlat profile of ...
1257 byte By
Neo2001a at 2007-10-3 3:20:51
Hi FriendsI have java version "1.5.0_03"Java(TM) 2 Runtime Environment, Standard Edition(build 1.5.0_03-b07)Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)I was executing simple core java inheritence program. earlier it was executing but then suddenly runtime error ...
429 byte By
newio_a at 2007-10-3 3:21:42
I have a LPWSTR string, and need to get it into java using (*env)->NewString(env, lpwstr, len)Problem is, i cannot get the length of the f'er! Whats the quickest method to get the length of the LPWSTR string?I've looked at that WideToMultiByte **** but i can't make sense of it. Can't ...
Hi,I would like to monitor the assignment to a local variable of java reference type. But the astore instruction may pop a returnAddress type value. How may I check if the popped value is of returnAddress type or a reference type? Thank you in advance.-- Sunny
The JNI_CreateJavaVM fails at runtime because it doesn't get correct JRE path. Can anybody help me get the ways to get correct JRE path at runtime?Do I have to read any registry entries for this?Are there any ENVIRONMENT variables set for this?Do I've to hard-code it?Any pointers are ...
1022 byte By
fabuleya at 2007-10-3 3:24:22
I have a Windows 2003 64-bit server w/ 20GB that I'm running the 32-bit VM on. For the past several months I have been able to run VMs with the maximum heap set to 1500M. Recently I am no longer able to allocate 1500M. The maximum I can get now is about 1024M. The system has over half of the ...
Hi friends,I want to produce image via jmagick. But I don't want to produce a real file. So I produce image which save in the memory. When jmagick process completely, image will transfer to client.I wrote sample code, as follows:ImageInfo info;MagickImage image;MagickImage ...
2243 byte By
atul_pa at 2007-10-3 3:26:12
I have a main method in a VC++ class, in which i am creating\instantiating JVM.In main method i am calling a method of my own utility class to create JVM.I am cacheing JVM pointer in a private member variable.I am using following code to create an object of class ...
final methods r not overridden.at what type of sichevation we can use final method?give me any example?
Can anybody help me out in finding the cpu time or cpu usage percentage for a particular process in windows xp environment.Any suggestion should be of a great help.ThanksMuthu
Hellow expertsconfig-Java 1.5.0.08tomcat 5.5.17Os :Ubuntu Dapper Linux and Windows Xp PofessionalJasperreports1.2.2.jar for reportsMysql Databse 5.0i am working on a Swings based Java appl where i am using jasper reports.the database is Mysql.i have some reports which are simple listing of ...
Hi All,I have created a dll in c++ using a C static library. The dll has been built sucessfully.But when I try to load it using the System.loadLibrary() the there is no response , it stucks there only and control doesn't move to the next line .Please suggest the way to overcome it.Thanks & ...
1269 byte By
Irisa at 2007-10-3 3:32:42
Hello, I have to launch a remote application on my machine. I managed to do that with code that invokes the main method of the application I want to execute. What I do is to launch an instance of the class containing main function, here is an extract of the code:Object obj = ....; //obj is the ...
821 byte By
ilsetraa at 2007-10-3 3:33:25
Hello everyone!I'm fussing around with the following problem.I call a c native method (InitX) from a java. This method in c creates a thread, that listens for something. If something is received within this thread, the thread does a callback to the java method receive(jbyteArra ba) in order to ...
5402 byte By
ssr075a at 2007-10-3 3:35:20
Here is the output from gdb against the error. If anyone has an idea of what could be causing it, please let me know.ThanksShankarGNU gdb Red Hat Linux (6.3.0.0-1.90rh)Copyright 2004 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you ...
Hi,I`ve been trying to build jdk 1.5(scsl version) on red hat 9. The following errors have been repeatedly bothering me. If anyone has compiled the source code successfully, please help me out.I`ll post the errors here:linux i586 1.5.0-internal build started: 06-08-19 20:34if [ -r ...
I have worked on JNI.In that i usually use C methods in and create a dll and use those methods in java.But i want to write my application in C and call Java methods.Is there any way to do this.Tell me step by step so that i can understand well.Thanks a lot
I have worked on JNI.In that i usually use C methods in and create a dll and use those methods in java.But i want to write my application in C and call Java methods.Is there any way to do this.Tell me step by step so that i can understand well.Thanks a lot
greetings. i'm attempting to send and receive data to and from a usb device. i have all the driver code completed and a C++ class i'm using to represent the device. in my .dll i declare an instance of this object, "MyDevice device." in java when i load the library, device's constructor is ...
Hello,Does anyone know if it is possible to prevent the Java Virtual Machine to quit when exit(1) is called in a native method?Thanks in advance!TK