編程生活

             :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            113 隨筆 :: 0 文章 :: 18 評論 :: 0 Trackbacks
          當(dāng)我們初始化java程序時(shí),必須初始化classloader.這個(gè)會與JNDI校驗(yàn)時(shí)非常關(guān)鍵的!當(dāng)Vuser作一個(gè)進(jìn)程時(shí)時(shí)每個(gè)進(jìn)程都會缺省的加載進(jìn)來,這是沒有什么問題的!但是做作為線程,classloader會在main進(jìn)程會加載,但是所有的線程都沒有加載進(jìn)來!所以報(bào)無法使用線程,解決這個(gè)問題,就是我們做一個(gè)假想的類加載動作。
          解決方法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)  編輯  收藏

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 新丰县| 务川| 太仓市| 惠东县| 崇阳县| 清苑县| 县级市| 金溪县| 南澳县| 彰化市| 乐平市| 五华县| 雅安市| 阿瓦提县| 浪卡子县| 大丰市| 闵行区| 武邑县| 洪洞县| 运城市| 滦南县| 六枝特区| 茂名市| 汾西县| 图木舒克市| 淮安市| 台北市| 舞钢市| 东阳市| 米易县| 通化市| 榆中县| 文登市| 宜兰市| 辽阳县| 齐河县| 临武县| 峨山| 德惠市| 响水县| 兴隆县|