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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

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 :-


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

Posts: 17346
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

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?

catch it before it slithers away! Oh wait, it's a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic