Ask Your Question
0

error when adding a third party dependency to a basic project

asked 2016-01-05 10:17:53 -0700

hpu gravatar image

I created a new project as part of learning ODL. I essentially followed the first few steps given in https://wiki.opendaylight.org/view/Op...Controller:MD-SAL:StartupProject_Archetype to create my project. Additionally I added code which has dependency on the third party snmp4j jar.

To include this dependency I added the following in impl/pom.xml under dependencies section.

<dependency> <groupid>org.apache.servicemix.bundles</groupid> <artifactid>org.apache.servicemix.bundles.snmp4j</artifactid> <version>2.3.4_1</version> </dependency>

If I do "mvn clean install" under impl directory everything goes through fine and I can see the snmp4j osgi packages downloaded in my local repository (~/.m2/repository/org/apache/servicemix/bundles/org.apache.servicemix.bundles.snmp4j/2.3.4_1)

But when I do "mvn clean install" for the main directory I get the following error.

Tests in error: Unresolved constraint in bundle org.opendaylight.proto.impl [205]: Unable to resolve 205.0: missing requirement [205.0] osgi.wiring.package; (&(osgi.wiring.package=org.snmp4j)(version>=2.3.0)(!(version>=3.0.0)))
Unresolved constraint in bundle org.opendaylight.proto.impl [205]: Unable to resolve 205.0: missing requirement [205.0] osgi.wiring.package; (&(osgi.wiring.package=org.snmp4j)(version>=2.3.0)(!(version>=3.0.0)))
Unresolved constraint in bundle org.opendaylight.proto.impl [205]: Unable to resolve 205.0: missing requirement [205.0] osgi.wiring.package; (&(osgi.wiring.package=org.snmp4j)(version>=2.3.0)(!(version>=3.0.0)))

Tests run: 4, Failures: 0, Errors: 3, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] proto-api ................................... SUCCESS [ 6.184 s]
[INFO] proto-impl .................................. SUCCESS [ 6.092 s]
[INFO] proto-features .............................. FAILURE [01:01 min]
[INFO] proto-karaf ................................. SKIPPED
[INFO] proto-artifacts ............................. SKIPPED
[INFO] proto ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

Here is the detailed stack trace for one of the errors.

Tests run: 4, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 56.171 sec <<< FAILURE! - in org.opendaylight.odlparent.featuretest.SingleFeatureTest installFeature(org.opendaylight.odlparent.featuretest.SingleFeatureTest)[repoUrl: file:~/odl/ws/proto/features/target/classes/features.xml, Feature: odl-proto 1.0-SNAPSHOT] Time elapsed: 15.025 sec <<< ERROR!
org.osgi.framework.BundleException: Unresolved constraint in bundle org.opendaylight.proto.impl [205]: Unable to resolve 205.0: missing requirement [205.0] osgi.wiring.package; (&(osgi.wiring.package=org.snmp4j)(version>=2.3.0)(!(version>=3.0.0)))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
at org.apache.karaf.features.internal.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:477)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:435)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:375)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:364)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:347)
at Proxyb610e232100a4a709cb0181a67099ac0.installFeature(Unknown Source)
at org.opendaylight.odlparent.featuretest.SingleFeatureTest.installFeature(SingleFeatureTest.java:207)
at sun.reflect ...












(more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-01-05 12:16:40 -0700

hpu gravatar image

updated 2016-01-05 12:17:18 -0700

I added the missing dependency in features/src/main/features/features.xml and now the compilation works fine. I added it under the main feature "odl-proto".

<feature name='odl-proto' version='${project.version}' description='OpenDaylight :: proto'>
<feature version='${mdsal.version}'>odl-mdsal-broker</feature>
<feature version='${project.version}'>odl-proto-api</feature>
<bundle>mvn:org.opendaylight.proto/proto-impl/${project.version}</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j/2.3.4_1</bundle>
<configfile finalname="${configfile.directory}/proto.xml">mvn:org.opendaylight.proto/proto-impl/${project.version}/xml/config</configfile>
</feature>
edit flag offensive delete publish link more
Login/Signup to Answer

Stats

Asked: 2016-01-05 10:17:53 -0700

Seen: 255 times

Last updated: Jan 05 '16