Java16_u21版本以下兼容性不强导致Jboss不能关闭
系统环境:
win 2003 x86
jdk1.6.0_21
jboss-5.1.0.GA
使用bin下自带的 run.bat 启动服务器,使用 Ctrl + C 关闭后正常,Jboos可以在次启动。使用 shutdown -S 关闭服务器后,启动报错,如下:
Exception in thread "main" javax.naming.CommunicationException: Could not obtain
connection to any of these urls: localhost:1099 [Root exception is javax.naming
.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [R
oot exception is javax.naming.ServiceUnavailableException: Failed to connect to
server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Co
nnection refused: connect]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.Shutdown.main(Shutdown.java:219)
Caused by: javax.naming.CommunicationException: Failed to connect to server loca
lhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException
: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.n
et.ConnectException: Connection refused: connect]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)
... 4 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server
localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connecti
on refused: connect]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)
... 5 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:529)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory
.java:97)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory
.java:82)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)
... 5 more
换用Jdk5解决问题,具体版本为jdk1.5.0_06,后来又试验了其它版本的jdk6_1.6.0.013也可以。