1

I have an Undertow web server with Immutant (Clojure), my main- looks like this:

(run
  (-> routes/app
    wrap-something-app-specific
    wrap-params)
  (options
    {:path "/" :port 8080}))

(run
  (-> routes/billing
    wrap-something-billing-specific)
  (options
    {:path "/billing" :port 8081
     :worker-threads 4}))

When running not in a WildFly countainer, it works just fine: localhost:8080/ maps to app routes, and localhost:8081/billing to billing routes. However when I do deploy to WildFly as a ROOT, I can get only one context working, never both. I've tried all combinations of :path / :port params. WildFly logs include this:

13:07:46,295 INFO  [org.projectodd.wunderboss.web.Web] (MSC service thread 1-12) Registered web context /billing
13:07:46,308 INFO  [org.projectodd.wunderboss.web.Web] (MSC service thread 1-12) Registered web context /
................
13:07:46,325 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-12) JBAS017534: Registered web context: /

So how do I make Undertow register both contexts?

lobanovadik
  • 1,018
  • 8
  • 14
  • Abbé Résina's answer is correct, because WildFly admins will have already configured its embedded web server for their environment. Additional ones likely won't be accessible. Your apps are already uniquely identified by the :path option alone. Is there another reason why you require two physical embedded Undertow instances? – jcrossley3 Feb 11 '15 at 13:22
  • 1
    Ah! I just noticed you set :worker-threads on your billing server. Unfortunately, within WildFly, that's not possible as there's only one Undertow instance, and its configuration is determined by the sysadmins for all apps deployed to it. – jcrossley3 Feb 11 '15 at 13:32
  • @jcrossley3 yes, I wanted to have an isolated worker pool. Thanks for clearing that out! – lobanovadik Feb 11 '15 at 13:50

1 Answers1

2

This is not a solution but it can give you a hint on what's happening. From Immutant/WildFly documentation, it looks like your problem may come from this limitation when deploying and running into WildFly:

When running inside WildFly, the :host and :port options to immutant.web/run are silently ignored since your handlers are mounted on WildFly’s internal Undertow server, bound to whatever host/port it’s been configured for.

T.Gounelle
  • 5,953
  • 1
  • 22
  • 32