首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > 加载DLL到Web容器共享类装载器

加载DLL到Web容器共享类装载器

  • 资源大小:4.47 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: web dll 共享 加载 容器 装载

资 源 简 介

What is this? This code is intended to solve a small, but annoying problem that occurs when loading native libraries (specifically DLLs) within a web container (Tomcat in this case). Loading a DLL into a Web Container Intuitively, the following code would be written to load a DLL within a web container. System.loadLibrary("name-of-dll"); It is important to only call this method once, as calling it multiple times will result in the following error: java.lang.UnsatisfiedLinkError: Native Library "name-of-dll" already loaded ... Loading a DLL once in a Web Container To correct for this issue, you can load the DLL in a static initializer block, which guarantees that it is only loaded once for the lifetime of the classloader assigned to that web container. static { System.loadLibrary("name-of-dll");} However, if the webapp is redeployed within a runni

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP
  • WYG 1天前 成为了本站会员

  • Shine 1天前 成为了本站会员

  • 柳贻 1天前 成为了本站会员

  • hallelujah_HL 1天前 成为了本站会员

  • 焦昱贺 1天前 成为了本站会员

  • Rubin 1天前 成为了本站会员

  • Li 2天前 成为了本站会员

  • bigfatcat1977 3天前 成为了本站会员

  • just4down 3天前 成为了本站会员

  • shallow 3天前 成为了本站会员

0.171971s