Hi all,
I am trying to access
java code(FTPHttpClient) from job(using grails quartz plugin) , code is throwing NoClassDefFoundError and ClassNotFoundException . Please see below for more details:
2016-08-18 13:25:20,813 [DefaultPluginScheduler_Worker-2] core.JobRunShell Job DEFAULT.com.project.Job threw a JobExecutionException:
org.quartz.JobExecutionException: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPHTTPClient [See nested exception: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPHTTPClient]
at grails.plugin.quartz2.GrailsArtefactJob.execute(GrailsArtefactJob.java:66)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPHTTPClient
at com.project.services.ExternalFtpService.downloadFile(ExternalFtpService.java:19)
at com.project.services.ConnectoService.uploadManifest(ConnectorService.java:21)
at com.project.Job.execute(Job.groovy:33)
at grails.plugin.quartz2.GrailsArtefactJob.execute(GrailsArtefactJob.java:59)
... 2 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.net.ftp.FTPHTTPClient
Code snippet is here:
In second line, it is throwing error, code is working in stand alone program. I have checked classpath , commons-net jar is already there.
I am not sure to post this in Grails forum(as I am using Grails plugin to access this code) or java forum.
Please feel free to move this to java forum if needed and any help will be appreciated.
Thanks.