EzDevInfo.com

immutant

A suite of libraries for Clojure apps Immutant | Home

how can immutant be configured to serve ips other than localhost (127.0.0.1)

I'm not sure how to configure my immutant installation to serve webpages

when I do:

>> lein immutant run 

>> curl http://127.0.0.1:8080/testing

it works, but

>> curl http://172.20.10.3:8080/testing

which is an alternative ip on my computer does not.

Where can we configure this option?


Source: (StackOverflow)

How do I configure HornetQ for STOMP in Immutant 2

My ultimate purpose is to make WebSocket clients participate in messaging. This seems to be supported and well documented in the sibling project TorqueBox but I can't find any information in the Immutant docs.


Source: (StackOverflow)

Advertisements

How to use config immutant to implement quartz cluster?

I want to start several web-server, and every server has a quartz instance for avoiding the job being interrupted by restarting the server.

I found that immutant can config the single job .But when i run the server i found that the scheme use the not-cluster config.And i do not know how to config it.


Source: (StackOverflow)

immutant failing to add a cache to a web cache container

I have a heimdallr application that is deployed via wildfly. In this application I am using the cache functionality that is provided by the namespace immutant.caching.

The first time I deploy the application everything goes fine without error. If I attempt to redeploy the application I get the following error:

2015-05-27 18:20:54,703 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 82) MSC000001: Failed to start service jboss.infinispan.web.dist: org.jboss.msc.service.StartException in service jboss.infinispan.web.dist: java.lang.IllegalStateException: Cache container has been stopped and cannot be reused. Recreate the cache container.
        at org.jboss.as.clustering.msc.AsynchronousService$1.run(AsynchronousService.java:91)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_25]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_25]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]
        at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.IllegalStateException: Cache container has been stopped and cannot be reused. Recreate the cache container.
        at org.infinispan.manager.DefaultCacheManager.assertIsNotTerminated(DefaultCacheManager.java:797)
        at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:389)
        at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:412)
        at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:103)
        at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:94)
        at org.jboss.as.clustering.infinispan.subsystem.CacheService.start(CacheService.java:78)
        at org.jboss.as.clustering.msc.AsynchronousService$1.run(AsynchronousService.java:86)
        ... 4 more

2015-05-27 18:20:54,710 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC000001: Failed to start service jboss.infinispan.web."my-application.war".config: org.jboss.msc.service.StartException in service jboss.infinispan.web."my-application.war".config: JBAS010291: Failed to add DIST_ASYNC my-application.war cache to non-clustered web cache container.
        at org.jboss.as.clustering.infinispan.subsystem.AbstractCacheConfigurationService.start(AbstractCacheConfigurationService.java:73)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_25]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_25]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]

The way I initialize the cache is

(def site-cache (agent
                  (immutant.caching/cache "site-cache" :ttl [ttl :seconds])
                  :error-mode :continue
                  :error-handler (fn [the-agent exception]
                                  (log/error "Exception in Site Agent " exception (string/join "\n" (.getStackTrace *e))))))

With using immutant 2.x my understanding is that the immutant.caching/cache should create the container if it doesn't exist. Is there a way for me to verify the cache container exists, and if not create it before I attempt to add a cache to it?

EDIT: This was being caused by an error with our deployment scripts. A hack had been done to deploy the same .war twice, which caused the application to not shut down properly causing the error.


Source: (StackOverflow)

Can Immutant be configured to use something other than 8080 as well as to use SSL?

I am playing around with immutant and was wondering how to set two things:

  • to setup an alternative ssl port
  • to use port 80 instead of port 8080

Source: (StackOverflow)

error while using immutant server to access page from browser

$ lein new pedestal-service peddy

and then add following file to immutant folder

(ns immutant.init
  (:require [immutant.web :as web]
            [io.pedestal.http :as http]
            [peddy.service :as app]))

(web/start-servlet "/" (::http/servlet (http/create-servlet app/service)))

after that

$ lein immutant deploy peddy

and then

$ lein immutant run

immutant server stated with nrepl

but when i try to open page in browser it throws error

