java 缓存ech_ehcache获取缓存空指针

报错日志

Caused by: java.lang.NullPointerException

at com.binfoo.www.module.WeiXinUserModule.(WeiXinUserModule.java:32)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

at org.nutz.lang.born.EmptyArgsConstructorBorning.born(EmptyArgsConstructorBorning.java:16)

... 45 more

shiro.ini配置

cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager

cacheManager.cacheManagerConfigFile = classpath:ehcache.xml

代码

Cache cache = cacheManager.getCache("bms");

String access_token;

Element ele = cache.get("key");

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
In Depth In this chapter, I’m going to take a look at the support Perl offers for interprocess communication (IPC). As far as an operating system is concerned, a process is a running job that has its own execution resources, including share of CPU time. Your process can start or interact with other processes in Perl in plenty of ways. For example, you might want to send a large array-crunching task to a child process, which will signal the main process—that is, the parent process—when it’s done. Handling Interprocess Communication in Perl The support for IPC in Perl ranges over a considerable area, and because it’s an operating system topic, it’s operating system dependent. At its most basic, IPC is as simple as using backticks to execute a system command. When you use backticks, the operating system starts a new process and executes your com- mand. You can also use the exec and system functions to run other programs. However, things start diverging rapidly by operating system from this point on. In Unix, you can use the Perl function fork to start a new process and communi- cate with it after setting up a pipe (a pipe works like a pair of connected file handles) with the pipe function. In fact, you can even use the open function to do the same. You can also send signals between processes and handle the signals that are sent to you. In MS-DOS, the situation is different; fork and other IPC functions are not imple- mented. However, when it is running under Windows, the MS-DOS port of Perl can use Object Linking and Embedding (OLE) automation—also called using code components and code clients—to send data between processes. Besides the Unix support for IPC, then, you’ll also see how to use OLE automation to communicate between Perl and Windows processes such as Microsoft Excel. In this chapter, I’ll also write a code component in Microsoft Visual Basic that you can connect to from Perl scripts, calling the component’s methods and using its properties. In fact, that code component will even be able to display windows, letting you use OLE automation to do what you can’t usually do with Perl in MS-DOS—that is, get graphical. (See Chapter 15 for details on the connection between Perl and the Tk toolkit; that chapter is all about using Tk to display windows, buttons, and more.) NOTE: In Perl v5.6.1, you can use multiple threads, but you need a custom build of Perl. 193_4eC01.P65.fp 8/30/01, 3:13 PM 2 e3 In Depth e1.Built-In Functions: Interprocess Communication You’ll also find more IPC material in one other place in this book, Chapter 20, on the Internet and socket programming. Most people think of sockets as an Internet phenomenon that you use to connect to other machines across the Internet, but in fact, you can use sockets to connect processes on the same machine. And, that’s it. It’s time to turn to the Immediate Solutions now

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值