Software Defined Networking
1752340 Members
5744 Online
108787 Solutions
New Discussion

Re: Including 3rd party libraries

 
sepbot
Advisor

Including 3rd party libraries

I have some 3rd party libraries that I use with an application that I am currently developing. These libraries are not present in the Virgo repos of the controller. Unfortunately there are no OSGi bundles available that I can deploy to be consumed by my application either. So, how can I go about adding 3rd party libraries to the Virgo repos?

 

I have tried placing the .jar files and all dependencies in the watched directory of Virgo, however when I try to upload my application to the controller, I get a dependencies failed error message and the application remains in staged state.

4 REPLIES 4
sdnindia
Trusted Contributor

Re: Including 3rd party libraries

As per HP VAN SDN Controller Admin Guide document if an application is in staged state , the application can be installed [ page 15].

 

Alternately you can try  Application Manager Actions using cURL commands[ page 77].

 

Hope this helps.

Tomas_Kubica
Advisor

Re: Including 3rd party libraries

Tried that once - you need to convert library jar file into OSGi bundle before you place it in your virgo repository on controller. There are ways to make this conversion, search Internet. Then, if dependencies are correct in POM file of your application (if you use Maven) it should work for you.

Btw. what is what you need to add that is missing?
sepbot
Advisor

Re: Including 3rd party libraries

It was just some Apache related support libraries. I ended up making a new repository in Virgo and putting my libraries and their dependencies in there. In my case, I had to include several libraries, so I took this approach. However, if it is only one or two libraries that need to be included, you can use <Export-Package> option of Maven Bundle Plugin.

sdnindia
Trusted Contributor

Re: Including 3rd party libraries

Hi Sepbot,

 

Consolidating all the approaches to deploy a third party jar file for the application as below-

 

First approach:

1) Include the dependency for third party library in maven. This will make the build successful.

 

    <dependencies>

                        <dependency>

                           <groupId>org.erlang.otp</groupId>

                           <artifactId>jinterface</artifactId>

                           <version>1.5.3</version>

                        </dependency>

    </dependencies>

 

2) Export the thirdparty package you want to use.

    

    <build>

               <plugins>

                           <plugin>

                               <groupId>org.apache.felix</groupId>

                               <artifactId>maven-bundle-plugin</artifactId>

                               <extensions>true</extensions>

                               <configuration>

                                   <instructions>

                                       <Export-Package>

                                           com.ericsson.otp.erlang.*

                                       </Export-Package>

                                   </instructions>

                               </configuration>

                           </plugin>

                        </plugins>

    </build>

 

 

Second approach:

 

1)      Convert the third party jar file into osgi bundle

2)      Add the bundle to application zip file by editing the pom.xml in xx-app directory

3)      Edit plan file in xx-app directory to add the new bundle

 

Third approach:

 

1)      Create a new repository under opt/sdn/virgo/repository

2)      Edit org.eclipse.virgo.repository.properties to specify new repo

3)      Convert third party jar files into osgi bundles and deploy them into the new repo through virgo admin console

 

Please let us know if your problem is solved.

Please feel free to reply incase you have more questions around the same topic or open a new thread if new topic.

 

If you feel your question has been answered, please do let us know by marking this response as an  accepted solution.

Thanks
HP SDN Team