部署环境:
1.linux(RHEL5.0),JBOSS 4.2.2,JDK 1.5.0,部署JMS服务端(Vmware虚拟机)
2.win7 JMS客户端
通过JMS客户端调用JMS服务端,产生入下错误:
2010-06-20 19:10:19,783 - [com.aspire.cmgp.smspush.common.ConfigManager] - 0 [main] DEBUG - Invoker ConfigManager one parameter Instance
JBOSS_SERVER_HOME_DIR is : null
isEncoding is : false
2010-06-20 19:10:19,783 - [com.aspire.cmgp.smspush.common.FileInfo] - 0 [main] DEBUG - is **##=
jndiPath is : ConnectionFactory
2010-06-20 19:10:19,799 - [com.aspire.cmgp.smspush.common.ConfigManager] - 16 [main] DEBUG - Invoker ConfigManager one parameter Instance
JBOSS_SERVER_HOME_DIR is : null
isEncoding is : false
2010-06-20 19:10:19,799 - [com.aspire.cmgp.smspush.common.FileInfo] - 16 [main] DEBUG - is **##=
2010-06-20 19:10:19,799 - [com.aspire.cmgp.smspush.common.ConfigManager] - 16 [main] DEBUG - this.fileInfo is :{java.naming.provider.url=192.168.167.92:1099, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2010-06-20 19:10:20,844 - [org.jnp.interfaces.NamingContext] - 1061 [main] DEBUG - Failed to connect to 192.168.167.92:1099
javax.naming.CommunicationException: Failed to connect to server 192.168.167.92:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 192.168.167.92:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
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 com.aspire.cmgp.smspush.common.JndiLookup.lookup(JndiLookup.java:44)
at com.aspire.cmgp.smspush.client.QueueSend.(QueueSend.java:46)
at com.aspire.cmgp.smspush.client.CmgpSmsPushClient.sendMessageOriginal(CmgpSmsPushClient.java:84)
at com.aspire.cmgp.smspush.client.CmgpSmsPushClient.main(CmgpSmsPushClient.java:145)
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server 192.168.167.92:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
... 8 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.(Socket.java:366)
at java.net.Socket.(Socket.java:266)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)
... 8 more
2010-06-20 19:10:25,853 - [com.aspire.cmgp.smspush.common.JndiLookup] - 6070 [main] ERROR - JNDI查找EJB接口出错!错误原因javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.167.92: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.167.92:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 192.168.167.92:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
2010-06-20 19:10:25,853 - [com.aspire.cmgp.smspush.client.CmgpSmsPushClient] - 6070 [main] ERROR - 发送短信息时出现错误,错误原因:java.lang.NullPointerException
查不出原因,将客户端部署至linux中,可以正常调用JMS。又起了一个linux虚拟机,将客户端部署在上面测试,抛出异常为unknowhost,修改客户端主机/ect/hosts文件,增加服务端IP地址和主机名映射,service xinetd restart重启生效后,调用成功。
在网上搜罗后最终解决办法为修改JBOSS启动命令:
./run.sh -Djava.rmi.server.hostname=192.168.174.129 --host 0.0.0.0 > nohup.out &
(指定IP为hostname,避免出现UNKNOWHOST问题)
阅读(2204) | 评论(0) | 转发(0) |