A webapp using native code works fine in Glassfish 2.x.
In 3.1.1, it fails with:
[#|2012-04-18T14:43:08.330+0000|SEVERE|glassfish3.1.2|com.sun.jersey.spi.container.ContainerResponse|_ThreadID=21;_ThreadName=Thread-2;|The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.UnsatisfiedLinkError: com.basistech.rnt.jni.initializeEnvironmentSpecificRootDirectory(Ljava/lang/String;)Z
at com.basistech.rnt.jni.initializeEnvironmentSpecificRootDirectory(Native Method)
Note that this is the version of the linkage error that complains about a particular symbol, not about the entire library.
The very same JNI lib works fine run from a sample Java program outside of Glassfish on the very same machine.
Reading the JDK source, this would seem to be possible only if dlsym (we're on Linux) fails to return the symbol. (This is all Java 1.6.x.) I'm stumped as to what Glassfish could possibly be doing that would cause dlsym to fail to see this symbol in the shared lib.
Any ideas out there?
Related
I am writing C++ addons for an Electron.JS application which calls macOS native APIs. Some of the API calls are introduced in the newer versions of macOS: (say an API call that is introduced in macOS 12).
But I want my application to work for the older versions of macOS so I wrapped the code that uses the API in an if block such if (#available(macOS 12, *)) { ...}.
In the electron app, when node js loads the addon, it crashes on the older versions of macOS telling that the API symbol is missing:
Termination Reason: DYLD, [0x4] Symbol missing
Dyld Error Message:
Symbol not found: ---API method---
Referenced from: /var/folders/*/.com.mobeus.mobeglass.LMWnli
Expected in: flat namespace
Although I do not call the method but it crashes on dlopen when in Javascript I call const addon = require('addon')
I know that there are lazy and immediate ways of resolving symbols for the shared library but I am not sure how to set it from the Electron (or NodeJS) application and whether it will solve my problem.
I am using a already developed C++ dll in my asp.net code to make compression/decompression of the data. It works well on my developer machine and some other machines too. I have a client machine which is fresh(No fancy installation of various tools) and When it tries to call that dll it generates an exception.
Exception:Could not load file or assembly 'dllcode, Version=1.0.5754.25819, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I would like to know that which dependencies are missing on Client fresh machine?
Note: I am trying to call C++ dll in a windows service which is having asp.net 4.0 framework. This call is executing perfectly on my developer machine but generates above exception on my client machine.I do not have deep knowledge about c++ library and it's dll. From basic troubleshooting I tried to install various combinations of "microsoft visual c++ 2010 runtime" but it did not help.
Update: Somehow I find source code of this C++ dll and now I am trying to check if I can build this dll any version specific.
I got this resolved. What I did is, I had to create separate setups(32-Bit & 64-Bit). Also VC++ run time was needed on server. So I installed them and it worked.
Hope this help to any one if he faces the same issue.
I have a weird problem that will make me crazy since 3 days.
I'm generating a client stub(xmlbeans) using axis from a wsdl file then using it to call Ms CRM web service.
My webservice call is working fine in eclipse (having added generated xml resources to classpath) and when i export everything to my jboss server I'm getting this error:
the cause is 'java.lang.reflect.InvocationTargetException'
java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
XMLStreamException is within the xmlbeans-2.3.jar file which is included within the dependencies in the server side so I can't understand why it stops working when deployed to jboss.
JDKs version are exactly the same as well as lib jars.
Any ideas please.
Thankss
Applies to versions <= 3.17 (Java 6):
This error indicates that the class XMLEventFactory does not provide functionality which POI is depending upon. There can be a number of different reasons for this:
Outdated xml-apis.jar, stax-apis.jar or xercesImpl.jar:
These libraries were required with Java 5 and lower, but are not actually required with spec-compliant Java 6 implementations, so try removing those libraries from your classpath. If this is not possible, try upgrading to a newer version of those jar files.
Running IBM Java 6 (potentially as part of WebSphere Application Server):
IBM Java 6 does not provide all the interfaces required by the XML standards, only IBM Java 7 seems to provide the correct interfaces, so try upgrading your JDK.
I used to profile a c++ app developed with eclipse CDT using valgrind (memcheck+helgrind). The application uses a static lib (libpodofo.a). After I modified and rebuild the library(podofo) the application runs fine, but valgrind says
Launching myapp(1)" has encountered a problem. Error starting process (Cannot parse PID from output file).
I have no idea where to start. Any idea?
The error apparently occurs when it tries to make calls from the library (judging by console output).
I don't know what code I could post since app runs without error.
Library is podofo.
Found the problem.
It was the code(obviously) it was a variable that hadn't been initialized, valgrind was actually killed by a null pointer.
I need to debug JNI issue of a team member. The problem is in a Java app interfacing a USB connected hardware using JNI. He mentions that JNI functions implemented in a C++ dll are not getting called by Java app. Also he specifically mentioned that it is a not an unsatisified link error problem, which was the first thing I would suspect.
The strange thing is that the Java App works fine on his development system and the JNI calls are being made properly. However on the target machine of the QA team, the Java app does not seem to work.
The DLL (32-bit) was generated using VS2010 and the target machine was WinXP/Win 7 32-bit system. I would rule out DLL method signature issue since DLL was recognised on the development system. As mentioned, it was not link issue.
What could be the issue in JNI methods not getting invoked at all? Could this be a problem with redistributables? How to debug (using JVM options) and ascertain the problem?
Standard debugging procedure:
set breakpoint in Java
run to breakpoint
attach debugger to java executable (visual studio attach by process ID)
set breakpoint in JNI.
continue Java program.