It's not a secret anymore!*
The moose likes Spring and the fly likes Scheduler and joblistener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Scheduler and joblistener" Watch "Scheduler and joblistener" New topic
Author

Scheduler and joblistener

hadjila hadjilak
Greenhorn

Joined: Apr 04, 2013
Posts: 4
Hi,
I have always a same problem:

I would to integrate m y class UnJobListener ,who impelement joblistener, in my quartz (file xml )

This is my file




And there are the errors:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ncaSchedulerFactoryBean' defined in class path resource [schedulerAppContext.xml]: Cannot create inner bean 'ncaJobListener' of type [com.prosodie.nca.scheduler.NcaJobListener] while setting bean property 'listener'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ncaJobListener' defined in class path resource [schedulerAppContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.prosodie.nca.scheduler.NcaJobListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.prosodie.nca.scheduler.NcaJobListener.<init>()
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.prosodie.nca.scheduler.StandaloneScheduler.main(StandaloneScheduler.java:46)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ncaJobListener' defined in class path resource [schedulerAppContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.prosodie.nca.scheduler.NcaJobListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.prosodie.nca.scheduler.NcaJobListener.<init>()
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
... 15 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.prosodie.nca.scheduler.NcaJobListener]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.prosodie.nca.scheduler.NcaJobListener.<init>()
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:72)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
... 19 more
Caused by: java.lang.NoSuchMethodException: com.prosodie.nca.scheduler.NcaJobListener.<init>()
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getDeclaredConstructor(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:67)
... 20 more


Please, please some one to help me!!
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2278
    
  28

The problem is here



You need to look at the java docs of the NcaJobListener class. How are you suppossed to initialize it. Does it have a constructor?
hadjila hadjilak
Greenhorn

Joined: Apr 04, 2013
Posts: 4
Hi,
In the first thanks for your reply.
Fort the last mistakes yes the problem are in the constructor for my class and i have resolved this, then when you run my programme
dosen't use my class listener, i don't know how do you do for this:

This is my class jobluncher who lunche my scheduler:



what do you do for to notifate my job or how to use my class JobListener in my class lancher.
Thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scheduler and joblistener
 
Similar Threads
org.springframework.beans.factory.BeanCreationException
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
Problem with Hibernate sessionFactoryBean in application context initialization
Spring+Hibernate can't create SessionFactory bean
how to use JobListener interface