首页 新闻 会员 周边 捐助

eclipse环境下,Spring配置文件报错:Class dependency error

0
悬赏园豆:5 [已关闭问题] 关闭于 2020-05-08 20:46

Class dependency error 'com.justask.job.ExampleBusinessObject' occurred on aspect definition
 'Aspect definition [\justask-admin\src\main\resources\conf\spring-context.xml:80] advise type [after]
 advise [org.springframework.transaction.interceptor.TransactionInterceptor.invoke]' while processing
 bean 'exampleBusinessObject (34) [com.justask.job.ExampleBusinessObject]'. Check if builder
 classpath is complete

 

配置文件内容如下:

复制代码
 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <beans xmlns="http://www.springframework.org/schema/beans"
 3        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 5     <!--quartz-->
 6     <!--①使用JobDetailBean-->
 7     <bean name="exampleJob" class="org.springframework.scheduling.quartz.JobDetailBean">
 8         <property name="jobClass" value="com.justask.job.ExampleJob"/>
 9         <property name="jobDataAsMap">
10             <map>
11                 <!--会自动填充ExampleJob中的timeout字段-->
12                 <entry key="timeout" value="5"/>
13             </map>
14         </property>
15     </bean>
16     
17     <bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
18         <property name="targetObject" ref="exampleBusinessObject"/>
19         <property name="targetMethod" value="doIt"/>
20         
21         <property name="concurrent" value="false"/>
22     </bean>
23 
24     <bean id="exampleBusinessObject" class="com.justask.job.ExampleBusinessObject"/>
25 
26     <!--③ 使用triggers和SchedulerFactoryBean来包装任务-->
27     <bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
28         <!-- see the example of method invoking job above -->
29         <property name="jobDetail" ref="jobDetail"/>
30         <!-- 10 seconds -->
31         <property name="startDelay" value="10000"/>
32 
33         <!-- repeat every 50 seconds -->
34         <property name="repeatInterval" value="50000"/>
35     </bean>
36 
37     <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
38         <property name="jobDetail" ref="exampleJob"/>
39         <!-- run every morning at 6 AM -->
40         <property name="cronExpression" value="0 0 6 * * ?"/>
41 
42     </bean>
43     
44     <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
45         <property name="triggers">
46             <list>
47                 <ref bean="cronTrigger"/>
48                 <ref bean="simpleTrigger"/>
49             </list>
50         </property>
51     </bean>
52 
53 
54 </beans>
复制代码

 

ExampleBusinessObject 这个类明明是存在的 为什么还是报错?

JaneEyreWork的主页 JaneEyreWork | 初学一级 | 园豆:11
提问于:2020-05-08 20:08

spring-context.xml 这个文件,还有pom.xml文件贴出来看看,一般这种是缺少包。。

。淑女范erり 4年前
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册