HOW TO SOLVE A JNI ERROR IN DUNDJINNI 1.07 CODE
Let us accordingly make changes in the above code and pass a positive timeout value. This information is sufficient for resolving the issue. In the above example, the Exception first occurred at Thread.sleep() method.įrom the above analysis, we reach the conclusion that an IllegalArgumentException occurred at the Thread.sleep() method because it was passed a negative timeout value. Part 4: This part lists all the method invocations leading up to the Exception occurrence, beginning with the method where the Exception first occurred. In the above example, the Exception occurred because an illegal negative timeout value was used. Part 3: This part states the reason behind the occurrence of the Exception. An Exception object of the “” class is made in the above example. Part 2: This part names class of the Exception. In our case, the Exception occurred in the “Test Thread”. Part 1: This part names the Thread in which the Exception occurred. The above Stack Trace can be broken down as follows. The Stack Trace is the ultimate resource for investigating the root cause of Exception issues. Hence, the program terminated abruptly and the Stack Trace that was generated got printed. In the above case, the Exception was not caught. Output: Exception in thread "Test Thread" :Īt java.base/(Native Method)Īt java.base/(Thread.java:834)
ISRO CS Syllabus for Scientist/Engineer Exam. ISRO CS Original Papers and Official Keys. GATE CS Original Papers and Official Keys. Strict - NULL objects are rejected (as they would be for any other With -Xcheck:jni, the validation of arguments for IsSameObject is overly Keep it as a holder for GlobalWeakReference issue, because 4720694 They could close it as a duplicate of 4720694, or (that is, we don't even get the object from them - only create,Ĭompare and delete), I suspect that this might be a vm issue.Īlso note, that the crash reproducible on Solaris and Windows.īased on this information, I'm reassigning the bug to Since the usage pattern didn't change with this 'fix',Īnd we use those weak references only for comparison with IsSameObject() When I've replaced WeakGlobalReferences with GlobalReferences, the When lastclip was set, so the at least the value of lastclip is not smashed. The time of the failure contains the correct value, returned by NewWeakGlobalRef It's not clear yet what exactly the vm is complaining about. (non-null, btw) lastclip, or when IsSameObject(lastclip, NULL) is called. Jni reports the same error when I tried to create a new local reference out of Looks like the lastclip (which is a global weak reference) is the problem. In Win32SD_InitDC and X11SD_InitClip respectively. In both cases (windows and solaris) the offending call isĮnv->IsSameObject(env, clip, sdo->lastclip) The problem is not specific to the test case in the description, it canīe seen when running SwingSet2 with -Xcheck:jni as well. On my Solaris 8 US60 with disabled DGA), and on Windows. It can be reproduced on Solaris single or multiple cpu machine (i.e, (caused by the new code for the Region and Xor changes). The crash with the stack trace above first appeared in 1.4.2 build 07 Here's some information from the evaluation ofĤ720694: java apps crash on Solaris 9 Ultra-80 machine by using 1.4.1 It may be possible that this is due to our use of .embeddedInit().īased on the prevalence of java2d in the stack trace, reassigning to lib files that contain the definitions to the linker. You can fix the errors by including the source code file that contains the definitions as part of the compilation. We have a C++ applicaiton that embeds the VM inside so I cannot give you a consice test program. Unless i and g are defined in one of the files included in the build, the linker generates LNK2019. I have received the following crash several times since moving to 1.4.2 build 07:įATAL ERROR in native method: Bad global or local ref passed to JNIĪt 32GdiBlitLoops.nativeBlit(Native Method)Īt 32GdiBlitLoops.Blit(Win32GdiBlitLoops.javaĪt .blitSurfaceData(DrawImage.javaĪt .renderSurfaceData(DrawImage.javaĪt .copyImage(DrawImage.javaĪt .copyImage(ValidatePipe.javaĪt (SunGraphics2D.javaĪt (JComponent.javaĪt (JComponent.javaĪt ._paintImmediately(JComponent.javaĪt (JComponent.javaĪt (RepaintManager.javaĪt $n(SystemEventQueueUtilities.javaĪt .dispatch(InvocationEvent.javaĪt (EventQueue.javaĪt (EventDispatchThread.javaĪt (EventDispatchThread.javaĪt (EventDispatchThread.javaĪt (EventDispatchThread.java