Compiling error after clicking Verify & Save Option for Java stack

Hi,

I have a java code that successfully connects to backend Unix Server & can fetch the desired results on the console without any prompt for pwd/user etc as I am providing that in the code itself for now.
My code requires external jar's jsch & jcraft which I already imported successfully.

We want to integrate this code using Integration studio.

Following are the steps I am following : 

1.Create extension-->Create Java code using eclipse of Integration studio.

2.run the code once -->The Java code runs successfully without any issues & bring the results on the console

3.Save the code & in Integration studio click on Verify & Save.

4.Getting compiling error as below : 




5.The compiling error logs are as below : 

J2EE Compilation.

Buildfile: C:\Users\*****\AppData\Local\Temp\Integration Studio\LfveLAfAy0yuBYE6mBAz9w\Source\J2EE\build.xml

clean:
  [delete] Deleting directory C:\Users\*****\AppData\Local\Temp\Integration Studio\LfveLAfAy0yuBYE6mBAz9w\Source\J2EE\bin
  [delete] Deleting directory C:\Users\*****\AppData\Local\Temp\Integration Studio\LfveLAfAy0yuBYE6mBAz9w\Source\J2EE\docs

init:

compile:
   [mkdir] Created dir: C:\Users\*****\AppData\Local\Temp\Integration Studio\LfveLAfAy0yuBYE6mBAz9w\Source\J2EE\bin
   [javac] Compiling 7 source files to C:\Users\*****\AppData\Local\Temp\Integration Studio\LfveLAfAy0yuBYE6mBAz9w\Source\J2EE\bin
   [javac] C:\Users\*****\AppData\Local\Temp\Integration Studio\LfveLAfAy0yuBYE6mBAz9w\Source\J2EE\SshConnectionManager.java:32: error: no suitable method found for setConfig(String,String)
   [javac]             session.setConfig("PreferredAuthentications", "publickey,keyboard-interactive,password");
   [javac]                    ^
   [javac]     method Session.setConfig(Properties) is not applicable
   [javac]       (actual and formal argument lists differ in length)
   [javac]     method Session.setConfig(Hashtable) is not applicable
   [javac]       (actual and formal argument lists differ in length)
   [javac] 1 error


BUILD FAILED
C:\Users\*****\AppData\Local\Temp\Integration Studio\LfveLAfAy0yuBYE6mBAz9w\Source\J2EE\build.xml:34: Compile failed; see the compiler error output for details.

Total time: 4 seconds


Please note that I am not facing this issue when running the code from Integration studio eclipse, but whenever I click on Verify in the studio then it gives compiling error. this looks strange


Since this is in preliminary stage I am not using any input / output parameters & simply pasting the java code in eclipse integration studio-->Importing my jar's etc.




Hi Saurabh,

Is SshConnectionManager.java a source file you created? Because as far as I can see, it has an error on line 32 of that file, and it can't find the setConfig method for the session object.

Solution

Hi Kilian,

We figured out the issue.

the jsch jar had an older version which was missing the overload

public void setConfig(String key, String value)

My jar version was com.jcraft.jsch_0.1.27.jar, which only has,


public void setConfig(java.util.Properties newconf)
public void setConfig(java.util.Hashtable newconf)

While the version jsch-0.1.42.jar has,


public void setConfig(java.util.Properties newconf)
public void setConfig(java.util.Hashtable newconf)
public void setConfig(String key, String value)


That is the reason we got the error,

error: no suitable method found for setConfig(String,String)
   [javac]             session.setConfig("PreferredAuthentications", "publickey,keyboard-interactive,password");
   [javac]                    ^


I was able to publish this without any compilation error. Thanks for your response.

Regards

Saurabh

Solution

Thanks for letting us know. Happy coding!