• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NoClassDefFoundError and ClassNotFoundException when accessing java code from Grails plugin

 
Ranch Hand
Posts: 35
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
shikhaj jainy
Ranch Hand
Posts: 35
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have resolved this issue, by using below code

FTPHTTPClient ftpClient = new FTPHTTPClient("host", port, "usename", "pwd");


Thanks.
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for posting the solution here.  Have a cow (that's a good thing).
 
shikhaj jainy
Ranch Hand
Posts: 35
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Knute i did not notice the fact about cows ..thanks again
 
reply
    Bookmark Topic Watch Topic
  • New Topic