@IocBean
public class ProductOrderJob implements Job {
@Inject
protected Dao dao;
}
启用定时任务,没有注入Dao 是不哪里需要设置一下
@IocBean
public class ProductOrderJob implements Job {
@Inject
protected Dao dao;
}
启用定时任务,没有注入Dao 是不哪里需要设置一下
[WARN ] 2017-10-29 15:50:00,099 org.nutz.integration.quartz.NutQuartzJobFactory.newJob(NutQuartzJobFactory.java:30) - Not ioc bean? fallback to SimpleJobFactory
org.nutz.ioc.IocException: IocBean[productOrderJob] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:150)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:216)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:245)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:152)
at org.nutz.integration.quartz.NutQuartzJobFactory.newJob(NutQuartzJobFactory.java:27)
at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:375)
Caused by: java.lang.RuntimeException: IocBean[productOrderJob] fail at field=[refundService]
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:136)
... 6 more
Caused by: org.nutz.ioc.IocException: IocBean[refundService] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:150)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:216)
at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
... 8 more
Caused by: java.lang.RuntimeException: IocBean[refundService] fail at field=[unionpayClient]
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:136)
... 11 more
Caused by: org.nutz.ioc.IocException: IocBean[class:org.firenut.pay.api.UnionpayClient] none ioc bean match class=org.firenut.pay.api.UnionpayClient
at org.nutz.ioc.impl.NutIoc.getByType(NutIoc.java:411)
at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:66)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
... 13 more
[DEBUG] 2017-10-29 15:50:00,101 org.quartz.simpl.SimpleJobFactory.newJob(SimpleJobFactory.java:51) - Producing instance of Job '575db1f4b41a4b88b50cd86b63b8eae5.575db1f4b41a4b88b50cd86b63b8eae5', class=cn.wizzer.app.web.commons.quartz.job.ProductOrderJob
[INFO ] 2017-10-29 15:50:00,101 org.quartz.plugins.history.LoggingJobHistoryPlugin.jobToBeExecuted(LoggingJobHistoryPlugin.java:469) - Job 575db1f4b41a4b88b50cd86b63b8eae5.575db1f4b41a4b88b50cd86b63b8eae5 fired (by trigger 575db1f4b41a4b88b50cd86b63b8eae5.575db1f4b41a4b88b50cd86b63b8eae5) at: 15:50:00 10/29/2017
[DEBUG] 2017-10-29 15:50:00,101 org.quartz.core.JobRunShell.run(JobRunShell.java:201) - Calling execute on job 575db1f4b41a4b88b50cd86b63b8eae5.575db1f4b41a4b88b50cd86b63b8eae5
[ERROR] 2017-10-29 15:50:00,101 org.quartz.core.JobRunShell.run(JobRunShell.java:211) - Job 575db1f4b41a4b88b50cd86b63b8eae5.575db1f4b41a4b88b50cd86b63b8eae5 threw an unhandled Exception:
var ioc = {
unionpayClient : {
type : "org.firenut.pay.api.UnionpayClient",
args : []
}
};
嗯嗯 我配一个ioc就好啦 谢谢啦
public class UnionpayClient {
private WxpayClient wxpayClient;
private AlipayClient alipayClient;
public UnionpayClient() {
}
public void initOkHttpClient(OkHttpClient client) {
OkWebUtils.initHttpClient(client);
}
public WxpayClient getWxpayClient() {
return this.wxpayClient;
}
public void setWxpayClient(WxpayClient wxpayClient) {
this.wxpayClient = wxpayClient;
}
public AlipayClient getAlipayClient() {
return this.alipayClient;
}
public void setAlipayClient(AlipayClient alipayClient) {
this.alipayClient = alipayClient;
}
}
这是注入的服务
private WxpayClient wxpayClient;
private AlipayClient alipayClient;
在引用的时候为null
@Inject
private UnionpayClient unionpayClient;
[WARN ] 2017-11-06 15:40:41,175 org.nutz.integration.quartz.NutQuartzJobFactory.newJob(NutQuartzJobFactory.java:30) - Not ioc bean? fallback to SimpleJobFactory
org.nutz.ioc.IocException: IocBean[productOrderJob] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:150)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:216)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:245)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:152)
at org.nutz.integration.quartz.NutQuartzJobFactory.newJob(NutQuartzJobFactory.java:27)
at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:375)
Caused by: java.lang.RuntimeException: IocBean[productOrderJob] fail at field=[refundService]
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:136)
... 6 more
Caused by: org.nutz.ioc.IocException: IocBean[refundService] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:150)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:216)
at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
... 8 more
Caused by: java.lang.RuntimeException: IocBean[refundService] fail at field=[unionpayClient]
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:136)
... 11 more
Caused by: org.nutz.ioc.IocException: IocBean[class:org.firenut.pay.api.UnionpayClient] none ioc bean match class=org.firenut.pay.api.UnionpayClient
at org.nutz.ioc.impl.NutIoc.getByType(NutIoc.java:411)
at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:66)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
... 13 more
UnionpayClient 是封装的支付类
去掉js引入的IOCBean 正常的Bean装载也没能执行
var ioc = {
unionpayClient : {
type : "org.firenut.pay.api.UnionpayClient",
fields : {
wxpayClient : {refer:"wxpayClient"},
alipayClient : {refer:"alipayClient"}
}
}
};
public class UnionpayClient {
private WxpayClient wxpayClient;
public UnionpayClient() {
}
public void initOkHttpClient(OkHttpClient client) {
OkWebUtils.initHttpClient(client);
}
public WxpayClient getWxpayClient() {
return this.wxpayClient;
}
public void setWxpayClient(WxpayClient wxpayClient) {
this.wxpayClient = wxpayClient;
}
}
initOkHttpClient方法怎么注入
var ioc = {
unionpayClient : {
type : "org.firenut.pay.api.UnionpayClient",
fields : {
wxpayClient : {refer:"wxpayClient"},
alipayClient : {refer:"alipayClient"},
initOkHttpClient : {refer:"okHttpClientEncrypt"}
}
}
};