In previous versions of JBoss EAP 6, model validation was not being performed to ensure an HTTP management interface configured to enable SSL also referenced a security realm to obtain its SSLContext.
Without the validation, the SecurityRealm was null, which lead to a `NullPointerException`.
In this release the time updates are applied to the management model and additional checks are performed to ensure a security realm is associated with the HTTP management interface is SSL is being enabled.
If a user attempts to define a HTTP management interface with SSL but no SecurityRealm an error message is reported instead of the `NullPointerException`.
Description of problem:
Configuring as follow:-
<management-interfaces>
<native-interface security-realm="ManagementRealm">
<socket-binding native="management-native"/>
</native-interface>
<http-interface>
<socket-binding http="management-http" https="management-https"/>
</http-interface>
</management-interfaces>
NPE is thrown at startup:-
16:55:03,318 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.serverManagement.controller.management.http: org.jboss.msc.service.StartException in service jboss.serverManagement.controller.management.http: java.lang.NullPointerException
at org.jboss.as.server.mgmt.HttpManagementService.start(HttpManagementService.java:220) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_37]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_37]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_37]
Caused by: java.lang.NullPointerException
at org.jboss.as.domain.http.server.ManagementHttpServer.create(ManagementHttpServer.java:157)
at org.jboss.as.server.mgmt.HttpManagementService.start(HttpManagementService.java:184) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
... 5 more
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1.
2.
3.
Actual results:
Expected results:
Additional info:
I think we shouldn't allow user to remove realm if https is enabled (enable https if realm is not present), because by aborting the server startup we disallow user to fix EAP by management operations (manual edit of config file would be the only option left).
Petr, what you are describing is a different issue - this BZ has been opened on the basis of an existing XML configuration and a NullPointerException being the result. A dev_ack has been added on that basis, increasing the scope now is not appropriate.
If you have a sequence of operations in this area that take the server from a bootable state to a non-bootable state please raise as a separate BZ and it will be triaged accordingly.
I thought that the configuration in piece of xml in description was achieved by management operations, but now I see, that EAP won't let user to add https and remove security realm at the same time, so I totally agree with proposed fix.
Description of problem: Configuring as follow:- <management-interfaces> <native-interface security-realm="ManagementRealm"> <socket-binding native="management-native"/> </native-interface> <http-interface> <socket-binding http="management-http" https="management-https"/> </http-interface> </management-interfaces> NPE is thrown at startup:- 16:55:03,318 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.serverManagement.controller.management.http: org.jboss.msc.service.StartException in service jboss.serverManagement.controller.management.http: java.lang.NullPointerException at org.jboss.as.server.mgmt.HttpManagementService.start(HttpManagementService.java:220) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_37] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_37] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_37] Caused by: java.lang.NullPointerException at org.jboss.as.domain.http.server.ManagementHttpServer.create(ManagementHttpServer.java:157) at org.jboss.as.server.mgmt.HttpManagementService.start(HttpManagementService.java:184) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4] ... 5 more Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: