Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Constructor threw exception; nested exception is java.lang.NullPointerException

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am trying to use quartz scheduler in my application.
quartz xml is imported in to spring-app-context xml.
My code is as follows :-

Quartz-scheduler.xml


RunMeTask.java




RunMeJob.java






But when i start the server it gives me following error. And my Scheduler wont start at all.

 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something doesn't line up.

Here is your exception

Caused by: java.lang.NullPointerException
at com.marriott.base.components.batch.quartz.RunMeTask.<init>(RunMeTask.java:35)

So line 35 in RunMeTask.

You don't have a line 35 with code in that class. There is line 34 that runs into line 35.

So I think maybe you don't have the same code running as posted?

Anyway. Why are you injecting the ApplciationContext into the RunMeTask. Why not just @Autowired in the Service class you want instead?

Mark
 
catch it before it slithers away! Oh wait, it's a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic