Software Defined Networking
1748156 Members
4123 Online
108758 Solutions
New Discussion юеВ

Re: Newbie question: simple application

 
SOLVED
Go to solution
dgonzalezmas
Frequent Visitor

Newbie question: simple application

Hello Everybody, I started evaluating the hp sdn van controller. Despite I read the SDN Controller Programming Guide I have found the programming model quite hard (due to my programming limitations). So, what I want to do, just for test, is to develop a module that gets all the switches and hosts in a net and write their mac in a logfile or in an output.
Could anybody help me or post an example?
Thanks very much in advance
 
David
7 REPLIES 7
vandewilly
Advisor

Re: Newbie question: simple application

Hi dgonzalezmas,

I created a simple sample application to illustrate how to handle a packet in and log the dpid from each switch in the network. You can take a look in the MyListener class inside the sample-bl project. I hope this has helped you. Feel free to ask anything that you want about this code.

Regards,

dgonzalezmas
Frequent Visitor

Re: Newbie question: simple application

Hi vandewilly,

I appreciate very much your help.

Building the application I got the following error:

 

 

[ERROR] Failed to execute goal on project sample-app: Could not resolve dependencies for project com.hp.sample:sample-app:pom:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT, com.hp.sample:sample-api:jar:1.0.0-SNAPSHOT: Could not find artifact com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project sample-app: Could not resolve dependencies for project com.hp.sample:sample-app:pom:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT, com.hp.sample:sample-api:jar:1.0.0-SNAPSHOT: Could not find artifact com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT

at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)

at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)

at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)

at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)

at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)

at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)

at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)

at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.hp.sample:sample-app:pom:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT, com.hp.sample:sample-api:jar:1.0.0-SNAPSHOT: Could not find artifact com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT

at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)

at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)

... 22 more

Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT, com.hp.sample:sample-api:jar:1.0.0-SNAPSHOT: Could not find artifact com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT

at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)

at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)

... 23 more

Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT, com.hp.sample:sample-api:jar:1.0.0-SNAPSHOT: Could not find artifact com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT

at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)

at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)

at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)

... 24 more

Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact com.hp.sample:sample-model:jar:1.0.0-SNAPSHOT

at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:528)

... 26 more

[ERROR]

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR] mvn <goals> -rf :sample-app

 

 

I guess that I need to resolve some dependencies, but what dependencies?

Since I am newbie in this way of develop applications I am quite lost.

Thanks in advance

vandewilly
Advisor
Solution

Re: Newbie question: simple application

Sorry,

 

I forgot to remove some dependencies in the pom.xml of sample-app project. This new attachment is ok.

 

Thanks

dgonzalezmas
Frequent Visitor

Re: Newbie question: simple application

Hi vandewilly,
thank you very much for your fast response. I'll try it.
I supose that the output for the logger is /var/log/sdn/virgo/logs/log.log, isn't it?
Thank you

vandewilly
Advisor

Re: Newbie question: simple application

dgonzalezmas,

 

You can find the log in the following path: /opt/sdn/virgo/serviceability/logs/log.log

 

dgonzalezmas
Frequent Visitor

Re: Newbie question: simple application

Thank you very much,
this example allowed me to understand a bit more the development model. Sinde I'm newbie in OSGi the example application in the Programming Guide, for me, its quite hard for the first application ;)

sdnindia
Trusted Contributor

Re: Newbie question: simple application

Hello Dgonzalezmas,

 

Doing a quick follow up to check if you need any further assistance in your application development. Do let us know if we can be of your assistance in anyway.

 

Please do reply if the query is related to the same topic or open a new thread if its new topic.

 

Thanks

HP SDN Team