JBOSS 點(diǎn)滴

          豐豐的博客

          Could not obtain connection to any of these urls:

          錯(cuò)誤:
          Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.17.105:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server /192.168.17.105:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /192.168.17.105:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
              at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1725)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:689)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
              at javax.naming.InitialContext.lookup(InitialContext.java:392)
              at test.Client.main(Client.java:29)
          處理:
          在本文中將編寫一個(gè)簡(jiǎn)單的無狀態(tài)SessionBean。在發(fā)布EJB時(shí),一般需要將EJB程序以jar文件的形式進(jìn)行發(fā)布。這些jar文件將被放在<JBoss安裝目錄>\server\default\deploy目錄中。如果在Eclipse中開發(fā)EJB程序,需要進(jìn)行一些配置。首選需要在首選項(xiàng)(Preferences)對(duì)話框中設(shè)置JBoss的安裝目錄(如D:\jboss5)。然后在運(yùn)行配置對(duì)話框中添加jboss的運(yùn)行項(xiàng)。在jboss4.2及以后的版本中,默認(rèn)情況下jboss只接收來自localhost或127.0.0.1的請(qǐng)求,也就是只接收本地的訪問。為了使jboss接收來自其他地址的請(qǐng)求,在啟動(dòng)jboss時(shí)需要使用-b命令行參數(shù)進(jìn)行設(shè)置。如下面的啟動(dòng)命令所示:

          run.bat -b 200.200.200.123
          run.bat -b 
          0.0.0.0

              上面的第一行命令表示jboss可以接收來自200.200.200.123的請(qǐng)求。第二條命令表示jboss可以接收來自任意地址的請(qǐng)求。如果不設(shè)置-b參數(shù),以非本機(jī)方式訪問EJB時(shí),JBoss會(huì)拋出如上異常:

          posted on 2009-06-02 17:22 半導(dǎo)體 閱讀(5647) 評(píng)論(6)  編輯  收藏 所屬分類: EJB

          評(píng)論

          # re: Could not obtain connection to any of these urls: 2009-06-25 14:11 DB

          補(bǔ)充下:剛學(xué)時(shí)候容易把端口寫成8080,那是TOMCAT的端口,JNDI應(yīng)該設(shè)成1099  回復(fù)  更多評(píng)論   

          # 非常好 2010-11-22 22:35 farseer

          太感謝了,找了好久才找到怎么解決,謝謝樓主  回復(fù)  更多評(píng)論   

          # re: Could not obtain connection to any of these urls: 2010-12-28 14:35

          太感謝了,困擾了我一下午,覺都沒睡好  回復(fù)  更多評(píng)論   

          # re: Could not obtain connection to any of these urls: 2011-01-13 12:00 半導(dǎo)體

          @DB
          恩,補(bǔ)充得是!  回復(fù)  更多評(píng)論   

          # re: Could not obtain connection to any of these urls: [未登錄] 2012-05-11 23:38 java

          問題得意解決、感謝樓主?。?!  回復(fù)  更多評(píng)論   

          # re: Could not obtain connection to any of these urls: 2013-12-31 13:24

          請(qǐng)問可以吧在哪里改具體說清楚嗎  回復(fù)  更多評(píng)論   


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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 苗栗县| 信宜市| 板桥市| 黄龙县| 师宗县| 枣强县| 重庆市| 清水河县| 阳西县| 从化市| 仁寿县| 日照市| 濮阳县| 应城市| 无锡市| 昌吉市| 平远县| 嘉善县| 冕宁县| 英山县| 上思县| 洮南市| 泽州县| 海盐县| 镇原县| 山东省| 普安县| 宜宾市| 峨边| 华安县| 仁寿县| 延川县| 牙克石市| 湖北省| 通州区| 休宁县| 青冈县| 无为县| 泰州市| 锡林郭勒盟| 阳城县|