I am using Spring Reactive WebClient to make HTTP calls. It uses JettyClientHttpConnector underneath. I am facing an issue that is frequent but doesn't always occur.
On spinning up the service sometimes all the calls through the web client are throwing InterruptedException(stack trace at the end). After about 200 requests we start receiving the below "Insufficient configured threads" exception possibly because earlier threads are not being released(is it possible to release these threads so they take on the next requests?).
What is causing the requests to fail with InterruptedException? I have verified that requests are not reaching the downstream service.
org.springframework.web.reactive.function.client.WebClientRequestException: Insufficient configured threads: required=200 \u003c max=200 for QueuedThreadPool[CustomJettyHttpClient#4fe3f9ef]#5ee9a1c4{STARTED,8\u003c=11\u003c=200,i=2,r=-1,q=0}[ReservedThreadExecutor#2e87a488{reserved=0/2,pending=0}]; nested exception is java.lang.IllegalStateException: Insufficient configured threads: required=200 \u003c max=200 for QueuedThreadPool[CustomJettyHttpClient#4fe3f9ef]#5ee9a1c4{STARTED,8\u003c=11\u003c=200,i=2,r=-1,q=0}[ReservedThreadExecutor#2e87a488{reserved=0/2,pending=0}]
Dependency
org.springframework:spring-webflux:jar:5.3.21.RELEASE
org.eclipse.jetty:jetty-client:9.4.48v20220622
org.springframework.boot:spring-boot-starter-jetty:jar:2.7.1.RELEASE
org.springframework.cloud:spring-cloud-stream-reactive:jar:2.2.0.RELEASE
WebClientConfig
WebClient.Builder.clone()
.clientConnector(new JettyClientHttpConnector(new HttpClient()))
.exchangeStrategies(ExchangeStrategies.builder().codecs((configurer) -> {
configurer.defaultCodecs().maxInMemorySize(2097152);
}).build())
.build();
ClientCall
URI request = UriComponentsBuilder
.fromUriString("foo")
.path("/path")
.build();
webClient.post()
.uri(request)
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromObject(requestbody))
.retrieve()
.bodyToMono(responsebody);
Exception:
org.springframework.web.reactive.function.client.WebClientRequestException: nested exception is java.lang.InterruptedException?
org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141) ~[spring-webflux-5.3.21.jar!/:5.3.21]?
reactor.core.publisher.MonoErrorSupplied.subscribe(MonoErrorSupplied.java:55) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.Mono.subscribe(Mono.java:4397) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:222) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:222) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.web.client.TraceExchangeFilterFunction$MonoWebClientTrace.subscribe(TraceExchangeFilterFunction.java:136) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:89) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:75) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:110) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:68) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.MonoCurrentContext.subscribe(MonoCurrentContext.java:36) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.Mono.subscribe(Mono.java:4397) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:200) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:77) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:110) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:89) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:75) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.request(FluxFilterFuseable.java:191) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:110) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onSubscribe(FluxFilterFuseable.java:87) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:68) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.MonoCurrentContext.subscribe(MonoCurrentContext.java:36) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:89) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:75) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:110) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:68) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.MonoCurrentContext.subscribe(MonoCurrentContext.java:36) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.Mono.subscribe(Mono.java:4397) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:426) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:89) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.runAsync(FluxPublishOn.java:440) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.run(FluxPublishOn.java:527) ~[reactor-core-3.4.19.jar!/:3.4.19]?
org.springframework.cloud.sleuth.instrument.reactor.ReactorSleuth.lambda$null$6(ReactorSleuth.java:324) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?
reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) ~[reactor-core-3.4.19.jar!/:3.4.19]?
reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) ~[reactor-core-3.4.19.jar!/:3.4.19]?
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]?
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]?
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]?
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]?
java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]?Caused by: java.lang.InterruptedException: null?
java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1040) ~[na:na]?
java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345) ~[na:na]?
java.base/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:232) ~[na:na]?
org.eclipse.jetty.io.ManagedSelector.doStart(ManagedSelector.java:127) ~[jetty-io-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.io.SelectorManager.doStart(SelectorManager.java:262) ~[jetty-io-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.client.AbstractConnectorHttpClientTransport.doStart(AbstractConnectorHttpClientTransport.java:64) ~[jetty-client-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.client.HttpClient.doStart(HttpClient.java:255) ~[jetty-client-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.48.v20220622.jar!/:9.4.48.v20220622]?
org.springframework.http.client.reactive.JettyClientHttpConnector.connect(JettyClientHttpConnector.java:115) ~[spring-web-5.3.21.jar!/:5.3.21]?
org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.exchange(ExchangeFunctions.java:103) ~[spring-webflux-5.3.21.jar!/:5.3.21]?
org.springframework.cloud.sleuth.instrument.web.client.TraceExchangeFilterFunction$MonoWebClientTrace.subscribe(TraceExchangeFilterFunction.java:135) ~[spring-cloud-sleuth-instrumentation-3.1.2.jar!/:3.1.2]?\t... 69 common frames omitted?
Try starting your Jetty HttpClient before you give it to the Spring JettyClientHttpConnector.
Your code:
WebClient.Builder.clone()
.clientConnector(new JettyClientHttpConnector(new HttpClient()))
...
Changed code:
HttpClient httpClient = new HttpClient();
QueuedThreadPool threadPool = new QueuedThreadPool();
threadPool.setMaxThreads(400);
httpClient.setExecutor(threadPool);
httpClient.start();
WebClient.Builder.clone()
.clientConnector(new JettyClientHttpConnector(httpClient))
...
That will let Jetty components start properly, before the lazy init of the spring side. Bonus is that you can now control the thread pool.
The 200 threads used can be quite normal, depends on how you are using the client. (eg: all 200 requests could be active at the same time and being processed).
It's not uncommon on aggressive HttpClient usage to have a system with thousands of threads connected to tens of thousands of remote sites (more common with HTTP/2 usage than HTTP/1)
You can periodically use httpClient.dump() to get a String dump of the state of the HttpClient at that point in time, including how it's using the connections, connection pools, requests, responses, thread pool, etc ...
Be aware of configuration on Jetty HttpClient for things like setMaxConnectionsPerDestination and setMaxRequestsQueuedPerDestination which could prove useful to know about in your situation.
Related
I am following dapp university todolist application using solidity. I am trying to call taskCount variable in the console from the deployed instance of the contract I have created, which should display 0 using this code.
todoList.taskCount()
Instead, I'm met with this error message:
truffle(ganache)> todoList = await TodoList.deployed()
undefined
truffle(ganache)> todoList.address
'0xA638921e45E90C255C339C6422Ac36ec73C4D1dc'
truffle(ganache)> todoList.taskCount()
Uncaught Error: Returned error: VM Exception while processing transaction: revert
at evalmachine.<anonymous>
at sigintHandlersWrap (node:vm:269:12)
at Script.runInContext (node:vm:138:14)
at runScript (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/packages/core/lib/console.js:369:1)
at Console.interpret (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/packages/core/lib/console.js:384:1)
at bound (node:domain:426:15)
at REPLServer.runBound [as eval] (node:domain:437:12)
at REPLServer.onLine (node:repl:902:10)
at REPLServer.emit (node:events:537:28)
at REPLServer.emit (node:domain:482:12)
at REPLServer.[_onLine] [as _onLine] (node:internal/readline/interface:425:12)
at REPLServer.[_line] [as _line] (node:internal/readline/interface:886:18)
at REPLServer.[_ttyWrite] [as _ttyWrite] (node:internal/readline/interface:1264:22)
at REPLServer.self._ttyWrite (node:repl:997:9)
at ReadStream.onkeypress (node:internal/readline/interface:273:20)
at ReadStream.emit (node:events:537:28)
at ReadStream.emit (node:domain:482:12)
at emitKeys (node:internal/readline/utils:358:14)
at emitKeys.next (<anonymous>)
at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36) {
data: {
'0x5ba781c62915a794566cc1d5d00e48ba45058fdf170b6b910bc45e6447dfa181': { error: 'revert', program_counter: 9, return: '0x' },
stack: 'RuntimeError: VM Exception while processing transaction: revert\n' +
' at Function.RuntimeError.fromResults (/Applications/Ganache.app/Contents/Resources/static/node/node_modules/ganache-core/lib/utils/runtimeerror.js:94:13)\n' +
' at /Applications/Ganache.app/Contents/Resources/static/node/node_modules/ganache-core/lib/blockchain_double.js:568:26',
name: 'RuntimeError'
},
hijackedStack: 'Error: Returned error: VM Exception while processing transaction: revert\n' +
' at Object.ErrorResponse (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/lib/errors.js:28:1)\n' +
' at /usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/web3/node_modules/web3-core-requestmanager/lib/index.js:302:1\n' +
' at /usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/packages/provider/wrapper.js:119:1\n' +
' at XMLHttpRequest.request.onreadystatechange (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/web3/node_modules/web3-providers-http/lib/index.js:98:1)\n' +
' at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)\n' +
' at XMLHttpRequest.exports.modules.996763.XMLHttpRequest._setReadyState (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:208:1)\n' +
' at XMLHttpRequest.exports.modules.996763.XMLHttpRequest._onHttpResponseEnd (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:318:1)\n' +
' at IncomingMessage.<anonymous> (/usr/local/Cellar/truffle/5.5.18/libexec/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:289:48)\n' +
' at IncomingMessage.emit (node:events:549:35)\n' +
' at IncomingMessage.emit (node:domain:545:15)\n' +
' at endReadableNT (node:internal/streams/readable:1359:12)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:82:21)'
}
How can I get past this error?
I am facing issue while loading ftl as I am getting the issue with binding data to it.
My code is somewhat like this:-
Map<String, DownloadReportBean> rootMap = new HashMap<String, DownloadReportBean>();
DownloadReportBean reportDetails = new DownloadReportBean();
List<EmailReportLinks> links = new ArrayList<EmailReportLinks>();
for (Map.Entry<String, String> entry : filenames.entrySet()) {
EmailReportLinks link = new EmailReportLinks();
link.setRange(entry.getValue());
link.setLink(generateDownloadlinkEmail(entry.getKey()));
links.add(link);
}
reportDetails.setName(user.getUsername());
reportDetails.setLinks(links);
reportDetails.setDate("" + new Date());
rootMap.put("reportDetails", reportDetails);
sendMailDownloadReport(emailid, subject, rootMap, report.ftl);
<#list reportDetails.links as linkobj> From Range
${linkobj.range},Refer- ${linkobj.link}
I also tried this but results are same.
<#list reportDetails.getLinks() as linkobj> From Range
${linkobj.range},Refer- ${linkobj.link}
I am not getting where I am doing wrong.
Following is the trace I am getting.
ERROR [freemarker.runtime] (default task-20) Template processing error: "Expression linkobj.range is undefined on line 62, column 14 in downloadreport.ftl.": freemarker.core.InvalidReferenceException: Expression linkobj.range is undefined on line 62, column 14 in downloadreport.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
at freemarker.core.Expression.getStringValue(Expression.java:118)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
at freemarker.core.Environment.visit(Environment.java:428)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.Environment.process(Environment.java:199)
at freemarker.template.Template.process(Template.java:237)
at com.ecomm.pl4sms.utility.GenerateEmail.sendMailDownloadReport(GenerateEmail.java:217)
at com.ecomm.pl4sms.utility.GenerateEmail.generateDownloadlinkNew(GenerateEmail.java:1119)
at com.pl4sms.webmodule.service.ClientService.generateFileAndSendEmail(ClientService.java:2202)
at com.pl4sms.webmodule.service.ClientService.downloadByDateSqlBoxtestcheck(ClientService.java:1880)
at com.pl4sms.webmodule.controller.ClientController.doDownloadtesting(ClientController.java:1210)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
ERROR [stderr] (default task-20) freemarker.core.InvalidReferenceException: Expression linkobj.range is undefined on line 62, column 14 in report.ftl.
Any Help would be very much Appreciable.
This just means that the range in some of those EmailReportLinks-s is null, and as you didn't handle that situation in the template, it will fail there. You have to decide what should it do in that case.
Amazon Sample Code :-
Caught an AmazonClientException, which means the client encountered a serious internal problem while trying to communicate with AWS, such as not being able to access the network.
Error Message: Unable to execute HTTP request:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
public static void main(String[] args) throws Exception {
init();
try {
String tableName = "my-favorite-movies-table";
// Create a table with a primary hash key named 'name', which holds a string
CreateTableRequest createTableRequest = new CreateTableRequest().withTableName(tableName).withKeySchema(new KeySchemaElement().withAttributeName("name").withKeyType(KeyType.HASH)).withAttributeDefinitions(new AttributeDefinition().withAttributeName("name").withAttributeType(ScalarAttributeType.S)).withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(1L).withWriteCapacityUnits(1L));
// Create table if it does not exist yet
TableUtils.createTableIfNotExists(dynamoDB, createTableRequest);
// wait for the table to move into ACTIVE state
TableUtils.waitUntilActive(dynamoDB, tableName);
} catch(AmazonServiceException ase) {
System.out.println("Caught an AmazonServiceException, which means your request made it " + "to AWS, but was rejected with an error response for some reason.");
System.out.println("Error Message: " + ase.getMessage());
System.out.println("HTTP Status Code: " + ase.getStatusCode());
System.out.println("AWS Error Code: " + ase.getErrorCode());
System.out.println("Error Type: " + ase.getErrorType());
System.out.println("Request ID: " + ase.getRequestId());
} catch(AmazonClientException ace) {
System.out.println("Caught an AmazonClientException, which means the client encountered " + "a serious internal problem while trying to communicate with AWS, " + "such as not being able to access the network.");
System.out.println("Error Message: " + ace.getMessage());
}
}
I have a Dataflow job which writes avro messages into PubSub:
PubsubIO.writeAvros(Session.class).to(sessionTopic)
Then, I want to process the messages in Spring application. In general, I'm using org.springframework.cloud.spring-cloud-gcp-starter-pubsub and org.springframework.cloud.spring-cloud-stream-schema dependencies.
#Bean
public PubSubInboundChannelAdapter messageChannelAdapter(
#Qualifier("sessionInputChannel") MessageChannel inputChannel,
PubSubOperations pubSubTemplate) {
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate,
"sessions-subscription");
adapter.setOutputChannel(inputChannel);
adapter.setMessageConverter(sessionMessageConverter());
adapter.setAckMode(AckMode.MANUAL);
return adapter;
}
private MessageConverter sessionMessageConverter() {
AvroSchemaMessageConverter converter = new AvroSchemaMessageConverter();
converter.setSchema(Session.getClassSchema());
return converter;
}
#Bean
public MessageChannel sessionInputChannel() {
return new DirectChannel();
}
#Bean
#ServiceActivator(inputChannel = "sessionInputChannel")
public MessageHandler messageReceiver() {
return message -> {
log.info("Message arrived! Payload: " + message.getPayload());
Session session = (Session) message.getPayload();
log.info("Session: " + session);
AckReplyConsumer consumer = (AckReplyConsumer) message.getHeaders()
.get(GcpPubSubHeaders.ACKNOWLEDGEMENT);
consumer.ack();
};
}
Unfortunately, I receive the following exception:
java.lang.NullPointerException: in com.example.model.Session null of com.example.model.Session
at org.apache.avro.reflect.ReflectDatumWriter.write(ReflectDatumWriter.java:161) ~[avro-1.8.2.jar:1.8.2]
at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:62) ~[avro-1.8.2.jar:1.8.2]
at org.springframework.cloud.stream.schema.avro.AbstractAvroMessageConverter.convertToInternal(AbstractAvroMessageConverter.java:183) ~[spring-cloud-stream-schema-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.messaging.converter.AbstractMessageConverter.toMessage(AbstractMessageConverter.java:201) ~[spring-messaging-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.messaging.converter.AbstractMessageConverter.toMessage(AbstractMessageConverter.java:191) ~[spring-messaging-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter.receiveMessage(PubSubInboundChannelAdapter.java:88) ~[spring-cloud-gcp-pubsub-1.0.0.M3.jar:1.0.0.M3]
at com.google.cloud.pubsub.v1.MessageDispatcher$4.run(MessageDispatcher.java:405) ~[google-cloud-pubsub-0.43.0-beta.jar:0.43.0-beta]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]
Caused by: java.lang.NullPointerException: null
at org.apache.avro.reflect.ReflectData.getField(ReflectData.java:158) ~[avro-1.8.2.jar:1.8.2]
at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:164) ~[avro-1.8.2.jar:1.8.2]
at org.apache.avro.specific.SpecificDatumWriter.writeField(SpecificDatumWriter.java:90) ~[avro-1.8.2.jar:1.8.2]
at org.apache.avro.reflect.ReflectDatumWriter.writeField(ReflectDatumWriter.java:191) ~[avro-1.8.2.jar:1.8.2]
at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:156) ~[avro-1.8.2.jar:1.8.2]
at org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:118) ~[avro-1.8.2.jar:1.8.2]
at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:75) ~[avro-1.8.2.jar:1.8.2]
at org.apache.avro.reflect.ReflectDatumWriter.write(ReflectDatumWriter.java:159) ~[avro-1.8.2.jar:1.8.2]
Can anyone tell me how to consume the avro messages? What I am doing wrong?
It looks like you're using the M3 release of the Spring GCP PubSub integration, and the line causing this error is in this file :
https://github.com/spring-cloud/spring-cloud-gcp/blob/eeed548ec3a8a82bfd158a6f40d52a94b26ea61e/spring-cloud-gcp-pubsub/src/main/java/org/springframework/cloud/gcp/pubsub/integration/inbound/PubSubInboundChannelAdapter.java
On line 88, it seems that the payload is being retrieved as a UTF 8 string, which could be making the object no longer able to be converted back into the Session type.
When I try calling upickle.write from anywhere in a servlet I get an exception. If for example I do
upickle.write("x")
I get the exception below. Any suggestions?
java.lang.ClassCastException: java.lang.String cannot be cast to scala.scalajs.js.Any
at upickle.json.package$.write(package.scala:38)
at upickle.Types$class.write(Types.scala:127)
at upickle.package$.write(package.scala:10)
at MyServlet$$anonfun$5.apply(MyServlet.scala:157)
at org.scalatra.ScalatraBase$class.org$scalatra$ScalatraBase$$liftAction(ScalatraBase.scala:270)
at org.scalatra.ScalatraBase$$anonfun$invoke$1.apply(ScalatraBase.scala:265)
at org.scalatra.ScalatraBase$$anonfun$invoke$1.apply(ScalatraBase.scala:265)
at org.scalatra.ScalatraBase$class.withRouteMultiParams(ScalatraBase.scala:341)
at org.scalatra.ScalatraServlet.withRouteMultiParams(ScalatraServlet.scala:49)
at org.scalatra.ScalatraBase$class.invoke(ScalatraBase.scala:264)
at org.scalatra.ScalatraServlet.invoke(ScalatraServlet.scala:49)
at org.scalatra.ScalatraBase$$anonfun$runRoutes$1$$anonfun$apply$8.apply(ScalatraBase.scala:240)
at org.scalatra.ScalatraBase$$anonfun$runRoutes$1$$anonfun$apply$8.apply(ScalatraBase.scala:238)
at scala.Option.flatMap(Option.scala:171)
at org.scalatra.ScalatraBase$$anonfun$runRoutes$1.apply(ScalatraBase.scala:238)
at org.scalatra.ScalatraBase$$anonfun$runRoutes$1.apply(ScalatraBase.scala:237)
at scala.collection.immutable.Stream.flatMap(Stream.scala:493)
at org.scalatra.ScalatraBase$class.runRoutes(ScalatraBase.scala:237)
at org.scalatra.ScalatraServlet.runRoutes(ScalatraServlet.scala:49)
at org.scalatra.ScalatraBase$class.runActions$1(ScalatraBase.scala:163)
at org.scalatra.ScalatraBase$$anonfun$executeRoutes$1.apply$mcV$sp(ScalatraBase.scala:175)
at org.scalatra.ScalatraBase$$anonfun$executeRoutes$1.apply(ScalatraBase.scala:175)
at org.scalatra.ScalatraBase$$anonfun$executeRoutes$1.apply(ScalatraBase.scala:175)
at org.scalatra.ScalatraBase$class.org$scalatra$ScalatraBase$$cradleHalt(ScalatraBase.scala:193)
at org.scalatra.ScalatraBase$class.executeRoutes(ScalatraBase.scala:175)
at org.scalatra.ScalatraServlet.executeRoutes(ScalatraServlet.scala:49)
at org.scalatra.ScalatraBase$$anonfun$handle$1.apply$mcV$sp(ScalatraBase.scala:113)
at org.scalatra.ScalatraBase$$anonfun$handle$1.apply(ScalatraBase.scala:113)
at org.scalatra.ScalatraBase$$anonfun$handle$1.apply(ScalatraBase.scala:113)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
at org.scalatra.DynamicScope$class.withResponse(DynamicScope.scala:80)
at org.scalatra.ScalatraServlet.withResponse(ScalatraServlet.scala:49)
at org.scalatra.DynamicScope$$anonfun$withRequestResponse$1.apply(DynamicScope.scala:60)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
at org.scalatra.DynamicScope$class.withRequest(DynamicScope.scala:71)
at org.scalatra.ScalatraServlet.withRequest(ScalatraServlet.scala:49)
at org.scalatra.DynamicScope$class.withRequestResponse(DynamicScope.scala:59)
at org.scalatra.ScalatraServlet.withRequestResponse(ScalatraServlet.scala:49)
at org.scalatra.ScalatraBase$class.handle(ScalatraBase.scala:111)
at org.scalatra.ScalatraServlet.org$scalatra$servlet$ServletBase$$super$handle(ScalatraServlet.scala:49)
at org.scalatra.servlet.ServletBase$class.handle(ServletBase.scala:43)
at MyServlet.org$scalatra$scalate$ScalateSupport$$super$handle(OutrightMarketServlet.scala:146)
at org.scalatra.scalate.ScalateSupport$class.handle(ScalateSupport.scala:130)
at MyServlet.handle(MyServlet.scala:146)
at org.scalatra.ScalatraServlet.service(ScalatraServlet.scala:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:365)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:745)