Closed athukuria closed 8 years ago
Hi athukuria,
Thanks for getting in touch with us! For me it is not entirely clear what you are trying to achieve. You want to make a HTTP call from within your agent code? In that case it would make sense to use a library.
There are two ways to do that:
To include a JAR in your bundle:
lib
directory in your Eclipse Project and add the jar to itInclude-Resource: lib/yourlibrary.jar
version=file
to your buildpath in bnd.bnd:-buildpath: \
${pm-buildpath},\
lib/yourlibrary.jar;version=file
Hope this helps!
@wilcowijbrandi thanks for the reply, I have solved the above problem with adding http Servlets and changing versions.
Now I am trying to add a sqlite-jdbc-3.7.2.jar library in net.powermatcher.remote.websockets\lib
here is my bnd.bnd file:
-buildpath: \ ${pm-buildpath},\ net.powermatcher.core;version=latest,\ com.google.gson,\ org.apache.felix.http.servlet-api;version=latest,\ org.apache.felix.http.jetty;version=latest,\ lib/sqlite-jdbc-3.7.2.jar;version=file -includeresource: \ {OSGI-INF/permissions.perm=permissions.perm},\ lib/sqlite-jdbc-3.7.2.jar,\ ../cnf/gradle/LICENSE.txt Include-Resource: lib/sqlite-jdbc-3.7.2.jar
-sub: *.bnd
Even after this I see below exception:
java.lang.ClassNotFoundException: org.sqlite.JDBC not found by net.powermatcher.remote.websockets.client [11] java.lang.ClassNotFoundException: org.sqlite.JDBC not found by net.powermatcher.remote.websockets.client [11]
Do I need to add different library !? This library works in normal Java application.
Thanks for the support.
I have taken sqlite-jdbc-3.8.11.2.jar which is a osgi bundle. added in bndtools release repositories and added bunlde in demo.bndrun and client.bnd customized imports (org.sqlite). That's it worked.
Hello All,
I am trying to add some example code in "net.powermatcher.examples" in my test file where http client request are made. below method is called from PVPanelAgent.java activate method.
Also updated net.powermatcher.examples.bnd.bnd file with jar files entry
After this source is comping and when I run I see below error:
Not sure how to fix this. What is the right process to add new libraries in powermatcher source?
Thanks for the support.