APNS介绍
顾名思义,APNS为苹果的推送服务,其工作流程如下:
第三方工具包
这里我们使用javapns,除此之外我们还需要bcprov-jdk15-146.jar.
代码实现
首先我们要将消息推送给多台iOS设备,所以应该使用多线程进行消息推送.
阅读全文…
今天在发布线上版本的时候发现一个rmi的异常,开始一看以为是客户端配置出错,但检查配置后发现配置无异常.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
org.springframework.beans.factory.support.DefaultListableBeanFactory[line:242]- Returning cached instance of singleton bean 'callbackService' org.springframework.remoting.rmi.RmiClientInterceptorUtils[line:182]- Remote service [rmi://10.77.7.49:9200/callbackService] threw exception java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178) at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132) at $Proxy24.invoke(Unknown Source) at org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke(RmiClientInterceptor.java:398) at org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke(RmiClientInterceptor.java:344) at org.springframework.remoting.rmi.RmiClientInterceptor.invoke(RmiClientInterceptor.java:259) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy23.process(Unknown Source) at java.lang.Thread.run(Thread.java:662) |
MySQL启动时提示Timeout error occurred trying to start MySQL Daemon
解决办法:执行/usr/bin/mysql_install_db,修复下就OK了.
启动后发现所有的数据表都无法使用,查看MySQL异常日志,发现如下log
1 2 3 4 5 6 7 8 9 10 11 12 13 |
InnoDB: Error: cannot allocate 17179885568 bytes of InnoDB: memory with malloc! Total allocated memory InnoDB: by InnoDB 45007312 bytes. Operating system errno: 12 InnoDB: Check if you should increase the swap file or InnoDB: ulimits of your operating system. InnoDB: On FreeBSD check you have compiled the OS with InnoDB: a big enough maximum process size. InnoDB: Note that in most 32-bit computers the process InnoDB: memory space is limited to 2 GB or 4 GB. InnoDB: We keep retrying the allocation for 60 seconds... InnoDB: Fatal error: cannot allocate the memory for the buffer pool |
原因:这个报错的大意是,内存基本耗尽,没有再可以分配的内存.
解决办法:查看/etc/my.cnf,找innodb_buffer_pool_size,发现设值已经超过了系统总内存,然后重新设置为系统内存1半,即innodb_buffer_pool_size = 6144M 重启MySQL就OK了.
to be continued…