How to load a dll in Karaf container? - dll

I have a dll which provides a simple functionality (called HelloCpp.dll) and
I need to access to the content of this library from Karaf container via REST calls.
I created a simple maven bundle which provides the REST api and a class (HelloJNI) which loads HelloCpp.dll using: System.loadLibrary("HelloCpp");
I have also addressed this dll in my POM file using: <Bundle-NativeCode>HelloCpp.dll</Bundle-NativeCode>
I have coppied the dll in both project directory and also karaf/lib folder.
I can successfuly install the bundle and I don't receive any compilation error as well, but when I deploy my bundle into Karaf container and try to start bundle, I get this error message: No matching native libraries found.
Could you please help me to solve the problem? Maybe I don't address the dll correctly in the POM file.
Thanks in advance,
Mandana

Related

Calling *.aar files (android library) in nativescript vue

I already create an .aar (android library) files in android studio and want to call/use it in nativescript-vue project.
I have placed the aar file in "app/App_Resources/Android/libs" folder.
Based on my reading, in typescript the way to call the method in aar files is by calling com.package.MyClass.
My question is , how to call it in .vue files. I have tried to call the method using the same approach but its produce an error :
Module not found: Error: Can't resolve com.package.MyClass
Can someone please help me on this.
Your help is very much appreciated.
You may simply place your AAR file in your App_Resources/Android/libs directory, CLI will pick it up at build time and the native APIs should be available at runtime within your project.
Try a clean build if you see errors, make sure the AAR is picked up. You might be able to verify it from the CLI logs. If you still see issues, make sure the class you are trying to access is public.
I'm not sure it's possible to use the android lib directly in the main project or not. In my way, I create a NS plugin that includes the .aar library, then add this plugin to the main project & use the methods defined in the .aar library without problem.
If you place the .aar library in the main project, you should check if that .aar library is installed by running tns build command & look at console log. If it's installed together with the project, that means you can use the lib method in .vue or any .js files.

not found (404) error in dnn

I have created a module named "Module Example" on cristoc for dnn and after build that I want to make the release of that module. It show me an error below.
Error 2 The "MSBuild.Community.Tasks.XmlRead" task could not be loaded from the assembly C:\inetpub\wwwroot\websites\dnndev.me\DesktopModules\Module Example\\packages\MSBuildTasks.1.4.0.61\tools\MSBuild.Community.Tasks.dll. Could not load file or assembly 'file:///C:\inetpub\wwwroot\websites\dnndev.me\DesktopModules\Module Example\packages\MSBuildTasks.1.4.0.61\tools\MSBuild.Community.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Then I have to try some nuggets to Install like "nuget install packages.config" and "Install-Package Newtonsoft.Json". After installing both nugets, click on build and make release of this module and release created successfully at C:\inetpub\wwwroot\websites\dnndev.me\DesktopModules\Module Example\install and release name Module_Example_00.00.01_Source it is a zip folder. After that for installing this module on dnn environment, I open my dnn site "dnndev.me" and after login on it, hover on host and click on extension and after that click on Install extension button and browse the location of the folder and click on "Next" button. But after that an error occur on installing this module.
Failure File specified in the dnn could not be found in the zip file: - C:\inetpub\wwwroot\websites\dnndev.me\Install\Temp\1cjkvd5v\bin\Module_Example.dll
And my on DNN environment Not found(404) error also comes. Why? I don't understand what happens. Kindly suggest me waiting for reply. Thanks
I don't know those components but I think the generated package is a source package inspite of the release package you're waiting for.
Then, it probably doesn't contain the corresponding generated assembly. I suggest you to open the zip to verify the presence of "Module_Example.dll".
Does this dll exist in your development environnment? Does your ascx use "codebehind" or "codefile"? With codefile mode, you don't need to upload the dll but the source file (vb.net ou C#).
I hope it helps you.

Deploying file to WebLogic - Error: Unresolved Webapp Library references

I received this error on deploying the file to WebLogic.
Should I make any alteration to the Weblogic.xml file?
Error: Unresolved Webapp Library references for "ServletContext#8793091[app:casman-jsf-3 module:casman-jsf-3.5-SNAPSHOT.war path: spec-version:2.5]", defined in weblogic.xml [Extension-Name: jstl, Specification-Version: 1.1, exact-match: true], [Extension-Name: jsf-myfaces, Specification-Version: 1.1, exact-match: true]
To fix this, I had to take the following steps (I am developing using Eclipse and deploying to Weblogic 10.3.5):
REMOVE weblogic.xml from the /WebContent/WEB-INF/ directory
Add needed jars to your lib directory (/WEB-INF/lib/) including JSTL.jar
Add project libraries to your Deployment Descriptor
Install EAR or WAR to Weblogic
This resolved the issue.
the error is because some library referenced in the Weblogic.xml is not being accessed during deployment.
try to call all the referencing libraries through run (Windows OS). Like if you have some reference to a library called \systemlib\alllibs\lib1.jar, then go to run and try calling in the library file or see manually if you can access the file in the server.
If the file is present then for unix/linux server, check if there are no access rights issue on the system. like if the library was placed by the root user and the weblogic user(Application server) does not have rights to read or write on the library folder. Remove any such issues.
Lastly, since the error specifically says JSTL, therefore check if the JRE version and JSTL version are in sync.
If still the error is not resolved, then please share the weblogic.xml also
Do a deep search of "jsf" in your wlServer\common\deployable-libraries folder .
Find the library corresponding to that extension and install it into your server.
Re-deploye the application
It worked for me

Calling native method from eclipse plugin

I am succeeded to call a c++ library from my JAVA code using JNI.Now I want to load the same. dll from a eclipse plugin and call the library functions.I kept the library in root directory of the plugin folder .
I am getting error like:
Caused by: java.lang.UnsatisfiedLinkError: testproj.testClass.testCall:()V
please help me to resolve that.Why the same code working for Java but not working from plugin?
Got it the package and class name should be same in the plug in and also the dll should be in the same root folder of the .java file where u load the library

Apache Felix Bundle Repository - Calling from another bundle

I have a simple test program which is designed to consume the Apache Felix Bundle Repository bundle service however I am having trouble configuring it through eclipse.
I am using the jar for the bundle (org.apache.felix.bundlerepository-1.4.0.jar) as an referenced library and have added it to the classpath in the manifest.
When I try to start my bundle it gives the error:
java.lang.ClassCastException: org.apache.felix.bundlerepository.RepositoryAdminImpl cannot be cast to org.apache.felix.bundlerepository.RepositoryAdmin
I can't add org.osgi.service.obr to the list of imported packages in my bundle (as it doesnt resolve) and I think this is the reason for the issue.
Any ideas?
Thanks
This was resolved by including the Apache Felix Bundle Repository bundle (org.apache.felix.bundlerepository-1.4.0.jar) in the eclipse/plugins folder which allowed me to reference the org.osgi.service.obr package in the list of imported packages in the manifest.