gpt4 book ai didi

java - 线程 org.springframework.beans.factory.BeanCreationException 中的异常 : Error

转载 作者:行者123 更新时间:2023-12-01 04:44:38 24 4
gpt4 key购买 nike

这是我的 applicationContext.xml

<bean id="studentbean" class="com.Student">
<property name="name" value=" " />

</bean>
<bean id="JobA" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.Student" />
<property name="jobDataAsMap">
<map>
<entry key="timeout" value="5" />
</map>
</property>
</bean>
<bean id="cronTriggerJobA" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="JobA" />
<property name="cronExpression" value="0/5 * * * * ?" />
</bean>

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobDetails">
<list>
<ref bean="JobA" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="cronTriggerJobA" />

</list>
</property>
</bean>

我正在使用 spring-2.5.6.jar 和quartz-1.8.5.jar执行时我收到错误

     Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.quartz.impl.StdSchedulerFactory]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

我能够在没有 Spring 集成的情况下使用 Quartz 调度程序,但现在我遇到了这个错误,任何人都可以解决这个问题

最佳答案

谢谢它的工作,org/slf4j/LoggerFactory 不在我添加的 jar 中

关于java - 线程 org.springframework.beans.factory.BeanCreationException 中的异常 : Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16031082/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com