I am using immutant 1.1.4 and pedestal-service 0.4.0

stack-trace of error

ERROR [io.pedestal.http.impl.servlet-interceptor] (http-/0.0.0.0:8080-1) {:line 293, :msg "error-stylobate triggered", :context {:io.pedestal.impl.interceptor/terminators (#<servlet_interceptor$terminator_inject$fn__11550 io.pedestal.http.impl.servlet_interceptor$terminator_inject$fn__11550@7681d2d5>), :io.pedestal.impl.interceptor/stack (#io.pedestal.interceptor.Interceptor{:name :io.pedestal.http.impl.servlet-interceptor/terminator-injector, :enter #<helpers$before$fn__9159 io.pedestal.interceptor.helpers$before$fn__9159@76b5905>, :leave nil, :error nil}), :io.pedestal.impl.interceptor/execution-id 1, :servlet #<FnServlet io.pedestal.http.servlet.FnServlet@4b4b3283>, :servlet-config #<Dynamic org.apache.catalina.core.StandardWrapperFacade$Dynamic@1e733d96>, :servlet-response #<ResponseFacade org.apache.catalina.connector.ResponseFacade@28a7423c>, :servlet-request #<RequestFacade org.apache.catalina.connector.RequestFacade@2f3f5533>}}: clojure.lang.ExceptionInfo: Interceptor Exception: No matching field found: getContentLengthLong for class org.apache.catalina.connector.RequestFacade {:execution-id 1, :stage :enter, :interceptor :io.pedestal.http.impl.servlet-interceptor/stylobate, :exception-type :java.lang.IllegalArgumentException, :exception #<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: getContentLengthLong for class org.apache.catalina.connector.RequestFacade>}
    at clojure.core$ex_info.invoke(core.clj:4403) [clojure-1.6.0.jar:]
    at io.pedestal.impl.interceptor$throwable__GT_ex_info.invoke(interceptor.clj:37)
    at io.pedestal.impl.interceptor$try_f.invoke(interceptor.clj:53)
    at io.pedestal.impl.interceptor$enter_all_with_binding.invoke(interceptor.clj:140)
    at io.pedestal.impl.interceptor$enter_all$fn__8979.invoke(interceptor.clj:156)
    at clojure.lang.AFn.applyToHelper(AFn.java:152) [clojure-1.6.0.jar:]
    at clojure.lang.AFn.applyTo(AFn.java:144) [clojure-1.6.0.jar:]
    at clojure.core$apply.invoke(core.clj:624) [clojure-1.6.0.jar:]
    at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862) [clojure-1.6.0.jar:]
    at clojure.lang.RestFn.invoke(RestFn.java:425) [clojure-1.6.0.jar:]
    at io.pedestal.impl.interceptor$enter_all.invoke(interceptor.clj:154)
    at io.pedestal.impl.interceptor$execute.invoke(interceptor.clj:272)
    at io.pedestal.http.impl.servlet_interceptor$interceptor_service_fn$fn__11571.invoke(servlet_interceptor.clj:399)
    at io.pedestal.http.servlet.FnServlet.service(servlet.clj:28)
    at immutant.web.servlet.ServletProxy.service(servlet.clj:64)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.x.slim.incremental.18.jar:7.2.x.slim.incremental.18]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45-internal]
Caused by: java.lang.IllegalArgumentException: No matching field found: getContentLengthLong for class org.apache.catalina.connector.RequestFacade
    at clojure.lang.Reflector.getInstanceField(Reflector.java:271) [clojure-1.6.0.jar:]
    at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:315) [clojure-1.6.0.jar:]
    at io.pedestal.http.impl.servlet_interceptor$add_content_length.invoke(servlet_interceptor.clj:206)
    at io.pedestal.http.impl.servlet_interceptor$request_map.invoke(servlet_interceptor.clj:224)
    at io.pedestal.http.impl.servlet_interceptor$enter_stylobate.invoke(servlet_interceptor.clj:255)
    at io.pedestal.impl.interceptor$try_f.invoke(interceptor.clj:50)
    ... 25 more

Source: (StackOverflow)

Sending an HTTP request while running Immutant

