Wim Vanni wrote:Sounds like a very broad question to which in most cases people will tend to answer: go and read the manual, the tutorial, the documentation and whatnot. Have you tried anything yourself? Encountered specific problems? Are you sure your requirements force you to make use of smb? Could there be other possibilities? HTTP perhaps?
Cheers,
Wim
Hi Wim,
Thanks for the reply
. I have tried above scenario using Sftp protocol.
Here we are trying to connect using sftp protocol. Please check code to connect below. The connection is getting established but while reading the data we are getting NoSuchMethodError even though required method is found in the jar. Same error is not reproducible when we deploy the application in Windows server.
Connection Code :
uri = "sftp://" + Constants.MONITOR_SERVER_UNIXUSERID + ":" + Constants.MONITOR_SERVER_UNIXPASSWORD + "@"
+ server IP+Constants.MONITOR_SERVER_UNIXFILEPATH+"IIS
linuxFileName = getLatestMonValFileFromLinux(Constants.MONITOR_SERVER_UNIXUSERID, Constants.MONITOR_SERVER_UNIXPASSWORD, instanceName, Constants.port, Constants.MONITOR_SERVER_UNIXFILEPATH+"IIS/");
FileObject fo = fsManager.resolveFile(completeURL.trim(), fsOptions);
if(fo.getContent() !=null){ -------- At this point, while reading data following exception is occurring.
Exception details :
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
………………………………………………………………………..
………………………………………………………………………..
Caused by: java.lang.NoSuchMethodError: com.jcraft.jsch.ChannelSftp.isClosed()Z
at org.apache.commons.vfs.provider.sftp.SftpFileSystem.putChannel(SftpFileSystem.java:158)
at org.apache.commons.vfs.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:148)
at org.apache.commons.vfs.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:75)
at org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileObject.java:1296)
at org.apache.commons.vfs.provider.AbstractFileObject.getContent(AbstractFileObject.java:1041)
Lot of experiments but no use. So I thought to use smb protocal but I am not able to get any clue regarding this.