DDS Java Example throws tons of warnings "JNI call made without checking exceptions" - opendds

When I run the Java example OpenDDS-3.14.1/java/tests/messenger I am getting tons of messages like this:
WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethodV.
I am using the openjdk 11.0.9.1 2020-11-04 LTS on a Mac. But same warnings I get on Linux.
Is that just not handled well in the example?
Or is it not well handled in the DDS-Java-Wrapper?
I have to admin that I have not yet read any Developer Documentation...

JNI is what allows Java and the native C++ code to interact with one another. OpenDDS's JNI code isn't checking for Java exceptions like it should and this is what the warnings are about. They show up in the all Java tests I can see, but apparently they are ignored by the system that report errors and warnings. I think they come up because -Xcheck:jni is one of the java arguments in the test script framework. So if you take out that argument of the file I linked or run java directly without that argument the warnings shouldn't be there.

Related

Using Saxon/C with Perl

The Saxon website says Saxon/C can be invoked from Perl, but I can't find any examples. The only thing I've found that interfaces to Saxon is one old Perl module (XML::Saxon::XSLT2) which uses Inline::Java and apparently is very slow. But I can find nothing that uses Saxon/C. Has anyone had any success in doing this who can share some tips?
we have not yet officially done the integration work needed to extend Saxon/C on perl it is still on our todo list. Therefore we currently don't support it. I don't know of anyone who has done this work as yet but I know it is can be done.
On the Saxon website we state that it is possible to create extensions in languages like Perl since Saxon/C has a C/C++ interface. Currently, we only have extensions for PHP and Python (available in the next release).
As a workaround you could run the transform command from Saxon/C using the exec function in Perl instead of the Java version, therefore avoiding the need to run Java VM.

memory command is not available even after compiled with TCL_MEM_DEBUG flag

