<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Getting error when following the REST API guide</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide</link><description>&lt;p&gt;Hi. I'm trying to follow the guide here: &lt;a href="http://developer.axonivy.com/doc/7.3.1/DesignerGuideHtml/ivy.integration.html#ivy.integration.rest"&gt;http://developer.axonivy.com/doc/7.3.1/DesignerGuideHtml/ivy.integration.html#ivy.integration.rest&lt;/a&gt; and all I'm getting is a stacktrace:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;java.lang.IllegalStateException: Request scope has been already shut down.
    at jersey.repackaged.com.google.common.base.Preconditions.checkState(Preconditions.java:173)
    at org.glassfish.jersey.process.internal.RequestScope.retrieveCurrent(RequestScope.java:239)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:314)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:126)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at ch.ivyteam.ivy.webserver.internal.filter.FilterChain.next(FilterChain.java:33)
    at ch.ivyteam.ivy.webserver.internal.exception.ExceptionFilter.doFilter(ExceptionFilter.java:55)
    at ch.ivyteam.ivy.webserver.internal.filter.AbstractFilter.doFilter(AbstractFilter.java:41)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at ch.ivyteam.ivy.webserver.internal.filter.FilterChain.next(FilterChain.java:33)
    at ch.ivyteam.ivy.webserver.internal.startup.IvyEngineUnavailableFilter.doFilter(IvyEngineUnavailableFilter.java:30)
    at ch.ivyteam.ivy.webserver.internal.filter.AbstractFilter.doFilter(AbstractFilter.java:41)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at ch.ivyteam.ivy.webserver.internal.filter.FilterChain.next(FilterChain.java:33)
    at ch.ivyteam.util.callable.AbstractExecutionContext.lambda$0(AbstractExecutionContext.java:28)
    at ch.ivyteam.util.callable.AbstractExecutionContext.callInContext(AbstractExecutionContext.java:16)
    at ch.ivyteam.util.callable.AbstractExecutionContext.executeInContext(AbstractExecutionContext.java:26)
    at ch.ivyteam.ivy.webserver.internal.filter.RemoteClientFilter.doFilter(RemoteClientFilter.java:18)
    at ch.ivyteam.ivy.webserver.internal.filter.AbstractFilter.doFilter(AbstractFilter.java:41)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at ch.ivyteam.ivy.webserver.internal.filter.FilterChain.next(FilterChain.java:33)
    at ch.ivyteam.util.callable.AbstractExecutionContext.lambda$0(AbstractExecutionContext.java:28)
    at ch.ivyteam.util.callable.AbstractExecutionContext.callInContext(AbstractExecutionContext.java:16)
    at ch.ivyteam.util.callable.AbstractExecutionContext.executeInContext(AbstractExecutionContext.java:26)
    at ch.ivyteam.ivy.webserver.internal.filter.IvyCurrentHttpRequestFilter.doFilter(IvyCurrentHttpRequestFilter.java:13)
    at ch.ivyteam.ivy.webserver.internal.filter.AbstractFilter.doFilter(AbstractFilter.java:41)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at ch.ivyteam.ivy.webserver.internal.filter.FilterChain.next(FilterChain.java:33)
    at ch.ivyteam.util.callable.AbstractExecutionContext.lambda$0(AbstractExecutionContext.java:28)
    at ch.ivyteam.util.callable.AbstractExecutionContext.callInContext(AbstractExecutionContext.java:16)
    at ch.ivyteam.util.callable.AbstractExecutionContext.executeInContext(AbstractExecutionContext.java:26)
    at ch.ivyteam.ivy.security.exec.Sudo.execute(Sudo.java:63)
    at ch.ivyteam.ivy.webserver.internal.filter.IvyExecuteAsSystemFilter.doFilter(IvyExecuteAsSystemFilter.java:11)
    at ch.ivyteam.ivy.webserver.internal.filter.AbstractFilter.doFilter(AbstractFilter.java:41)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:89)
    at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121)
    at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at ch.ivyteam.ivy.webserver.internal.PerformanceLogValve.invoke(PerformanceLogValve.java:42)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;None of the classes in the stacktrace belong to my project, so it doesn't seem to be an error with my code per se.
