Wednesday, July 27, 2011

java.lang.SecurityException When Shutdowning JBoss

We can run following command when starting JBoss. We assume there are already jboss system user in OS.

# Centos
su jboss -c '$JBOSS_HOME/bin/ -b > /dev/null 2> /dev/null &'
# Ubuntu
sudo -u jboss $JBOSS_HOME/bin/ -b > /dev/null 2> /dev/null &

Stopping jboss actually should be done by running this

# Centos
su jboss -c '$JBOSS_HOME/bin/ -S &'
# for ubuntu
sudo -u jboss '$JBOSS_HOME/bin/ -S &'

But in my system this will Exception in thread "main" java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console. This is happen because likely we have enabled the interceptor in jmx-invoker-service.xml file in deploy folder. Then for shuttingdown jboss we should provide some credential that we can see at login-config.xml file in the conf folder.

So the shutdown command should be like this
# Centos
su jboss -c '$JBOSS_HOME/bin/ -S -u admin -p admin &'
# for ubuntu
sudo -u jboss '$JBOSS_HOME/bin/ -S -u admin -p admin &'

Actually there still some exception when running this. jboss.remoting:service=invoker,transport= bisocket,,port=4457,JBM_clientMaxPoolSize=200,clientLeasePeriod=10000,clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper,dataType=jms,marshaller=org.jboss.jms.wireformat.JMSWireFormat,numberOfCallRetries=1,numberOfRetries=10,pingFrequency=214748364,pingWindowFactor=10,socket.check_connection=false,timeout=0,unmarshaller=org.jboss.jms.wireformat.JMSWireFormat is not registered.


2011-07-27 10:06:07,835 ERROR [org.jboss.remoting.transport.Connector] invalid Object Name jboss.remoting:service=invoker,transport= socket,,port=3873 is not registered.

But after running

ps ax | grep java

I cannot see any JBoss instance that still running. So I conclude that shutdowning has been done correcly. I will check the later issue when have time. Meanwhile those shutdowning command can be put into some script.


No comments:

Post a Comment