I'm running Immutant. Can/should I use clj-http to send requests, or is there a better way of going about this?


Source: (StackOverflow)

Deploying Immutant to WildFly with several contexts

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?


Source: (StackOverflow)

Deploying Multiple Immutant WAR files to Wildfly

I don't think this is version specific but I'll specify I'm on Immutant 2.1.0 and Wildfly 9.0.1.Final.

I start with a stock, freshly unzipped wildfly download and run it with $ wildfly-9.0.1.Final/bin/standalone.sh. I run $ lein immutant war in my clojure project with the following in my project.clj:

:immutant {:war {:destination "/srv/wildfly-9.0.1.Final/standalone/deployments/"
                 :context-path "/app1}}

This works fine and I have my app at http://localhost:8080/app1. The problem is when I do this with a second app with :context-path "/app2", wildfly complains:

>Caused by: org.jboss.msc.service.DuplicateServiceException: 
 Service jboss.pojo.\"org.jboss.netty.internal.LoggerConfigurator\".DESCRIBED 
 is already registered"

If I do this process with app2 before app1, app2 gets correctly deployed but app1 gets a complaint. Both can be deployed individually but not at the same time.

I don't know if I'm missing a step at WAR time or missing wildfly configuration or what.


Source: (StackOverflow)

clustered immutant2 instances

Is there any way to run few clustered immutant2 based apps with no deploy to wildfly? I would like to test distributed cache having two REPLs opened but I see no option in immutant docs to have these 2 sessions in 1 cluster.

Looks like for immutant 1.x it was --clustered option for lein.


Source: (StackOverflow)

Preferred way to connect to Immutant Message Queuing service from eg C# application

Title does not include this constraint: the Broker needs to be embedded.

With straight HornetQ I would just use StompConnect to expose the service to the outside world and that would allow .NET clients to connect pretty easily. There's also the possibility of websockets and REST now.

What is the preferred method?


Source: (StackOverflow)

Failing to create WAR file from Immutant

When I attempt to create a war file via the command

lein with-profile prod immutant war

I get an error stating:

Error encountered performing task 'immutant' with profile(s): 'prod' Uberjar aborting because jar failed: No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: java.lang.Character

My project file is as below

(defproject company/project-name "0.0.2-SNAPSHOT"
  :description "project description"
  :url "http://www.comapny-url.com"
  :license {:name "company name license"
            :url "http://www.company-url.com"}
  :min-lein-version "2.4.3"
  :java-opts ["-Xmx5g" "-server" "-XX:-OmitStackTraceInFastThrow"]
  :exclusions [org.clojure/clojure]
  :dependencies [[company/lib-name1 "1.2.9" :exclusions [com.taoensso/encore]]
                 [company/lib-name2 "1.1.1"]
                 [org.clojure/clojure "1.6.0"]
                 [org.clojure/data.zip "0.1.1"]
                 [org.clojure/tools.nrepl "0.2.10"]
                 [com.palletops/leaven "0.3.1"]
                 [com.github.kyleburton/clj-xpath "1.4.5"]
                 [metrics-clojure "2.5.1"]]
  :java-source-paths ["java/src"]
  :javac-options ["-target" "1.7" 
                  "-source" "1.7" "-Xlint:-options" 
                  "-cp" "resources/jars/jms-lib.jar:resources/jars/clojure-1.6.0.jar:resources/jars/log4j-1.2.17.jar"
                  "-d" "resources/classes"]
  :profiles {:dev {:source-paths ["dev"]
                   :dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :plugins [[lein-package "2.1.1"]
                             [lein-marginalia "0.7.1"]]}
             :prod {:source-paths "prod"
                    :main prod}}
  :prep-tasks ["javac" "compile"]
  :resource-paths ["resources/classes"]
  :plugins [[lein-package "2.1.1"]
            [lein-immutant "2.0.1"]]
  :immutant {:war {:resource-paths ["war-resources"]}
             :nrepl {:port 8183
                     :host "0.0.0.0"
                     :interface "0.0.0.0"
                     :start? true}}
  :hooks [leiningen.package.hooks.deploy leiningen.package.hooks.install]
  :package {:skipjar true
            :autobuild true
            :reuse false
            :artifacts [{:build "with-profile prod immutant war --name=%p%v%t" :extension "war"}]}
  :uberjar-exclusions [#"(?i)^META-INF/[^/]*\.SF$"] ;; Eliminate the signing code from the uberjar
  :repositories ^:replace [["nexus" {:url "comapny.respository.net"}]])

The prod profile is laid out like so

(ns prod
      (:require  
        [company.lib-name3
         [debug :as debug]
         [system :refer (go)]])
  (:gen-class))

(defn -main
  "Initialize and start the app as a war"
  []
  (go))

I can build up an uberjar if I use my dev profile which is laid out as so:

(ns user
    "Tools for interactive development with the REPL. This file should
    not be included in a production build of the application."
    (:require  [clojure.java.io :as io]
        [clojure.java.javadoc :refer  (javadoc)]
        [clojure.pprint :refer  (pprint)]
        [clojure.reflect :refer  (reflect)]
        [clojure.repl :refer  (apropos dir doc find-doc pst source)]
        [clojure.set :as set]
        [clojure.string :as str]
        [clojure.test :as test]
        [clojure.tools.namespace.repl :refer  (refresh refresh-all)]
        [company.lib-name3
         [debug :as debug]
         [system :refer (go)]]))

(defn -main
  []
  (go))

Source: (StackOverflow)

Fail to connect to queue with Immutant messaging

Currently I have an instance of ActiveMQ running, that I am attempting to connect to using immutant. Currently the code for this connection looks like so;

(defn make-ctx
  []
  (log/debug "making context")
  (let [ctx (m/context :host (:host immutant-host) :port (:port immutant-host))]
    (log/debug "context created")
    ctx))

(defn make-listener
  [ctx]
  (let [listener (m/listen topic #(log/debug %) :context ctx)]
    (log/debug "listener created")
    listener))

(defn immutant-test
  []
  (log/debug "testing immutant messaging with ActiveMQ")
  (let [ctx (make-ctx)
        listener (make-listener ctx)]
  (Thread/sleep 15000)
  (.close listener)))

Though my code does not make it passed the make-ctx function. When it attempts to create the context I get the error

Exception in thread "main" java.lang.RuntimeException: javax.jms.JMSException: Failed to create session factory
    at org.projectodd.wunderboss.messaging.jms.DestinationUtil.mightThrow(DestinationUtil.java:47)
    at org.projectodd.wunderboss.messaging.jms.JMSMessagingSkeleton.createContext(JMSMessagingSkeleton.java:64)
    at org.projectodd.wunderboss.messaging.jms.JMSMessagingSkeleton.createContext(JMSMessagingSkeleton.java:181)
    at immutant.messaging$context.doInvoke(messaging.clj:84)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at jms_test.core$make_ctx.invoke(core.clj:24)
    at jms_test.core$immutant_test.invoke(core.clj:37)
    at jms_test.core$_main.invoke(core.clj:158)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at jms_test.core.main(Unknown Source)
Caused by: javax.jms.JMSException: Failed to create session factory
    at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:673)
    at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:112)
    at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:107)
    at org.projectodd.wunderboss.messaging.jms.JMSMessagingSkeleton$1.call(JMSMessagingSkeleton.java:73)
    at org.projectodd.wunderboss.messaging.jms.DestinationUtil.mightThrow(DestinationUtil.java:45)
    ... 10 more
Caused by: HornetQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=HQ119013: Timed out waiting to receive cluster topology. Group:null]
    at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:946)
    at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:669)
    ... 14 more