I have memory related problem in my application on solaris9 environment where Tcl_DeleteInterp() function calls lot of free() and mutex_unlock() functions. To debug the problem i followed the below steps to compile tcl on solaris server (with TCL_MEM_DEBUG flag) but still i couldn't use the 'memory' command in my interpreter.
Ran configure script on server (./configure –prefix=<directory needs to be installed> --enable-symbols=mem)
Make clean all
Make install (tcl libraries and tlcsh exe is copied to the path specified in step1)
Compilation generated two libraries (libtcl8.4g.so and libtclstub8.4g.a), I copied libtcl8.4g.so as libtcl8.4.so to my app
Copied tcl8.4 directory as well.
I also copied the tclsh8.4 to $PROVHOME/bin and created soft link as tclsh-> tclsh8.4.
From my application i linked the debug symbol enabled libraries to the place where exactly i created the Tcl interpreter.
Initialized the Tcl interpreter to using Tcl_InitMemory() function (so that the memory command will be registered in the supplied(arg) interpreter.
When i used the interpreter exe (tclsh) separately i could execute the memory command, but when i used the same exe on my application its not working. Can someone help me what could be the possible reason for this problem ?
Also help me how can i cross verify the libraries that they are compiled with TCL_MEM_DEBUG flag.
Will the Tcl source code tar file contain Solaris directory where i have to build the libraries or should i use the unix source code for solaris platform as well ?
Thanks
Are you using [mem] interactively (which does expansion of unambiguous short command names) and forgetting to use the full name ([memory]) in your scripts?
You're using Tcl embedded in your code? You need to call Tcl_InitMemory (passing in the handle to the interpreter where you want the memory command created) after creation of the interpreter and before you run user scripts, i.e., straight after the Tcl_CreateInterp gives you the handle (which should in turn come after the Tcl_FindExecutable call that initializes the shared parts of the library).
You must also make sure that everything is built with that flag set so that the correct memory allocation APIs are used in both your code when it integrates with Tcl, and you must make sure that you are linking against the debugging build. It's probably the linking that has gone wrong, but I've not done that level of development on Solaris for many years.
I think you'll find that “Getting a list of used libraries by a running process (unix)” is relevant to your problems.

Attaching GDB to Eclipse to debug JNI C++ code

I'm having problems debugging a JNI application. I've read several threads in StackOverflow, like this one, this one or this one. I've also tried to start gdb in a separated shell and attach it to the running java process. In both cases, the problem is the same: GDB can't find the sources to debug. Things tried
Add "dir" line to gdbinit, pointing to C++ sources folder
Adding the C++ sources folder to the GDB debbuging configuration in Eclipse, in the "Sources" tab.
Adding set environment LD_LIBRARY_PATH=/path/to/library.so, being library.so the library file built from C++ source files
Attach ddd to the java process, but then I get an error because pthread_join.c is not found in the working directory. I don't have this file in my hard disk. I don't know what is this about.
Nothing worked. I've spent several days on this. I know my bug is in the C++ code called by the JNI wrapper, but I can't debug it. Any hints? If helps, I'm running Eclipse Juno in Debian 7 under a Parallels VM on Mac OS.
Many thanks in advance,
You need to have debug information in your native library. You should pass -g to your compiler and linker to have this information in the executable. You may also want to add -O0.
As an alternative to attaching to the Java process, you can create a C++ app and debug it directly. You just need to link in the functions you want to test. In the main function, create the VM, register the functions with RegisterNatives, and kick off a Java test class the uses them.
Hopefully, the debugger has no problem finding the sources since it is just part of the normal compile/link/debug loop of a C++ app.
I would suggest to start with the latest ADT bundle. You can even download the Mac version, so you will not even need Parallels (see a detailed instructions). Then, choose Debug Android Native Application in launch menu.

How to Stop Perl EPIC eclipse plugin showing errors

My eclipse tries to compile/build Perl files in my Java project and fails. I installed Perl EPIC just for syntax colouring, how can I get it to ignore errors?
I tried going into Project->Properties->Builders, and uncheck Perl Epic, this didn't change anything.
I'm using Eclipse :Helios Service Release 1
Build id: 20100917-0705
On Windows XP
I have basically the same issue as this question,
How can I set up Eclipse to edit Perl without the runtime checking?
I've been looking into similar issue for quite some time too. Apparently the Epic Perl plugin goes wildly checking anything/folder/file it finds inside the project, so like mine where I have config files, data directories, it goes inside and tries to validate "perl stuff", which evidently is an annoyance: the error log view displays a lot of useless information.
Did you try to uncheck the "Perl Auto Builder" ?
I'm not parsing this sentence in the context of your question: "My eclipse tries to compile/build perl files in my java project and fails."
Are you saying that you are running perl as a java project, and getting the inevitable error message because it is not java? Just wondering why you don't want to have your perl program set up as a perl project possibly referenced by your java project, assuming that that is what you are trying to do.
Generally, when I set up a perl project, I edit its properties and set its includes to match the current directory or local module paths. Assuming that there are self-written modules I must call, and they are not located on this machine (e.g. I wouldn't have FOO::smb on a windows machine -- it makes no sense. When I am developing for linux, I will put all my functions in there for convenience's sake)
In that case, I create a FOO directory in the workspace, and create a dummy FOO::smb module with however many stub functions in it to get me going and let my syntax highlighting and error checkign do their proper jobs for me. If I write dummy subs to match the real modules well enough, I can debug my scripts somewhat before uploading them. I figure that I should be well enough aware of what they are supposed to do anyway.
I will go so far as to dummy out CPAN modules assuming that installing them on my development workstation makes no sense or is impossible. Highlighting and syntax checking are both invaluable tools, and finding a way to make both of them work saves my sanity.

What are the exact versions of stuff you have to install in order to be able to step-debug a Scala program?

How do YOU debug a Scala program?
I mean YOU as in the person posting the Answer :) Please answer only from personal experience, not from stuff you've heard or read on the Internet. You should not believe everything you read on the Internet, especially tales of complex open-source software configurations that actually work :-)
The are many Java tools which claim to support Scala in some way or another, but I have so far struck out in trying to get any one of them to actually let me set a breakpoint in Scala code and step through it. These are big, major open-source IDEs I'm talking about here.
The main problem in getting a debugger to work seems to be the "version hell" with fast-changing IDEs, Plug-Ins, JDKs, and the Scala language itself.
Hence, the more detailed re-statement of the question is appropriate: What is the exact version number of the IDE, Plug-In, JDK, Scala, and even Operating System, that you are successfully using?
My question is related to this one, but wider in scope:
How To: debug Scala code when outside of an IDE
Thanks
In our development we use IntelliJ IDEA 9.0.1 which is available by the link below:
http://www.jetbrains.com/idea/download/
with Scala plugin installed:
http://confluence.jetbrains.net/display/SCA/Getting+Started+with+IntelliJ+IDEA+Scala+Plugin
All you need is to have project with Scala sources (probably, mixed with Java or other JVM-based languages) opened. You can compile it and run as Java application, maven goal etc. or connect to the remote application if it has been run in debug mode.
See IntelliJ help for details of adjusting debug configuration.
Cheers!
Ilya
I've worked with Eclipse and the Scala plugin for it. It works somewhat ok, if you can overlook the fact that it doesn't remember the configuration for your Scala application on the next run.
I debug my Scala programs by running relevant parts of it on the REPL, as to verify what it is really doing. Other than that, the good old println or logs.
Digressing here a bit, it has been a rare thing in my life a situation where step-in debuggers were actually required -- and, then, mostly for assembler code, though languages where testing snippets of code is difficult for some reason were more likely to require it than others which weren't.
OS: xUbuntu(GNU/Linux) 9.10
JDK:
java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
(which is the Java-6-sun-version, used by the xUbuntu-installer).
Eclipse: 3.5.1 Build id: 20090920-1017
Scala-Plugin 2.7.7final
Scala 2.7.7
If possible: println-Statements, because eclipse is often tricky to invoke (does not find the main class, even after complete rebuild, closing/opening project, deleting old class-Files). The latest search for a problem ended when I 'deleted all bookmarks' - suddenly I was allowed to run the program.
Curious observation: class Bruch was what I tried to run, but eclipse allways mentioned 'Bruc' and named the runtime-configuration like this. Adding and removing characters reflected in the generated name accordingly (Bruc => Bru).