Any idea what might be wrong?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 15 Apr 2020 03:44:48 -0400</lastBuildDate><item><title>Answer by sorin</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide/4505</link><description>&lt;p&gt;Turns out it's a bug on Mac Designer v7 and it works on Windows&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sorin</dc:creator><pubDate>Wed, 15 Apr 2020 03:44:48 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide/4505</guid></item><item><title>Comment by Reguel Wermelinger on sorin's question</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4468</link><description>&lt;p&gt;Thanks for testing &lt;a href="https://answers.axonivy.com/users/1241/sorin"&gt;&lt;a href="https://answers.axonivy.com/users/1241/sorin"&gt;@sorin&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;No, working on LTS 8 towards a 7.3.1 engine is not recommended. Some models are not compatible (e.g. Process.mod format changed). &lt;/p&gt;
&lt;p&gt;But I'd insist that the customers migrates to the LTS version. Leading Edge release are out of support when the next release is available. So only a switch to the LTS train gives you a stable tested version. Especially security issues will become an important issue in the near future...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Tue, 24 Mar 2020 10:24:49 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4468</guid></item><item><title>Comment by sorin on sorin's question</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4467</link><description>&lt;p&gt;It works in 8.0.3 on Mac, I've just downloaded it and tested.
Is there a way to work in 8.0.3 designer and run on 7.3.1 engine afterwards? Are they compatible like that?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sorin</dc:creator><pubDate>Tue, 24 Mar 2020 09:17:04 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4467</guid></item><item><title>Comment by Reguel Wermelinger on sorin's question</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4466</link><description>&lt;p&gt;Yes, they should work as they did back then. To put things right, the welcome page project importer relies upon our public maven repositories - so in theory these artifacts could have changed. Even so, we run integration tests against are demos - so a fundamental break should be early detected and never reach a customer. &lt;/p&gt;
&lt;p&gt;... that's why I am asking about the Mac Designer. There are/were issues on the Mac Betas related to the REST stack. (caused by path issues). So if there is a problem that persist in a recent LTS version, we can fix something.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Tue, 24 Mar 2020 08:28:35 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4466</guid></item><item><title>Comment by sorin on sorin's question</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4465</link><description>&lt;p&gt;I am on designer version 7.3.1 to match our customer's engine version. But the ConnectivityDemos are the one that come from the Designer welcome page, not the ones on your Git repo, so I would have expected them to work, as they were shipped with version of the designer.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sorin</dc:creator><pubDate>Tue, 24 Mar 2020 07:27:05 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4465</guid></item><item><title>Comment by Reguel Wermelinger on sorin's question</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4464</link><description>&lt;p&gt;I can't reproduce the issue with the ConnectivityDemos on the LTS train. So it could be dated leading edge version which contains an unknown bug.&lt;/p&gt;
&lt;p&gt;But if none of the ConnectivityDemos work on your machine - I'd assume that it related to the Mac Designer. Or did you switch to a non BETA designer already?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Tue, 24 Mar 2020 07:25:32 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4464</guid></item><item><title>Comment by sorin on sorin's question</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4463</link><description>&lt;p&gt;By the way, I imported the ConnectivityDemos project from the welcome screen and I'm trying to call &lt;a href="http://localhost:8081/ivy/api/designer/persons"&gt;http://localhost:8081/ivy/api/designer/persons&lt;/a&gt; or &lt;a href="http://localhost:8081/ivy/api/ConectivityDemos/persons"&gt;http://localhost:8081/ivy/api/ConectivityDemos/persons&lt;/a&gt; and I get the same error&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sorin</dc:creator><pubDate>Tue, 24 Mar 2020 05:30:38 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4463</guid></item><item><title>Comment by sorin on sorin's question</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4462</link><description>&lt;p&gt;I have followed the tutorial verbatim, I have a class in the src folder, annotated with @Path("something") and then 2 methods in the class annotated, one with @GET, one with @POST and both with @Produces(MediaType.APPLICATION_JSON). All annotations are from the JAX-RS package (java.ws.rs)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sorin</dc:creator><pubDate>Tue, 24 Mar 2020 05:09:14 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4462</guid></item><item><title>Comment by Andreas Rusch on sorin's question</title><link>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4461</link><description>&lt;p&gt;Sounds like a ManagedBean scope problem. Do you use one with just @RequestScope?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andreas Rusch</dc:creator><pubDate>Tue, 24 Mar 2020 04:32:31 -0400</pubDate><guid>https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide#4461</guid></item></channel></rss>