aspose file tools*
The moose likes Spring and the fly likes Constructor threw exception; nested exception is java.lang.NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Constructor threw exception; nested exception is java.lang.NullPointerException" Watch "Constructor threw exception; nested exception is java.lang.NullPointerException" New topic
Author

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

Santhosh Puttu
Greenhorn

Joined: Jun 08, 2010
Posts: 27
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

Joined: Feb 05, 2001
Posts: 17257
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
jQuery in Action, 2nd edition
 
subject: Constructor threw exception; nested exception is java.lang.NullPointerException