$ lein new pedestal-service peddy
and add following file 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
$ lein immutant run
immutant server stated nrepl
but when try open page in browser throws error
i using immutant 1.1.4 , 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 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 class org.apache.catalina.connector.requestfacade>} @ clojure.core$ex_info.invoke(core.clj:4403) [clojure-1.6.0.jar:] @ io.pedestal.impl.interceptor$throwable__gt_ex_info.invoke(interceptor.clj:37) @ io.pedestal.impl.interceptor$try_f.invoke(interceptor.clj:53) @ io.pedestal.impl.interceptor$enter_all_with_binding.invoke(interceptor.clj:140) @ io.pedestal.impl.interceptor$enter_all$fn__8979.invoke(interceptor.clj:156) @ clojure.lang.afn.applytohelper(afn.java:152) [clojure-1.6.0.jar:] @ clojure.lang.afn.applyto(afn.java:144) [clojure-1.6.0.jar:] @ clojure.core$apply.invoke(core.clj:624) [clojure-1.6.0.jar:] @ clojure.core$with_bindings_star_.doinvoke(core.clj:1862) [clojure-1.6.0.jar:] @ clojure.lang.restfn.invoke(restfn.java:425) [clojure-1.6.0.jar:] @ io.pedestal.impl.interceptor$enter_all.invoke(interceptor.clj:154) @ io.pedestal.impl.interceptor$execute.invoke(interceptor.clj:272) @ io.pedestal.http.impl.servlet_interceptor$interceptor_service_fn$fn__11571.invoke(servlet_interceptor.clj:399) @ io.pedestal.http.servlet.fnservlet.service(servlet.clj:28) @ immutant.web.servlet.servletproxy.service(servlet.clj:64) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:295) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:214) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:230) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:149) [jbossweb-7.2.0.final.jar:7.2.0.final] @ 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] @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:145) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:97) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:102) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:336) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.coyote.http11.http11processor.process(http11processor.java:856) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:653) [jbossweb-7.2.0.final.jar:7.2.0.final] @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:920) [jbossweb-7.2.0.final.jar:7.2.0.final] @ java.lang.thread.run(thread.java:745) [rt.jar:1.8.0_45-internal] caused by: java.lang.illegalargumentexception: no matching field found: getcontentlengthlong class org.apache.catalina.connector.requestfacade @ clojure.lang.reflector.getinstancefield(reflector.java:271) [clojure-1.6.0.jar:] @ clojure.lang.reflector.invokenoarginstancemember(reflector.java:315) [clojure-1.6.0.jar:] @ io.pedestal.http.impl.servlet_interceptor$add_content_length.invoke(servlet_interceptor.clj:206) @ io.pedestal.http.impl.servlet_interceptor$request_map.invoke(servlet_interceptor.clj:224) @ io.pedestal.http.impl.servlet_interceptor$enter_stylobate.invoke(servlet_interceptor.clj:255) @ io.pedestal.impl.interceptor$try_f.invoke(interceptor.clj:50) ... 25 more
this caused pedestal using .getcontentlengthlong(), added in version 3.1 of servlet spec. immutant 1.x based on jboss 7, uses version 3.0 of spec. means won't able use pedestal 0.4.0 in pre-3.1 container.
Comments
Post a Comment