編程生活

             :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            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 閱讀(376) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 建宁县| 涿鹿县| 兰西县| 兰州市| 兴仁县| 柘荣县| 定安县| 许昌市| 彩票| 天台县| 福泉市| 张家口市| 汾西县| 方正县| 宁德市| 龙口市| 盘锦市| 洮南市| 仪征市| 肥西县| 桐乡市| 宝清县| 天水市| 北票市| 房山区| 长寿区| 分宜县| 廊坊市| 乐东| 安吉县| 岚皋县| 海盐县| 三穗县| 岢岚县| 嘉祥县| 留坝县| 深水埗区| 赣州市| 铅山县| 贵南县| 巩义市|