<TL;DR>
Trying to run a subsystem extension in host controller and it fails because some of its
service dependencies are missing. Am I doing something wrong (it would not be a shocker if
I was) or are these services really not deployed inside the Host Controller?
</TL;DR>
I'm trying to get a subsystem extension to run inside of the Host Controller. This is
a subsystem extension that runs fine in a standalone WildFly container - just trying to
get it to run in a host controller (and maybe later in a domain controller as well).
In domain/configuration/host.xml, I add my own <subsystem> in the <profile> -
and that seems to run OK (well, not OK, but I know it is getting its initialization method
invoked by the container).
Because I need an outbound socket binding defined, I put add a socket-binding-groups in
the host.xml (there are no socket-binding-groups in here by default):
<socket-binding-groups>
<socket-binding-group default-interface="public"
name="standard-sockets">
<outbound-socket-binding name="hawkular">
<remote-destination host="127.0.0.1"
port="8080"/>
</outbound-socket-binding>
</socket-binding-group>
</socket-binding-groups>
That causes the container to abort with "WFLYCTL0198: Unexpected element
'{urn:jboss:domain:4.0}socket-binding-groups' encountered" So I remove
<socket-binding-groups> so that <socket-binding-group> is a direct child of
the top-level <host>. The container starts OK when I do this.
But now the problems - my subsystem registers itself with a few service dependencies that
do not exist at the time my service is initialized - specifically:
jboss.naming.context.java
(o.j.a.naming.deployment.ContextNames.JAVA_CONTEXT_SERVICE_NAME)
jboss.outbound-socket-binding
(o.j.a.network.OutboundSocketBinding.OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME)
jboss.server.environment (o.j.a.server.ServerEnvironmentService.SERVICE_NAME)
jboss.as.server-controller (o.j.a.server.Services.JBOSS_SERVER_CONTROLLER)
When the host controller runs, I get this startup error:
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013:
Operation ("add") failed - address: ([
("host" => "master"),
("subsystem" => "hawkular-wildfly-agent")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable
dependencies" => [
"\"org.hawkular.agent.\".hawkular-wildfly-agent is missing
[jboss.outbound-socket-binding.hawkular, jboss.server.environment,
jboss.as.server-controller]",
"jboss.naming.context.java.abc is missing [jboss.naming.context.java]"
]}
Sooo..... my question is - what happens if a subsystem needs these things? Do I need to do
something special to make them available or are they really not deployed in the host
controller?
What I need these for is:
jboss.naming.context.java - so I can store something in JNDI (actually, for my use case, I
can probably skip this dependency - I don't think I will need it when running in the
host controller)
jboss.outbound-socket-binding - my subsystem needs to talk to an external server and this
defines what host/port that server is on
jboss.server.environment - I need this to find out where the host controller's data
directory is (e.g. domain/data). Is there another way to get this?
jboss.as.server-controller - I need this to obtain information from the management model
such as "/:uuid" (which it looks like HCs do not have), the
"/:launch-type" attribute and others.