编程生活

   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  113 随笔 :: 0 文章 :: 18 评论 :: 0 Trackbacks
当我们初始化java程序时,必须初始化classloader.这个会与JNDI校验时非常关键的!当Vuser作一个进程时时每个进程都会缺省的加载进来,这是没有什么问题的!但是做作为线程,classloader会在main进程会加载,但是所有的线程都没有加载进来!所以报无法使用线程,解决这个问题,就是我们做一个假想的类加载动作。
解决方法1:
   在脚本初始化前加一句:
DummyClassLoader.setContextClassLoader();


If you are making calls to JNDI extensions within your script, you may encounter problems trying to run your Vusers as threads. This happens because JNDI requires each thread to have its own context class loader. In order to run as threads, instruct each Vuser to run with its own context class loader, by adding the following line to the beginning of the init section:
DummyClassLoader.setContextClassLoader();

posted on 2008-06-05 14:03 wilesun 阅读(365) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: