Saturday, December 17, 2011

JBoss - Shutdown script throws Security Exception

Problem
    Do you get this error when you try and shutdown the JBoss420EAP server using the shutdown script ?

D:\JBoss420EAP\jboss-as\bin>shutdown.bat -s jnp://localhost:1199
Exception in thread "main" java.lang.SecurityException: Failed to authenticate principal=admin, securityDomain=jmx-console
        at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:97)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
Solution
1. Kill you currently runnin JBoss instance, ctrl+c or kill the java process whichever way you usually do.
2. Navigate to <<JBOSS_HOME>>\jboss-as\server\default\conf\props\jmx-console-users.properties
3. Uncomment the admin=admin line
4. Restart your JBoss server
5. Now try to shutdown using the following command.
shutdown.bat -s jnp://localhost:1199 -u=admin -p=admin

No comments:

Post a Comment