The immutant-host is defined as

(def immutant-host {:host "127.0.0.1" :port 61616})

I've been able to connect to my broker with the clamq libray ,and am able to send and receive messages with that. Though because the rest of the application is built with immutant messaging I'd like to stick with that library if possible to keep from having to support several messaging libraries.


Source: (StackOverflow)

Clojure Immutant 2 server Undertow; how to handle http POST?

Putting the following line into my compojure defroutes to use clojure-paypal-ipn calling the two handler functions.

(POST "/paypal/ipn" [] (make-ipn-handler payment/paypal-data payment/paypal-error))

How do I handle a POST request within Immutant?

I'm using Immutant 2.0 with Clojure 1.7-beta1 and building off the Immutant feature demo. Posting directly with cURL give these same results, although I'm trying to use PayPal IPN.

17:29:40.220 ERROR [io.undertow.request] (XNIO-1 task-1) Undertow request failed HttpServerExchange{ POST /paypal/ipn}
java.io.IOException: mark/reset not supported
    at java.io.InputStream.reset(InputStream.java:348) ~[na:1.8.0_45]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93) ~[clojure-1.7.0-beta1.jar:na]
    at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:313) ~[clojure-1.7.0-beta1.jar:na]
    at clojure_paypal_ipn.core$req__GT_raw_body_str.invoke(core.clj:59) ~[na:na]
    at clojure_paypal_ipn.core$make_ipn_handler$fn__16823.invoke(core.clj:69) ~[na:na]
    at compojure.response$eval6101$fn__6102.invoke(response.clj:34) ~[na:na]
    at compojure.response$eval6068$fn__6069$G__6059__6076.invoke(response.clj:7) ~[na:na]
    at compojure.core$make_route$fn__7513.invoke(core.clj:113) ~[na:na]
    at compojure.core$wrap_route_middleware$fn__7509.invoke(core.clj:103) ~[na:na]
    at compojure.core$if_route$fn__7488.invoke(core.clj:41) ~[na:na]
    at compojure.core$if_method$fn__7480.invoke(core.clj:27) ~[na:na]
    at compojure.core$routing$fn__7519.invoke(core.clj:127) ~[na:na]
    at clojure.core$some.invoke(core.clj:2568) ~[clojure-1.7.0-beta1.jar:na]
    at compojure.core$routing.doInvoke(core.clj:127) ~[na:na]
    at clojure.lang.RestFn.applyTo(RestFn.java:139) ~[clojure-1.7.0-beta1.jar:na]
    at clojure.core$apply.invoke(core.clj:630) ~[clojure-1.7.0-beta1.jar:na]
    at compojure.core$routes$fn__7523.invoke(core.clj:132) ~[na:na]
    at immutant.web.internal.undertow$wrap_undertow_session$fn__5292.invoke(undertow.clj:69) ~[na:na]
    at immutant.web.internal.undertow$create_http_handler$reify__5362.handleRequest(undertow.clj:130) ~[na:na]
    at org.projectodd.wunderboss.web.async.websocket.UndertowWebsocket$2.handleRequest(UndertowWebsocket.java:96) ~[wunderboss-web-0.6.1.jar:na]
    at io.undertow.server.session.SessionAttachmentHandler.handleRequest(SessionAttachmentHandler.java:68) ~[undertow-core-1.1.0.Final.jar:1.1.0.Final]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) ~[undertow-core-1.1.0.Final.jar:1.1.0.Final]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) ~[undertow-core-1.1.0.Final.jar:1.1.0.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_45]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]

Source: (StackOverflow)

Multiple ring sites on one immutant?

Immutant allows applications to respond to web requests via Ring handlers. Each application can dynamically register any number of handlers, each with a unique context path. This allows you to have multiple Ring webapps that share the same deployment lifecycle.

So it says I can have multiple Ring apps on one immutant but can I/should I have two separate websites running on one immutant: site1.com and site2.com?

This context path is considered the top-level context path - you have the option to bind a handler to a sub-context path that will be nested within the top-level path. The full context is stripped from the url's path before the request is processed, and the context and remaining path info are made available as part of the request map via the :context and :path-info keys, respectively.

It sounds like I can have an app running on site1.com/context1 and site1.com/context2 but not so much two separate domains.

The reason I'm asking is because immutant takes up a lot of my server resources so much so I'm not sure if I can run two immutants. The correct question might be how do I improve performance on my immutant? (I'm not any good with servers/deployment.)

Source: http://immutant.org/documentation/0.1.0/web.html


Source: (StackOverflow)