java 缓存ech_ehcache获取缓存空指针


Caused by: java.lang.NullPointerException

at com.binfoo.www.module.WeiXinUserModule.(

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

at sun.reflect.NativeConstructorAccessorImpl.newInstance(

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(

at java.lang.reflect.Constructor.newInstance(

at org.nutz.lang.born.EmptyArgsConstructorBorning.born(

... 45 more


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


  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助




当前余额3.43前往充值 >
领取后你会自动成为博主和红包主的粉丝 规则
钱包余额 0