Reputation: 3262
I am very new in Java Spring framework. I have created a custom bundle and want to deploy the jar/bundle in virgo server.But I am not able to successfully do so.
Here is my template.mf file screen , where I have added the dependency
Here is my java file , where I have imported the packages
Here is the original jar file screen
Here is my pom.xml
where I have added the dependency
But once deploying the jar file after maven build (which throws no error ) I am constantly getting the error
Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.xyz.costfromsap.application' at version '1.4.0.RELEASE': Cannot resolve: com.xyz.costfromsap.application
Resolver report:
An Import-Package could not be resolved. Caused by missing constraint in bundle <com.xyz.costfromsap.application_1.4.0.RELEASE>
constraint: <Import-Package: com.sap.conn.jco; version="[3.0.0,4.0.0)">
Here is my updated dependency jar file after converting it to OSGI bundler
I have also updated the template.mf
and pom.xml
But still the issue persists.
Upvotes: 0
Views: 1901
Reputation: 21923
The issue is the sapjco3.jar
is not an OSGi Bundle. It is just a plain old Jar file. You need convert it to an OSGi bundle. In Eclipse or any Eclipse variant follow the following steps. You can use Import-Package
on only the packages which are listed in Export-Package
in bundle MANIFEST.MF
New -> Project
Plugin from Existing Archive -> Add External and load your Jar and Click Next.
Give a name and Select an OSGi Framework radio button and Click finish.
Now you will have a new Project created. Go to MANIFEST.MF
file and Runtime tab and Export Packages, Click Add button and select all the packages listed.
Finally your MANIFEST.MF
should have Export-Package:
with all the packages just as following.
And now Right Click on the project and Click Export and Select Java -> Jar File.
Select files to export. Ignore Eclipse specific files and pom files.
Click next until you see Manifest Selection and Select Use existing manifest option and select the MANIFEST.MF
in META-INF in the project.
Click finish and Use that Jar in your Virgo server. Place it either in VIRGO_HOME/repository/usr.
Upvotes: 1