This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Santhosh Puttu
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.

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic