Closed amarsico closed 8 years ago
@amarsico I am not a maven expert so I am just doing what works for me. There might be better solution.
The changes you did look okay and you seem have more knowlege about the maven stuff. So I went ahead and merged the changes into master
Thank you very much @schwabe, I hope that these changes will work correctly also in other environments. If I have other changes that may help, I'll let you know.
That change broke loading the core in karaf:
org.osgi.framework.BundleException: Unresolved constraint in bundle core.logpub [68]: Unable to resolve 68.15: missing requirement [68.15] osgi.wiring.package; (&(osgi.wiring.package=eu.netide.core.api)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve 65.16: missing requirement [65.16] osgi.wiring.package; (&(osgi.wiring.package=eu.netide.lib.netip)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve 64.3: missing requirement [64.3] osgi.wiring.package; (osgi.wiring.package=org.javatuples)]]
Any quick idea how to fix that?
Hi @schwabe, the problem is in the feature.xml file. After the modification that I suggested, you should load dynamically the libraries/bundle that you need.
I analyzed your feature.xml file, you should add the following code before loading the netip library.
<feature name="netide-core-api" start-level="70">
<bundle>wrap:mvn:org.javatuples/javatuples/1.2$Bundle-SymbolicName=javatuples&Bundle-Version=1.2&Export-Package=org.javatuples;version="1.2"</bundle>
<bundle>mvn:org.onosproject/openflowj/0.9.0</bundle>
<bundle>mvn:eu.netide.lib/netip/1.0.0.0-SNAPSHOT</bundle>
<bundle>mvn:eu.netide.core/core.api/1.0.0.0-SNAPSHOT</bundle>
</feature>
Adding these lines allows the OSGi runtime to load the Javatuples library as a bundle and the OpenflowJ library from ONOS.
Let me know if it works
No, sadly it doesn't. Karaf complains on installing that it cannot find the openflowj
karaf@root()> feature:install netide-core
Error executing command: Can't install feature netide-core/0.0.0:
Error resolving artifact org.onosproject:openflowj:jar:0.9.1: Could not find artifact org.onosproject:openflowj:jar:0.9.1 in central (http://repo1.maven.org/maven2/)
I tried using the onos suffix in the version number but that gives even more strange errors:
Error executing command: Can't install feature netide-core/0.0.0:
Jar is not a bundle, no Bundle-SymbolicName mvn:org.onosproject/openflowj/0.9.1.onos
Hi @schwabe, I resolved the issue, you can find the resolution in my pull request. For Karaf we have to take care of dependencies. The only issue comes when loading the OpenflowJ library. Karaf prints an error but all the NetIDE CORE components work correctly.
Remember that the CORE uses featuresv3.xml as features file.
The error looks really scary. I think we should fix it. Unfortenately my OSGI knowledge is too little to make any sense out of that error.
I haven't found a solution until now, It happens when loading the OpenflowJ library and I don't know why. Unfortunately, Karaf doesn't explain anything useful. I'll try to resolve it.
Today I hit another problem with your changes:
Exception in thread "ZeroMQBasedConnector Receive Loop" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap
at org.projectfloodlight.openflow.protocol.OFOxmList.<clinit>(OFOxmList.java:27)
at org.projectfloodlight.openflow.protocol.ver13.OFMatchV3Ver13.<clinit>(OFMatchV3Ver13.java:42)
at org.projectfloodlight.openflow.protocol.ver13.OFFactoryVer13.<clinit>(OFFactoryVer13.java:628)
at org.projectfloodlight.openflow.protocol.OFFactories$GenericReader.readFrom(OFFactories.java:66)
at org.projectfloodlight.openflow.protocol.OFFactories$GenericReader.readFrom(OFFactories.java:49)
at eu.netide.lib.netip.NetIPUtils.toOpenFlowMessage(NetIPUtils.java:129)
at eu.netide.lib.netip.NetIPUtils.ConcretizeMessage(NetIPUtils.java:43)
at eu.netide.lib.netip.NetIPConverter.parseConcreteMessage(NetIPConverter.java:18)
at eu.netide.core.connectivity.ShimManager.OnDataReceived(ShimManager.java:47)
at eu.netide.core.connectivity.ZeroMQBasedConnector.run(ZeroMQBasedConnector.java:110)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableMap not found by org.onosproject.openflowj [65]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
I think for the moment I will revert the changes since they seem to break various parts of the core
Dear @schwabe, I found various issues when using the NetIP library with ONOS. There are many conflicts, caused by the
<Export-Package>
in the NetIP bundle, since the OpenFlow library between ONOS and NetIP are the same.I found a possible solution and this was changing a little bit the POM.XML, in particular the instructions of the maven-bundle-plugin. For the sake of clarity, I committed the change on a separate branch, so you can analyze the code.
https://github.com/fp7-netide/Engine/commit/147b6e7c18a1efefe30380964a28f4ab33702ec2
In my opinion, it is important that the library should be stand alone. However, we have to understand if it can live as a separate package for CORE, ONOS or ODL.
My question are:
Thanks