Re: Using the NETCONFX-3.0

92 views
Skip to first unread message
Message has been deleted

A.V.

unread,
Oct 8, 2015, 9:56:02 AM10/8/15
to NetconfX
Yes, the client.setup() call changed to take in an extra parameter (as you discovered). I will update the documentation to reflect that. You can just pass in NULL like you did.

I don't know what the NullPointerException issue is - could be something in your code. If you want to see how to use SshTransportClient, please take a look at the class com.centeredlogic.net.netconf.transport.ssh.SshTransportClientTest (which allows you to send in a NETCONF XML request from a file and receive a response). This should serve as a good example.


On Wednesday, October 7, 2015 at 8:44:00 PM UTC-4, Giorge Vanz wrote:
Hello,

This is a great library. I made a simple modification so I could use it against a Cisco 2921 and following the Developer's Guide V3.0 I do not even compile.


Code....


   System.out.println("Setting up SSH transport client .. ");
   SshTransportClient client = new SshTransportClient();
   Properties properties = new Properties();
   properties.put("host", "xx.xxx.xx.xx");
   properties.put("socketTimeout", "5000");
   properties.put("port", "22");
   properties.put("username", "user");
   properties.put("password", "password");
   client.setup(properties);
   System.out.println("SSH transport client setup complete.");

Compilation error....


error: method setup in class SshTransportClient cannot be applied to given types;
        client.setup(properties);
  required: Properties,HelloResponseProcessorIf
  found: Properties
  reason: actual and formal argument lists differ in length
1 error

--------------

And tested using HelloResponseProcessorIf as follows but to no avail.

HelloResponseProcessorIf htIf = null;
        Element request = XmlUtils.fromXmlFile("c:\\hello.xml");
        htIf.processHelloResponse(request);
        client.setup(properties, htIf);
        client.connect();

Compilation error...

Setting up SSH transport client .. 
Exception in thread "main" java.lang.NullPointerException
at testenetconfx.NewClass.main(



Thank's for your help

Reply all
Reply to author
Forward
0 new messages