posts - 1,  comments - 1,  trackbacks - 0
          當(dāng)遇到Exception in thread "main" javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]時
          1.首先檢查你的Context.PROVIDER_URL配置是否正確,例如Jboss4.0.2中是jnp://localhost:1099,當(dāng)然這個1099端口也可能換,如果不知道請到%JBOSS_HOME%\server\default\conf\下查找jboss-service.xml在里面找到如下代碼:
           1 <mbean code="org.jboss.naming.NamingService"
           2       name="jboss:service=Naming"
           3       xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
           4       <!-- The call by value mode. true if all lookups are unmarshalled using
           5       the caller's TCL, false if in VM lookups return the value by reference.
           6       -->
           7       <attribute name="CallByValue">false</attribute>
           8       <!-- The listening port for the bootstrap JNP service. Set this to -1
           9         to run the NamingService without the JNP invoker listening port.
          10       -->
          11       <attribute name="Port">1099</attribute>
          12       <!-- The bootstrap JNP server bind address. This also sets the default
          13       RMI service bind address. Empty == all addresses
          14        -->
          15       <attribute name="BindAddress">${jboss.bind.address}</attribute>
          16       <!-- The port of the RMI naming service, 0 == anonymous -->
          17       <attribute name="RmiPort">1098</attribute>
          18       <!-- The RMI service bind address. Empty == all addresses
          19        -->
          20       <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
          21       <!-- The thread pool service used to control the bootstrap lookups -->
          22       <depends optional-attribute-name="LookupPool"
          23          proxy-type="attribute">jboss.system:service=ThreadPool</depends>
          24    </mbean>
           <attribute name="Port">1099</attribute> 看這里的端口號,修改這里的端口號為你provider_url配置的端口號,或著反過來修改你的provider_url的端口號為這里的端口號。

          2.如果1中配置沒有問題,請檢查你的防火墻,殺毒軟件等安全工具是否禁止了端口,我用的mcafee,需要在mcafee的訪問保護->屬性->用戶自定義規(guī)則添加一條規(guī)則,根據(jù)提示寫入需要排除的端口號,然后在排除項中添加java.exe和javaw.exe確定即可,在試試,應(yīng)該就可以了!
          posted on 2010-06-12 16:03 天獨 閱讀(1248) 評論(0)  編輯  收藏

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 巴中市| 建瓯市| 霞浦县| 仲巴县| 绥棱县| 宝清县| 临泽县| 渭源县| 古丈县| 绥芬河市| 舟曲县| 上栗县| 惠东县| 峨边| 宿迁市| 自贡市| 延川县| 行唐县| 霍林郭勒市| 崇义县| 临沂市| 肥西县| 福建省| 交口县| 扎赉特旗| 玉山县| 洪江市| 富阳市| 岢岚县| 左云县| 临泽县| 靖西县| 武强县| 林芝县| 涪陵区| 巴林左旗| 类乌齐县| 永泰县| 遵义市| 临夏县| 辽宁省|