Software Defined Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with HP SDN workshop written by Tomas Kubica

 
SOLVED
Go to solution
Highlighted
Frequent Advisor

Problem with HP SDN workshop written by Tomas Kubica

Hello, 

 

I've just received the "HP SDN developer workshop" document and have a problem:

 

I've first generate the sceleton application with:

 

$ ./gen-sdn-app    /Users/admin/Documents/DataSerge/DEVELOPEMENT/HP/sdn-apps/myfirstsdnapp myfirst unil MyFirst "Example HP"  "unil-ci" "ma premiere application" myfirst

 

Then I've import the project to eclispe: 

 

$ mvn eclipse:eclipse

 

Then I've  add the following into the  MyFirstManager class:

 

    @Activate

    void activate() {

         logger.info("MYFIRST: Hey, seems like our app is being activated !");

    }

 

Then I've compile the project (mvn clean install) and installed it on the HP VAN controler without any problem.

 

After the deployement of the application, I've examinated (like mentioned into the tuto) the Virgo log file to see if my log will be present:

 

tail -f /opt/sdn/virgo/serviceability/logs/log.log | grep MYFIRST

 

I have 

 

"[2014-02-26 16:11:28.198] INFO  start-signalling-9           org.eclipse.virgo.medic.eventlog.default                         DE0005I Started plan 'Example HP' version '1.0.0.SNAPSHOT'. "

 

but no message that looks like (as mentioned in the document): 

 

[2013-12-18 01:36:35.053] WARN  t Resolve Thread (Bundle 81) com.hpworkshop.myfirst.impl.MyFirstManager                       DE0005I MYFIRST: Hey, seems like our app is being activated !

 

It seams that the methode "activate" is note executed ?

In the GUI of Virgo, I can see my application deployed.

 

I've continued the tuto but I've never see message in relation with the following instruction : 

        logger.warn("MYFIRST: Binding controller service");

       logger.warn("MYFIRST:  DataPath event " + event.toString());

 

 Do you see the problem ?

3 REPLIES 3
Highlighted
Frequent Advisor

Re: Problem with HP SDN workshop written by Tomas Kubica

After some investigation, I know now that  my acticate methode works, thanks to my alertService.

Here is my code:

 

@Activate

    void activate() {

         logger.info("MYFIRST: Hey, seems like our app is being activated !");

         alertService.post(Severity.INFO, alertTopic, "MYFIRST", "SERGE: ACTIVATE EXECUTE");

    }

 

alertServie.post works: I have a message into the controler ALERT GUI. 

logger.info  doesn't works:  I have no message into "/opt/sdn/virgo/serviceability/logs/log.log".

 

An idea ?

Highlighted
Advisor

Re: Problem with HP SDN workshop written by Tomas Kubica

Hi,

 

I am glad you have decided to learn programming for HP VAN SDN Controller !

 

Please note that document you are refering to is not public one and has been designed for one specific workshop. There are official learning materials including ExpertONE training that are better. Feel free to post questions here, just bear in mind others do not look into the same text :)

 

Now - not sure why logging does not work for you. I would suggest to check whether your import include logger from

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

 

since there might be more implementations with the same name.

 

You might also try to get reference to logger globally in main class:

 

private final Logger logger = LoggerFactory.getLogger(yourappname.class);

 

Good luck with developing apps for HP controller !

 

Tomas

 

 

 

Highlighted
Trusted Contributor
Solution

Re: Problem with HP SDN workshop written by Tomas Kubica

Hello sbotkine,

 

We hope the response from Tomas answers your query.

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 query is resolved please let us know my marking the post as an “accepted solution”

 

Thanks

HP SDN Team