当前位置: 代码迷 >> JBoss >> 访问部署在JBOSS上的EJB服务端的有关问题
  详细解决方案

访问部署在JBOSS上的EJB服务端的有关问题

热度:3408   发布时间:2013-02-26 00:00:00.0
访问部署在JBOSS上的EJB服务端的问题
在本机访问部署在JBOSS上的EJB服务端时报如下错误:
javax.naming.CommunicationException: Could not obtain connection to any of these urls: 136.127.56.23:8088 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 retrieve stub from server 136.127.56.23:8088 [Root exception is java.io.EOFException]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at test.JbossEjbTest.main(JbossEjbTest.java:28)
Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server 136.127.56.23:8088 [Root exception is java.io.EOFException]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:268)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
... 4 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2232)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2698)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:750)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:268)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:255)
... 5 more

启动服务端的时候有用:run.sh -b 0.0.0.0命令
客户端程序在ctx.lookup();的时候报错。

------解决方案--------------------------------------------------------
好像你的端口不对啊,
java.naming.provider.url","136.127.56.23:8088
确定jboss-server-xml下的
<attribute name="Port">8088</attribute> ????
------解决方案--------------------------------------------------------
Web 端口多数情况下不等于 RMI/IIOP 端口, 8088 如果是访问 http://xxx:8088/yyy.jsp 的话,
那就基本上是搞错了,我上次用 jboss 5.0 GA 默认的 RMI 端口是 1099 跟 RMIRegistry.exe 默认的端口一样。


------解决方案--------------------------------------------------------
JBOSS下常用端口
。1099 TCP org.jboss.naming.NamingService
。1098 TCP org.jboss.naming.NamingService
。1162 UDP org.jboss.jmx.adaptor.snmp.trapd.TrapdService
。4444 TCP org.jboss.invocation.jrmp.server.JRMPInvoker
。4445 TCP org.jboss.invocation.pooled.server.PooledInvoker
。8009 TCP org.jboss.web.tomcat.tc4.EmbeddedTomcatService
。8009 TCP org.jboss.web.tomcat.tc4.EmbeddedTomcatService
。8083 TCP org.jboss.web.WebService
。8090 TCP org.jboss.web.OILServerILService
。8092 TCP org.jboss.mq.il.oil2.OIL2ServerILService
。8093 TCP org.jboss.mq.il.uil2.UILServerILService

你是通过JNDI服务 请求资源的 端口应该是1099