Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have deployed an application using JBoss 4.2.2 on a 64-bit RHEL5 server. Since there are other JBoss servers, I had to change some port configurations so that there would be no conflicts when starting the server. So right now I'm using ports-01 from the sample-bindings.xml file that came in the docs/examples/binding-manager/samples directory. In addition, below is a list of all the files I've edited to reflect the new ports:

  • JBOSS_HOME/servers/default/deploy/jboss-web.deployer/server.xml:
    • Changed Connector port - 8080 to 8180
    • Changed AJP 1.3 Connector port - 8009 to 8109
  • JBOSS_HOME/server/default/deploy/jbossws.beans/META-INF/jboss-beans.xml
    • Changed 8080 to 8180
  • JBOSS_HOME/server/default/conf/jboss-service.xml:
    • Changed 8083 to 8183
    • Changed 1099 to 1299
    • Changed 1098 to 1298
    • Changed 4444 to 4644
    • Changed 4445 to 4645
    • Changed 4446 to 4646
    • Changed 4447 to 4647
  • JBOSS_HOME/server/default/conf/jboss-minimal.xml:
    • Changed 1099 to 1299
    • Changed 1098 to 1298

When I start the server (binding to localhost) everything is fine and I'm able to access the application. But when I try to shutdown the server I get the following error:

Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost [Root exception is javax.naming.CommunicationException : Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost: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 localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost: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 localhost: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:525) at java.net.Socket.connect(Socket.java:475) at java.net.Socket.(Socket.java:372) at java.net.Socket.(Socket.java:273) 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

Is there any other file that I need to change the 1099 to 1299, or am I missing some other step?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Shutdown.sh launches a separate java program that sends a JMX request to the jboss server process. It doesn't reference any configuration files to discover the new port, it just assumes the defaults. (how could it? you're not passing it your configuration directory)

So to connect to your jboss server running on the non-default port, you need to run it like so:

shutdown.sh --server=YOURHOST:1299

Also, if you're actually using the sample-binding.xml, i.e., if you uncommented the jboss.system:service=ServiceBindingManager mbean in jboss-service.xml & configured ServerName & StoreURL appropriately, then you shouldn't need to make any other configuration changes for the new ports. That's the point of the binding manager, to centralize all of that work.

share|improve this answer
    
I am getting the same CommunicationsException when I execute the command with the server parameter. I looked through the startup log and found this line as JBoss was starting up: 07:57:50,485 INFO [STDOUT] INFO 07:57:50,485 (SessionFactoryObjectFactory) - Not binding factory to JNDI, no JNDI name configured Could that have something to do with why I'm not able to shutdown correctly? –  Brian Feb 11 '10 at 13:08
    
Certainly could. I suspect that something went amiss while changing all your port settings manually. See if you can take an unaltered "default" configuration & make it work by changing nothing but the ServiceBindingManager entry in conf/jboss-service.xml. –  pra Feb 11 '10 at 21:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.