Software Defined Networking
1751960 Members
4604 Online
108783 Solutions
New Discussion

How to install SDN

 
MatthewHart
Advisor

Re: How to install SDN

Hi Team,

 

I tried all of the steps in the order specified and I still have the same issue.

  • install-sdk works
  • gen-sdn-apps works
  • mvn clean install on fresh gen-sdn-apps works and I get hm-app/target/hm-1.0.0-SNAPSHOT.zip
  • mvn eclipse:eclipse works
  • Importing the project works.

 

 

I was fiddling around within eclipse and I found that in some of the created folders (hm-rs and hm-ui) I can see some of the com.hp.of.* libraries, whereas in others (hm-model, hm-bl and hm-api) I cannot see any part of the com.hp.of.* library.

Curiously, I cannot see the part of the API that I need in any folder (namely com.hp.of.ctl.*).

 

I've attached images to help illustrate this for you.

 

 

I've also attached the images of Libraries, Order and Export for you.

 

 

--

Regards,

Matthew Hart

sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew,

Since you were successfully able to do  install command (mvn clean install) and generate the zip file in the target directory  and after this you created eclipse project (mvn eclipse:eclipse) so by default in health monitor app files( for e.g. DeviceHealthManager.java ) there will be some import statements

(for e.g. import static com.hp.of.lib.msg.Port.NONE; )which are resolved there automatically in eclipse.

Also you can put import statements for com.hp.of.* and check if DeviceHealthManager.java file still resolves the import.
If this is not the case for your Health Monitor apps files then there is some problem  either with install command or with creating eclipse project.

As per the screenshots shared by you, the file (View from rs and ui i.e. OpenFlowSwitchResourceTest.java)  contains sdn-of-lib-2.0.0.jar as in the referenced libraries(you can see the same in Project Explorer) so you are able to see some com.hp.of.* however the file (View from bl model and api i.e. OpenFlowSwitchManager.java) doesn’t contain any sdn-of-lib-x.x.x.jar file so you don’t see the same imports resolve there.

Since you are using 2.3.5 version SDK so you should include sdn-of-lib-2.3.5.jar .
You can include jars manually as below-
1.    Right click on project ,select properties then java build path
2.    There in library tab you can click add external jars
3.    Then you can specify the path(for e.g.  ~/.m2/repository/com/hp/sdn/sdn-of-lib/2.3.5/ sdn-of-lib-2.3.5.jar)

Please let us know if this helps or you still face the issue.

Thanks,
HP SDN Team

MatthewHart
Advisor

Re: How to install SDN

SUCCESS!!

 

It appears that the M2_REPO environment variable misses a chunk of libraries! Once I manually added the JARs I required, the imports succeeded!

 

The issue now becomes that, even though Eclipse now see's all of the libraries and appears to be happy - when I try to build the project via the "mvn clean install" command, mvn has an error and believes that it cannot find the JARs, even though eclipse now says it's happy.

 

How do I add these JARs into mavens build environment?

 

 

--

Regards,

Matthew Hart

MatthewHart
Advisor

Re: How to install SDN

I managed to find a solution to this by deleting .m2 and putting it in again.

 

There was also an issue with java being on version 1.7.x but javac being on version 1.6.x

 

 

Thanks to everyone for their help on this.

 

 

 

--

Regards,

Matthew Hart

sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew,

 

We are glad that your problem is solved.

Please do let us know if you need further assistance.

 

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

 

Thanks

HP SDN Team