This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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: 17344
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
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!