OSGi service: java.lang.UnsatisfiedLinkError calling DLL -- NO error when DLL called as unit test -


a java class made video coding loads dll including c++ code

unpacking debugging symbols videosource.dll \path checking videosource.pdb... checking videosource.pdb... 

and tries instantiate native (c++) class dll:

    // videosource() implemented in c++ , wrapped jni,      // wrapper files generated swig      _videoprovider = new generated.videosource();  

that works when java class executed junit test (video data extracted).

same thing not work when launch java class osgi service.

essentially, same code executed. dll still loaded instantiation of native (c++) class shown above throws exception:

    java.lang.unsatisfiedlinkerror: generated.videosourceswigjni.new_videosource()j 

what different when launch java class osgi service instead of executing junit test? can make work?



background
generated.videosource() is

    public videosource() {        this(videosourceswigjni.new_videosource(), true);     } 

videosourceswigjni.new_videosource() is

    public final static native long new_videosource(); 

c++ implementation is

videosource::videosource() {        // init frame count    m_frame_cnt = 0;    [..] } 

thanks, puce, pushing me bit. after asking "would have try @ all"? got answer relative quickly:

in order resume sources (1, 2, 3, 4) own words:

when native code, e.g. .so or .dll libraries, shall used in osgi bundle, corresponding libraries have declared in bundle's manifest.

the manifest file may either edited explicitely, stated in mentioned sources, or implicitely via appropriate plugin, e.g. apache felix, when using maven. used plugin configured in pom file , modify manifest automatically.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -