Import com.jcraft.jsch.*

0
After converting the SFTP module from the appstore to Mx5.15, an java error appears in HandleFileSftp.java. The import com.jcraft.jsch.*; cannot be resolved. Anyone knows what to import?
asked
3 answers
1

Thijs,

Place jsch-0.1.50.jar in the userlib and delete the com dir. And it would be better to edit your question then to answer your own ;)

Regards,

Ronald

answered
0

When turning Emulate Cloud Security off, the following error occurs:

An error has occurred while handling the request. [User 'MxAdmin' with session id '8e3bc56d-7021-4aa0-ad92-81a7ac785d06' and roles 'Administrator, ApplicationManager']


java.util.concurrent.ExecutionException: Boxed Error at scala.concurrent.impl.Promise$.resolver(Promise.scala:55) at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:47) at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:244) at akka.pattern.PromiseActorRef.$bang(AskSupport.scala:267) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:160) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:140) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Caused by: java.lang.Error: Unresolved compilation problems: JSch cannot be resolved to a type JSch cannot be resolved to a type Session cannot be resolved to a type Channel cannot be resolved to a type ChannelSftp cannot be resolved to a type ChannelSftp cannot be resolved to a type LsEntry cannot be resolved to a type LsEntry cannot be resolved to a type LsEntry cannot be resolved to a type SftpATTRS cannot be resolved to a type JSchException cannot be resolved to a type SftpException cannot be resolved to a type

at sftpconnection.helpers.HandleFileSftp.handleFile(HandleFileSftp.java:75)
at sftpconnection.actions.GetFileListFromSFTPLocation.executeAction(GetFileListFromSFTPLocation.java:47)
at sftpconnection.actions.GetFileListFromSFTPLocation.executeAction(GetFileListFromSFTPLocation.java:1)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:53)
at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:291)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:276)
at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:204)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37)
at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:199)
at com.mendix.core.component.InternalCore.execute(InternalCore.java:228)
at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:46)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:49)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:196)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:151)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:53)
at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:291)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:276)
at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:204)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37)
at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:199)
at com.mendix.core.component.InternalCore.execute(InternalCore.java:228)
at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:135)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:300)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:293)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:293)
at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:151)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37)
at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:153)
at scala.util.Try$.apply(Try.scala:191)
at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:147)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:140)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
answered
0

The SFTP module in the appstore is released in Mendix 4.x, when converting the project it requires significant work to setup and refactor the code to allow to be used in Mendix 5.

These are all 'normal' upgrade and conversion issues. You'll have to go through the Java code and rewrite several API calls which are now different in Mx5.
Your initial stacktrace is saying that you are missing a library,
The second stacktrace is complaining that you are using a different version of the library than the code is based on.

The SFTP module doesn't experience a significant difference between the different Mx5 releases.

I do have a version myself that is working in Mx5 without any issues, but this version is different from what is available in the appstore. This is not a supported a release, and has not been tested for compatibility in any other version than 5.12. You can try and use this, but there is no official support on this from Mendix. But feel free to try downloading the mpk and see if this helps you.

answered