有关Jboss停止的问题(linux环境下)

sun_ao 发布于 2013/04/16 14:36
阅读 1K+
收藏 0

【Gopher China万字分享】华为云的Go语言云原生实战经验!>>>

启动JBoss时,执行了2次启动脚本,发现进程里有2个,执行一次停止脚本,进程里会少一个,但是再执行停止脚本时就报错了,大致是1099端口已关闭.我想是在第一次执行停止脚本时就把1099关闭了,导致第二次执行就有问题.

目前除了杀(kill)进程处理,还有什么办法可以将重复启动的应用进程停掉吗?

更奇怪的是,有时执行停止脚本后,当第二个进程无法停止时,应用还能正常使用.

启动脚本:nohup sh /opt/jboss-4.2.2.GA/bin/run.sh -b 127.0.0.1 &

停止脚本:/opt/jboss-4.2.2.GA/bin/shutdown.sh --server=127.0.0.1

第二次停止时的报错:

Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1 [Root exception is javax.naming.CommunicationException: Failed to connect to server 127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]]]
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:392)
at org.jboss.Shutdown.main(Shutdown.java:214)
Caused by: javax.naming.CommunicationException: Failed to connect to server 127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
... 4 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server 127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
... 5 more
Caused by: java.net.ConnectException: Connection refused
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 java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:276)
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)
... 5 more


加载中
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部