JPushClient jpushClient = new JPushClient(MASTER_SECRET, APP_KEY, null, ClientConfig.getInstance());
这是初始化方法,我写的jpush.js是这样子的
var ioc={
clientConfig : {
type : "cn.jiguang.common.ClientConfig",
singleton : true
},
jPushClient : {
type : "cn.jpush.api.JPushClient",
singleton : false,
args : [{java:"$conf.get('jpush.master_secret')"}, {java:"$conf.get('jpush.app_key')"},null,{refer:"clientConfig"}]
}
};
ClientConfig是单利模式的,但是通过ioc拿到JPushClient报错了,请问这个该怎么弄呢
JPushClient jpushClient = config.getIoc().get(JPushClient.class);
Caused by: java.lang.IllegalArgumentException: array element type mismatch
at java.lang.reflect.Array.set(Native Method)
at org.nutz.lang.Mirror.evalArgToRealArray(Mirror.java:1287)
at org.nutz.lang.Mirror.evalArgToSameTypeRealArray(Mirror.java:1249)
at org.nutz.lang.born.Borns.evalWithArgs(Borns.java:76)
at org.nutz.lang.born.Borns.eval(Borns.java:58)
at org.nutz.lang.Mirror.getBorning(Mirror.java:952)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:107)
... 57 more
DXJ50: 2017-12-29 10:37:54,274 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.nutz.ioc.loader.combo.ComboIocLoader - Found IocObject(clientConfig) in JsonLoader(paths=[dao.js, ioc/upload.js, ioc/mail.js, ioc/jpush.js])
DXJ50: 2017-12-29 10:37:54,274 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.nutz.ioc.impl.NutIoc - >> Make...'clientConfig'<>
DXJ50: 2017-12-29 10:37:54,274 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.nutz.ioc.aop.impl.DefaultMirrorFactory - Load class cn.jiguang.common.ClientConfig without AOP
DXJ50: 2017-12-29 10:37:54,274 [RMI TCP Connection(3)-127.0.0.1] DEBUG org.nutz.ioc.impl.ScopeContext - Save object 'clientConfig' to [app]
org.nutz.ioc.IocException: IocBean[jPushClient] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
at com.hxd.Startup.init(Startup.java:46)
ClientConfig是这样的
public class ClientConfig extends HashMap<String, Object> {
public static final String DEVICE_HOST_NAME = "device.host.name";
public static final Object DEVICE_HOST_NAME_SCHEMA = String.class;
public static final String DEVICES_PATH = "devices.path";
public static final Object DEVICES_PATH_SCHEMA = String.class;
public static final String TAGS_PATH = "tags.path";
public static final Object TAGS_PATH_SCHEMA = String.class;
public static final String ALIASES_PATH = "aliases.path";
public static final Object ALIASES_PATH_SCHEMA = String.class;
public static final String PUSH_HOST_NAME = "push.host.name";
public static final Object PUSH_HOST_NAME_SCHEMA = String.class;
public static final String PUSH_PATH = "push.path";
public static final Object PUSH_PATH_SCHEMA = String.class;
public static final String PUSH_VALIDATE_PATH = "push.validate.path";
public static final Object PUSH_VALIDATE_PATH_SCHMEA = String.class;
public static final String REPORT_HOST_NAME = "report.host.name";
public static final Object REPORT_HOST_NAME_SCHEMA = String.class;
public static final String REPORT_RECEIVE_PATH = "report.receive.path";
public static final Object REPORT_RECEIVE_PATH_SCHEMA = String.class;
public static final String REPORT_USER_PATH = "report.user.path";
public static final Object REPORT_USER_PATH_SCHEMA = String.class;
public static final String REPORT_MESSAGE_PATH = "report.message.path";
public static final Object REPORT_MESSAGE_PATH_SCHEMA = String.class;
public static final String REPORT_STATUS_PATH = "report.status.path";
public static final Object REPORT_STATUS_PATH_SCHEMA = String.class;
public static final String SCHEDULE_HOST_NAME = "schedule.host.name";
public static final Object SCHEDULE_HOST_NAME_SCHEMA = String.class;
public static final String SCHEDULE_PATH = "schedule.path";
public static final Object SCHEDULE_PATH_SCHEMA = String.class;
public static final String GROUP_PUSH_PATH = "group.push.path";
public static final Object GROUP_PUSH_PATH_SCHEMA = String.class;
public static final String SSL_VERSION = "ssl.version";
public static final Object SSL_VERSION_SCHEMA = String.class;
public static final String DEFAULT_SSL_VERSION = "TLS";
public static final String MAX_RETRY_TIMES = "max.retry.times";
public static final Object MAX_RETRY_TIMES_SCHEMA = Integer.class;
public static final int DEFULT_MAX_RETRY_TIMES = 3;
public static final String READ_TIMEOUT = "read.timeout";
public static final Object READ_TIMEOUT_SCHEMA = Integer.class;
public static final int DEFAULT_READ_TIMEOUT = 30000;
public static final String CONNECTION_REQUEST_TIMEOUT = "connection.request.timeout";
public static final Object CONNECTION_REQUEST_TIMEOUT_SCHEMA = Integer.class;
public static final int DEFAULT_CONNECTION_REQUEST_TIMEOUT = 10000;
public static final String CONNECTION_TIMEOUT = "connection.timeout";
public static final Object CONNECTION_TIMEOUT_SCHEMA = Integer.class;
public static final int DEFAULT_CONNECTION_TIMEOUT = 5000;
public static final String SOCKET_TIMEOUT = "socket.timeout";
public static final Object SOCKET_TIMEOUT_SCHEMA = Integer.class;
public static final int DEFAULT_SOCKET_TIMEOUT = 10000;
public static final String APNS_PRODUCTION = "apns.production";
public static final Object APNS_PRODUCTION_SCHEMA = Integer.class;
public static final int DEFAULT_APNS_PRODUCTION = -1;
public static final String TIME_TO_LIVE = "time.to.live";
public static final Object TIME_TO_LIVE_SCHEMA = Long.class;
public static final long DEFAULT_TIME_TO_LIVE = -1L;
private static ClientConfig instance = new ClientConfig();