Questions Tagged With resthttps://answers.axonivy.com/tags/rest/?type=rssquestions tagged <span class="tag">rest</span>enSun, 21 Jun 2020 06:22:29 -0400REST http method PATCHhttps://answers.axonivy.com/questions/4613/rest-http-method-patch<p>Hi all We want to call a REST API with the method PATCH. But in the selector there is no such option. Is there a way to do it anyway? Thanks for the help. </p>renatostalderSun, 21 Jun 2020 06:22:29 -0400https://answers.axonivy.com/questions/4613/rest-http-method-patchapirestCan I define REST API endpoint in a jar file?https://answers.axonivy.com/questions/4470/can-i-define-rest-api-endpoint-in-a-jar-file<p>Hello everyone,</p> <p>I have a <strong>maven project</strong> (<strong>jar</strong>), for example, my-api. In this project, I defined a REST API endpoint:</p> <pre><code>@Path("/v1/dossiers") public class MyAPI { @Path("/") public Response getDossiers() { // our logic return response; } } </code></pre> <p>I have an <strong>ivy project</strong>, for example, my-app and I added the jar dependency <strong>my-api</strong>. I can't access the API above from client</p> <p>But, I tried to create a <strong>my-api</strong> as an ivy project (<strong>iar</strong>) and added it as an iar dependency my-app. It works well.</p> <p>My question is: Can I define the REST API endpoint in a jar file? If yes, how can I do that?</p> <p>P/s: We're using Ivy 7.0.11</p>ptgiangWed, 25 Mar 2020 04:40:40 -0400https://answers.axonivy.com/questions/4470/can-i-define-rest-api-endpoint-in-a-jar-fileivyrestGetting error when following the REST API guidehttps://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guide<p>Hi. I'm trying to follow the guide here: <a href="http://developer.axonivy.com/doc/7.3.1/DesignerGuideHtml/ivy.integration.html#ivy.integration.rest">http://developer.axonivy.com/doc/7.3.1/DesignerGuideHtml/ivy.integration.html#ivy.integration.rest</a> and all I'm getting is a stacktrace:</p> <pre><code>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) </code></pre> <p>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?</p>sorinMon, 23 Mar 2020 17:40:07 -0400https://answers.axonivy.com/questions/4460/getting-error-when-following-the-rest-api-guiderestUsing the Dialog REST api for Datahttps://answers.axonivy.com/questions/4458/using-the-dialog-rest-api-for-data<p>Hello, So as I know, each HTML dialog has a rest api to access its methods using the /rest/method/methodName relative to the dialog base. I was wondering if it is possible to do the same with data, using /rest/data/dataParam in the same way. </p>TareqKThu, 19 Mar 2020 05:56:52 -0400https://answers.axonivy.com/questions/4458/using-the-dialog-rest-api-for-datahtmluserdialogrestCan not add @Provider to handle an specific exception for rest apihttps://answers.axonivy.com/questions/4452/can-not-add-provider-to-handle-an-specific-exception-for-rest-api<p>hi all,</p> <p>I'm creating a rest API for one application. It's working now. I would like to handle some specific exceptions and to return some specific data responses. I used <strong>@Provider</strong> from <strong>javax.ws.rs.ext.Provider</strong> to handle it, but I got an error 500.</p> <pre><code>import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; import ch.axonivy.fintech.export.dossier.exception.RecordNotFoundException; import ch.axonivy.fintech.export.dossier.response.ExportingErrorResponse; @Provider public class RecordNotFoundExceptionMapper implements ExceptionMapper&lt;RecordNotFoundException&gt; { @Override public Response toResponse(RecordNotFoundException ex) { ExportingErrorResponse response = new ExportingErrorResponse(); response.setStatusCode(Status.NOT_FOUND.getStatusCode()); response.setErrorMessage(ex.getMessage()); return Response.status(response.getStatusCode()).entity(response).type(MediaType.APPLICATION_JSON).build(); } } </code></pre> <p>The following is error:</p> <pre><code>14:59:41.299 WARN [ch.ivyteam.bus.internal] [Worker-45] [executionContext=SYSTEM] Error occured: java.lang.NullPointerException at org.glassfish.jersey.server.ResourceBag$Builder.registerModel(ResourceBag.java:116) at org.glassfish.jersey.server.ResourceBag$Builder.registerProgrammaticResource(ResourceBag.java:110) at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:459) at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184) at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350) at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255) at org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:347) at org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:392) at org.glassfish.jersey.servlet.ServletContainer.reload(ServletContainer.java:681) at ch.ivyteam.ivy.webserver.internal.rest.RestLifecycleListener.reloadInContext(RestLifecycleListener.java:62) at ch.ivyteam.ivy.webserver.internal.rest.RestLifecycleListener.reload(RestLifecycleListener.java:47) at ch.ivyteam.ivy.webserver.internal.rest.RestLifecycleListener.handleDeprectatedClassLoader(RestLifecycleListener.java:40) 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 net.engio.mbassy.dispatch.ReflectiveHandlerInvocation.invoke(ReflectiveHandlerInvocation.java:29) at net.engio.mbassy.dispatch.MessageDispatcher.dispatch(MessageDispatcher.java:30) at net.engio.mbassy.dispatch.FilteredMessageDispatcher.dispatch(FilteredMessageDispatcher.java:42) at net.engio.mbassy.subscription.Subscription.publish(Subscription.java:72) at net.engio.mbassy.bus.MessagePublication.execute(MessagePublication.java:49) at net.engio.mbassy.bus.MBassador.publish(MBassador.java:66) at ch.ivyteam.bus.internal.EventBus.publish(EventBus.java:30) at ch.ivyteam.ivy.java.internal.ClassLoaderHolder.deprecateClassLoaderInternal(ClassLoaderHolder.java:349) at ch.ivyteam.ivy.java.internal.ClassLoaderHolder.deprecateClassLoader(ClassLoaderHolder.java:323) at ch.ivyteam.ivy.java.internal.ClassLoaderHolder.reinstantiateClassLoader(ClassLoaderHolder.java:299) at ch.ivyteam.ivy.java.internal.ClassloaderReinstatiateCompilationParticipant.reinstatiateProjectClassloader(ClassloaderReinstatiateCompilationParticipant.java:82) at ch.ivyteam.ivy.java.internal.ClassloaderReinstatiateCompilationParticipant.buildFinished(ClassloaderReinstatiateCompilationParticipant.java:70) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:235) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) 15:41:38.174 ERROR [org.apache.catalina.core.ContainerBase.[ivy].[localhost].[/ivy].[org.glassfish.jersey.servlet.ServletContainer]] [http-nio-8081-exec-1] [requestId=2832] Servlet.service() for servlet [org.glassfish.jersey.servlet.ServletContainer] in context with path [/ivy] threw exception [java.lang.IllegalStateException: Request scope has been already shut down.] with root cause 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 ch.ivyteam.ivy.webserver.internal.IvyFilter.doFilterInternal(IvyFilter.java:247) at ch.ivyteam.ivy.webserver.internal.IvyFilter.doFilter(IvyFilter.java:152) 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.IvyExecuteAsSystemFilter$1.call(IvyExecuteAsSystemFilter.java:45) at ch.ivyteam.ivy.webserver.internal.IvyExecuteAsSystemFilter$1.call(IvyExecuteAsSystemFilter.java:1) at ch.ivyteam.ivy.security.internal.SecurityManager.executeAsSystem(SecurityManager.java:1310) at ch.ivyteam.ivy.webserver.internal.IvyExecuteAsSystemFilter.doFilter(IvyExecuteAsSystemFilter.java:39) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:124) 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.startup.IvyEngineUnavailableFilter.doFilter(IvyEngineUnavailableFilter.java:48) 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.IvyCurrentHttpRequestFilter.doFilter(IvyCurrentHttpRequestFilter.java:39) 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.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135) 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:478) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at ch.ivyteam.ivy.webserver.internal.PerformanceLogValve.invoke(PerformanceLogValve.java:55) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457) 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) 15:41:38.325 ERROR [org.apache.myfaces.application.ApplicationImpl] [http-nio-8081-exec-1] [requestId=2832] Could not instantiate component componentType = guiEventListenerComponent [errorId=170D30E5B15459D4, requestId=2832] ch.ivyteam.ivy.environment.EnvironmentNotAvailableException: Access to ivy environment outside a process request thread is not possible. Current thread: Thread[http-nio-8081-exec-1,5,main] at ch.ivyteam.ivy.environment.Ivy.getIvy(Ivy.java:577) at ch.ivyteam.ivy.environment.Ivy.getEnvironmentData(Ivy.java:556) at ch.ivyteam.ivy.environment.Ivy.getEnvironmentData(Ivy.java:551) at ch.ivyteam.ivy.environment.Ivy.request(Ivy.java:244) at ch.axonivy.fintech.guiframework.component.GuiEventListenerFactoryServiceProvider.getProjectClassLoader(GuiEventListenerFactoryServiceProvider.java:67) at ch.axonivy.fintech.guiframework.component.GuiEventListenerFactoryServiceProvider.getFactory(GuiEventListenerFactoryServiceProvider.java:32) at ch.axonivy.fintech.guiframework.component.GuiEventListenerComponent.&lt;init&gt;(GuiEventListenerComponent.java:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1469) at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:129) at org.apache.myfaces.view.facelets.compiler.FaceletsCompilerSupport.loadLibraries(FaceletsCompilerSupport.java:141) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.loadLibraries(FaceletViewDeclarationLanguage.java:2526) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.createCompiler(FaceletViewDeclarationLanguage.java:2172) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.initialize(FaceletViewDeclarationLanguage.java:2464) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.&lt;init&gt;(FaceletViewDeclarationLanguage.java:309) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguageStrategy.&lt;init&gt;(FaceletViewDeclarationLanguageStrategy.java:52) at org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl.initialize(ViewDeclarationLanguageFactoryImpl.java:104) at org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl.getViewDeclarationLanguage(ViewDeclarationLanguageFactoryImpl.java:73) at org.apache.myfaces.application.ViewHandlerImpl.getViewDeclarationLanguage(ViewHandlerImpl.java:183) at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:133) at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.checkResourceExists(DefaultViewHandlerSupport.java:569) at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.handleSuffixMapping(DefaultViewHandlerSupport.java:507) at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.calculateViewId(DefaultViewHandlerSupport.java:113) at org.apache.myfaces.application.ViewHandlerImpl.deriveLogicalViewId(ViewHandlerImpl.java:122) at javax.faces.application.ViewHandlerWrapper.deriveLogicalViewId(ViewHandlerWrapper.java:112) at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:225) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:196) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:143) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311) at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:395) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:254) at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:349) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:175) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at ch.ivyteam.ivy.webserver.internal.PerformanceLogValve.invoke(PerformanceLogValve.java:55) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457) 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) </code></pre> <p>P/s: I’m using Axon Ivy 7.0.11</p> <p>Could you please give me some suggestions or any hints to overcome this issue? Thank you!</p>ptgiangFri, 13 Mar 2020 06:10:26 -0400https://answers.axonivy.com/questions/4452/can-not-add-provider-to-handle-an-specific-exception-for-rest-apiivyrestEngine Performance - Profilinghttps://answers.axonivy.com/questions/4379/engine-performance-profiling<p>Dear Ivy Team</p> <p>My test setup is as follows : 4 CPU (i7, 3GHz), Xms128m, Xmx2048m</p> <p>2 Browsers, every 3 seconds a click on the UI during 60 seconds</p> <p>1 With visualvm it shows that Ivy spent approx 16s with reading, the issue is I can not quantify how much data it is (since your performance / rest client logging is not working). But my guess is, it can only be a few hundred KB in total.</p> <p>=&gt; 16s seem to me a lot, can you confirm my results ?</p> <p><img alt="alt text" src="https://answers.axonivy.com/upfiles/Unbenannt.PNG"></p> <p>2 Rest Client - java &gt; Ivy.rest() : is Ivy.rest() client pooled ? (since the Rest Clients are pretty heavy weight they should be pooled otherwise memory consumption skyrockets and also performance will degrade if they are used like in a micro services architecture)</p> <p>=&gt; Ivy.rest() did you do any performance analysis ? Is this the "required" way of using Rest Client in Ivy ?</p>John MoserFri, 07 Feb 2020 04:14:06 -0500https://answers.axonivy.com/questions/4379/engine-performance-profilingivyrestComplete Task from RESThttps://answers.axonivy.com/questions/4077/complete-task-from-rest<p>Hi Ivy Team,</p> <p>How to complete a task from REST service in Axon.Ivy ?</p> <p>So, far I saw that I can do .destroy() but it doesn`t feel the right, I believe that there will be some side effects </p> <p>or</p> <p>.setActivator(ivy.session.getSecurityContext().getSystemUser()) but this way I`m loosing the history who was the assignee of the task</p> <p>Any other options ?</p> <p>Maybe to do HTTP call to the end-point /TaskA.iot?taskId=7</p> <p>My goal is to build REST API that can manage the Axon.Ivy tasks from external system.</p> <p>Best Regards, Yordan</p>Stelt0Mon, 07 Oct 2019 09:40:24 -0400https://answers.axonivy.com/questions/4077/complete-task-from-restapijavaresttaskREST API and JSESSIONIDhttps://answers.axonivy.com/questions/4032/rest-api-and-jsessionid<p>Hi Ivy Team,</p> <p>Is there a way to get the JSESSIONID (or the whole cookie itself) of the logged in user ?</p> <p>I want to build a rest method which is authenticating the user. I need to return the cookie, so that next requests are authenticated</p> <p>BR, Yordan</p>Stelt0Mon, 30 Sep 2019 03:58:26 -0400https://answers.axonivy.com/questions/4032/rest-api-and-jsessionidauthenticationapijavarestHow to change the category name of the log when calling REST client by using Ivy.rest().client(...) ?https://answers.axonivy.com/questions/3944/how-to-change-the-category-name-of-the-log-when-calling-rest-client-by-using-ivy-rest-client<p>When I call any REST clients by using Ivy.rest().client(...), it will have the log with the category name [rest_client] from IVY Core. However, I want to make the log messages written into the specific log files of each services. With the same category name for all REST services like this, I could not find any way to configure in log4jconfig.xml to make it correct.</p> <p>If anyone have ideas to change that category name or change the log4j configuration, please help.</p> <p>Thanks in advance.</p>Lieu VoThu, 29 Aug 2019 04:11:43 -0400https://answers.axonivy.com/questions/3944/how-to-change-the-category-name-of-the-log-when-calling-rest-client-by-using-ivy-rest-clientivyrestlog4jConsuming Rest in Plugin Projecthttps://answers.axonivy.com/questions/3834/consuming-rest-in-plugin-project<p>Currently, I face the difficulties that there are some lacking libraries when I consuming rest API in Ivy plugin I follow this instruction : <a href="https://answers.axonivy.com/questions/2477/how-to-register-my-code-that-runs-on-every-engine-startup">https://answers.axonivy.com/questions/2477/how-to-register-my-code-that-runs-on-every-engine-startup</a> When user logs in, logs out or gets time-out, I want to call rest service to do some stuff: <img alt="alt text" src="https://answers.axonivy.com/upfiles/call_rest.png"></p> <p>But I get an error like this when calling rest service in the plugin: <img alt="alt text" src="https://answers.axonivy.com/upfiles/error_FGhNT7s.png"></p> <p>Currently, I just add some dependencies like this picture into the plugin but it doesn't work <img alt="alt text" src="https://answers.axonivy.com/upfiles/hint.png"></p> <p>Do you have any hint or any suggestion for this problem? Thanks in advance :)</p>Genzer HawkerMon, 03 Jun 2019 09:22:49 -0400https://answers.axonivy.com/questions/3834/consuming-rest-in-plugin-projectrestHow to upload a File to a REST apihttps://answers.axonivy.com/questions/3777/how-to-upload-a-file-to-a-rest-api<p>I am building a document management service with a RESTful API. </p> <pre><code>@Path("fileUpload") public class FileUploadService { @PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) public Response uploadFile(@FormDataParam("file") InputStream fileStream, @FormDataParam("file") FormDataContentDisposition fileDetail) throws IOException { .... } } </code></pre> <p>It seems to work as expected if I use a third party client such as Postman. However, when using the REST activity of ivy I am unable to call this service. I always get errors stating the the header <code>X-Requested-By</code> is missing. Whats the issue? How can I send files using a REST Client Call activity?</p>SupportIvyTeamThu, 18 Apr 2019 04:05:19 -0400https://answers.axonivy.com/questions/3777/how-to-upload-a-file-to-a-rest-apifileuploadrestfileStreaming with Ivy REST APIhttps://answers.axonivy.com/questions/3602/streaming-with-ivy-rest-api<p>Dear Ivy Team</p> <p>I have the following case: User should be able to upload scanned documents (1...xx MB) via Ivy and the data should be streamed through the REST service (layers). Since each REST service decouples (therefore no shared memory) the memory required to transport the document data could be quite high. To avoid that I would like to stream the data down to the persistency layer.</p> <p>Problem: Currently I am trying to pass binary data -&gt; "In Inscribe Rest Service Call Activity" -&gt; Body, entity -&gt; binary data and content-type=application/octet-stream and read it by the consumer REST service with HttpServletRequest request-&gt;getInputStream(). Though here I get an error (InputStream seems to be already closed).</p> <p>Question: Is this approach correct or do I have to use multipart/form-data (if yes, do you have an example, especially if the call is executed by the Ivy REST client).</p> <p>Thanks in advance for a feedback.</p> <p>Best Regards John</p>John MoserTue, 08 Jan 2019 10:00:55 -0500https://answers.axonivy.com/questions/3602/streaming-with-ivy-rest-apiapirestDoes ivy RestAPI require @Path on class body?https://answers.axonivy.com/questions/3494/does-ivy-restapi-require-path-on-class-body<p>Hi ivyteam</p> <p>I'm using ivy 7.0.3 to develop RestAPI.</p> <p>Now i have a api as below</p> <p><img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled_o9lhxJr.png"> On the right side i define @Path on class body but the left side.</p> <p>The right it works well on designer and engine. The left only works for Designer. on engine it say restAPI not found (already restart ivy engine)</p> <p>Does ivy require @Path on class body?</p> <p>Thanks</p>trungdvTue, 23 Oct 2018 07:51:47 -0400https://answers.axonivy.com/questions/3494/does-ivy-restapi-require-path-on-class-bodyrestCalling NTLM protected REST service with SSOhttps://answers.axonivy.com/questions/3477/calling-ntlm-protected-rest-service-with-sso<p>In Ivy 7.1, is it possible to call a NTLM protected web service using the logged in user (therefore not configuring user/password in the REST client)?</p>petersMon, 08 Oct 2018 05:45:55 -0400https://answers.axonivy.com/questions/3477/calling-ntlm-protected-rest-service-with-ssossontlmauthenticationrestHow can I use JAX-RS ContainerRequestFilter/ResponseFilter for my JAX-RS resources.https://answers.axonivy.com/questions/3412/how-can-i-use-jax-rs-containerrequestfilter-responsefilter-for-my-jax-rs-resources<p>Hi,</p> <p>I want to implement my own <code>ContainerRequestFilter</code> and <code>ContainerResponseFilter</code> for my JAX-RS resources in my Axon.ivy projects. Typically, I would create an implementation of the filter:</p> <pre><code>import java.util.logging.*; @Provider public class MyRequestFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { Logger.getLogger("Test").log(Level.WARNING, "LOOK MA! IT WORKS"); } } </code></pre> <p>I assume that Jersey will register my filter and it will works. However, I got </p> <pre><code>javax.servlet.ServletException: java.lang.IllegalStateException: Request scope has been already shut down. at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489) 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) ... Caused by: 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) ... 46 more </code></pre> <p>..when I call my resources.</p> <p>Is it possible (at all) to use <code>ContainerRequestFilter/ResponseFilter</code> (and <code>Feature</code>, <code>DynamicFeature</code>) in an Axon.ivy project? And without introducing JAR files into <code>webapps/ivy/WEB-INF/lib/</code>?</p> <p>Thanks</p>Genzer HawkerMon, 10 Sep 2018 02:24:40 -0400https://answers.axonivy.com/questions/3412/how-can-i-use-jax-rs-containerrequestfilter-responsefilter-for-my-jax-rs-resourcesjax-rsjerseyrestIvy 7.1 Rest API basic authorizationhttps://answers.axonivy.com/questions/3343/ivy-7-1-rest-api-basic-authorization<p>I'm trying to create a test REST API in Ivy version 7.1 like the below: <img alt="alt text" src="https://answers.axonivy.com/upfiles/IMG_26062018_133012_0.png"> then test it on Postman and get this response: <img alt="alt text" src="https://answers.axonivy.com/upfiles/postman.png"></p> <p>Moreover, when I try to access the API by Chrome browser.</p> <p>First time attempt: <img alt="alt text" src="https://answers.axonivy.com/upfiles/chrome.png"> Then cancel it and get this response: <img alt="alt text" src="https://answers.axonivy.com/upfiles/chrome2.png"> Then press F5 and I get this response: <img alt="alt text" src="https://answers.axonivy.com/upfiles/chrome3.png"></p> <p>According to the last comment on this topic <a href="https://answers.axonivy.com/questions/1858/rest-service-security">https://answers.axonivy.com/questions/1858/rest-service-security</a></p> <blockquote> <p>The REST service provided by Axon.ivy are be default protected by HTTP BASIC Authentication.</p> </blockquote> <p>So my question is that why I could access the API without the basic authorization on Postman? I also test with the same scenario in Ivy version 6.2 but I'm unable to access the API without the basic authorization. Thanks</p>thminhTue, 26 Jun 2018 02:59:25 -0400https://answers.axonivy.com/questions/3343/ivy-7-1-rest-api-basic-authorizationrestHow to secure Rest Services from Ivy 6.2 with Authorization Bearer instead of Basichttps://answers.axonivy.com/questions/3338/how-to-secure-rest-services-from-ivy-6-2-with-authorization-bearer-instead-of-basic<p>As the tittle. I'm using Ivy version 6.2 and would like to know how to secure my REST Services using Bearer Authorization instead of basic. Thanks</p>thminhThu, 21 Jun 2018 07:31:33 -0400https://answers.axonivy.com/questions/3338/how-to-secure-rest-services-from-ivy-6-2-with-authorization-bearer-instead-of-basicsecurityapirestHow to get the URL of a process start within a JAX-RS classhttps://answers.axonivy.com/questions/3218/how-to-get-the-url-of-a-process-start-within-a-jax-rs-class<p>Hello IvyTeam,</p> <p>My Ivy Version : 7.0.3 I would like to get the url from a process in a JAX-RS Rest Resource but I get an Exception with this code:</p> <pre><code>Ivy.html().startref("Functional Processes/dis/videoIdentification/start.ivp") </code></pre> <p>The JAX-RS Resource is located in the same project as the process. It works without problem in a Process (IvyScript Step).</p> <p>I can imagine that the fact the code is in a JAX-RS Resource does not allow accessing some Ivy resources like the ProjectModelVersion Provider. Is there a workaround for that? Or do I have to compute the url more manually with the InetAddress and so on ? By the way this code works in this resource: Ivy.html().applicationHomeRef()</p> <p>Thanks in advance </p> <p>Here the StackTrace I get:</p> <pre><code> com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Error in custom provider, java.lang.NullPointerException while locating ch.ivyteam.ivy.workflow.internal.di.CaseProjectProcessModelVersionProvider while locating ch.ivyteam.ivy.application.IProcessModelVersion annotated with interface ch.ivyteam.ivy.scope.restricted.FromCaseScope Caused by: java.lang.NullPointerException at ch.ivyteam.ivy.workflow.internal.di.CaseProjectProcessModelVersionProvider.get(CaseProjectProcessModelVersionProvider.java:18) at ch.ivyteam.ivy.workflow.internal.di.CaseProjectProcessModelVersionProvider.get(CaseProjectProcessModelVersionProvider.java:1) at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72) at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61) at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62) at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085) at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015) at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1050) at ch.ivyteam.di.restricted.DiInjector.getInstance(DiInjector.java:77) at </code></pre>Emmanuel CombaWed, 18 Apr 2018 15:06:23 -0400https://answers.axonivy.com/questions/3218/how-to-get-the-url-of-a-process-start-within-a-jax-rs-classprocessurlivyrestZombie task is created after finishing callable subprocess. How to avoid it?https://answers.axonivy.com/questions/2932/zombie-task-is-created-after-finishing-callable-subprocess-how-to-avoid-it<p>Hi all</p> <p>We're using ivy 6.3, and have face the problem that we implement a restfulAPI by java code, when we trigger the callable subprocess from it. After callablesub is finished, it will remain a zombie task. <img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled_OKBhfzB.png"> Why i need to call ivy subprocess from api? Answer: i need to call ivy.repo() to persist my data then response the id. This api can't be called in restful.</p> <p>Here is my callable subprocess:</p> <p><img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled_xUuYAvG.png"></p> <p>and it's the code of api:</p> <pre><code>@Path("{applicationName}/individualch") @Produces(MediaType.APPLICATION_JSON) public class IndividualchApi { /** * This API is used by third party application when it want to call * to create dossier Response message is cobId * @param provider * @param externalId * @param sobDossier * @return */ @POST @Path("/dossiers") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createIndividualCHDossier(@NotNull String provider, @NotNull String externalId, SobDossier sobDossier) { if (StringUtils.isBlank(provider) || StringUtils.isBlank(externalId) || sobDossier == null) { return Response.status(Status.BAD_REQUEST).entity(new ResponseExceptionMessage() .errorCode(DossierCreationServiceExceptionType.BAD_REQUEST.getUniqueCode().toString()) .message("Invalid params")).build(); } return new CreateDossierHandlerService().createIndividualCHDossier(provider, externalId, sobDossier); } } </code></pre> <p>And here is the way we trigger subprocess from service:</p> <pre><code>SubProcessCallResult callResult = SubProcessCall.withPath(CREATE_DOSSIER_HANDLER_PROCESS_NAME) .withStartSignature("createDossier(String,String,SobDossier)") .withParam(PARAM_PROVIDER, provider).withParam(PARAM_EXTERNAL_ID, externalId) .withParam(PARAM_SOB_DOSSIER, sobDossier) .call(); </code></pre> <p>My Question: </p> <ol> <li>Is it a good solution to go? I actually can't call ivy.repo() inside my service. How can we prevent this kind of zomebie task?</li> <li>If we can't prevent zombie task, how ivy handle this kind of task? Does ivy clean it up automatically?</li> </ol> <p>Thanks all</p>trungdvFri, 27 Oct 2017 01:55:45 -0400https://answers.axonivy.com/questions/2932/zombie-task-is-created-after-finishing-callable-subprocess-how-to-avoid-itivyrestzombietaskREST token authenticationhttps://answers.axonivy.com/questions/2924/rest-token-authentication<p>We’ve been setting up a REST client but failed at configure the authentication. The API requires you to authenticate with a token. </p> <p>The documentation of the API tells you to pass the token through the «Authorization» header with its value being for example «Token: d2f763479f703d80de0ec15254237bc651f9cdc0». Doing this in the REST Client Activity element wasn’t successfully. </p> <p>So, what’s the correct way to pass the token to the API for authentication</p>Marco KlauenböschMon, 23 Oct 2017 10:08:48 -0400https://answers.axonivy.com/questions/2924/rest-token-authenticationauthenticationapirestHow to call a NTLM protected REST Servicehttps://answers.axonivy.com/questions/2904/how-to-call-a-ntlm-protected-rest-service<p>Can you explain how to call a REST Service which is secured by NTLM?</p>SupportIvyTeamMon, 09 Oct 2017 06:03:09 -0400https://answers.axonivy.com/questions/2904/how-to-call-a-ntlm-protected-rest-servicentlmrestCan we use Swagger in Ivy Project?https://answers.axonivy.com/questions/2842/can-we-use-swagger-in-ivy-project<p>Hi all</p> <p>Now i'm using Axon ivy 6.3. In my project, i have created an Restful API following the <a href="https://swagger.io/docs/specification/about/">OpenAPI Specification</a> </p> <p>Now i want to use Swagger to generate YAML file from those API (follow this <a href="https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5">guideline</a> and this <a href="https://stackoverflow.com/questions/34340330/generate-yaml-or-json-file-from-swagger-documentation">post</a>). </p> <p>Here is my web.xml <img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled_uG151Fy.png"></p> <p>and this is my Servlet:</p> <pre><code>public class ApiScanner extends HttpServlet { private static final long serialVersionUID = -4192689550210212169L; @Override public void init(ServletConfig config) throws ServletException { super.init(config); BeanConfig beanConfig = new BeanConfig(); beanConfig.setVersion("1.0.0"); beanConfig.setSchemes(new String[]{"http"}); beanConfig.setHost("localhost:8081"); beanConfig.setBasePath("/ivy/api/designer"); beanConfig.setResourcePackage("ch.axonivy.fintech.mybank.website.dossier.api"); beanConfig.setScan(true); } } </code></pre> <p>But nothing happen after i restart ivy. Has anybody tried it before?</p> <p>Thanks</p>trungdvFri, 01 Sep 2017 07:02:51 -0400https://answers.axonivy.com/questions/2842/can-we-use-swagger-in-ivy-projectswaggerrestopenapiCan I accept self signed certificates in REST requests?https://answers.axonivy.com/questions/2833/can-i-accept-self-signed-certificates-in-rest-requests<p>In my project I am forced to use a third party REST service which is only accessible over HTTPS. Unfortunately the certificate is self signed. What can I do to accept untrusted certifticates?</p>SupportIvyTeamTue, 29 Aug 2017 07:54:28 -0400https://answers.axonivy.com/questions/2833/can-i-accept-self-signed-certificates-in-rest-requestssslrestIs it possible to access Ivy's RESTful API from an HtmlDialog or within the same session?https://answers.axonivy.com/questions/2462/is-it-possible-to-access-ivy-s-restful-api-from-an-htmldialog-or-within-the-same-session<p>Hi Ivy Team</p> <p>I have a HtmlDialog containing several links to our RESTful API (implemented using Axon.ivy). However, every time the user accesses to the API, the browser requires authentication even though the user has already logged in.</p> <p>I'm aware of the <code>javax.annotation.security.PermitAll/DenyAll</code> (-- which seems to be the only annotations supported?) but I want to keep the Basic authentication intact.</p> <p>Say the page could be like this:</p> <pre><code>&lt; !-- The HelloWorld dialog --&gt; &lt; h:html&gt; &lt; h:body&gt; &lt; h:outputLink value="/ivy/api/designer/helloworld" target="_blank"&gt; Click to see Hello World &lt; /h:outputLink&gt; &lt; h:outputLink value="/ivy/file/designer/session/some_file_already_created.txt" target="_blank"&gt; Get content of file &lt; /h:outputLink&gt; &lt; h:/body&gt; &lt; /h:html&gt; </code></pre> <p>The first link will require authentication whereas the second works normally.</p> <p>Is there a possible way to overcome this?</p>Genzer HawkerWed, 22 Feb 2017 08:26:22 -0500https://answers.axonivy.com/questions/2462/is-it-possible-to-access-ivy-s-restful-api-from-an-htmldialog-or-within-the-same-sessionsecurityrestIs WADL as description of REST services supported?https://answers.axonivy.com/questions/2379/is-wadl-as-description-of-rest-services-supported<p>I have written a REST service in my ivy project. How can I produce a WADL description of my the REST service? I need the WADL to send it to the consumer of the REST service so that he knows how to consume it.</p>Reto WeissWed, 18 Jan 2017 15:34:40 -0500https://answers.axonivy.com/questions/2379/is-wadl-as-description-of-rest-services-supportedrestJAX-RS method returns StreamingOutput fails with "Access to ivy environment outside a process request thread is not possible"https://answers.axonivy.com/questions/2072/jax-rs-method-returns-streamingoutput-fails-with-access-to-ivy-environment-outside-a-process-request-thread-is-not-possible<p>Hi Ivy team</p> <p>I want to build a JAX-RS API returning response in a streaming manner (chunked transfer encoding). The code looks like below:</p> <pre><code>@Path("{applicationName}/streams") public class StreamingResponseRestSResource { @GET public Response getStreamingResponse() { // This works by keeping a reference then pass it to the anonymous class. // It may NOT work in all situations. final Logger logger = Ivy.log(); StreamingOutput streamingOutput = new StreamingOutput() { @Override public void write(OutputStream output) throws IOException, WebApplicationException { PrintWriter out = new PrintWriter(new BufferedWriter( new OutputStreamWriter(output)), true); Ivy.log().error("HHH - BREAK HERE"); logger.error("HHH - It works with passed reference of Logger"); IntStream.range(0, 100_000) .forEach(c -&gt; out.println("HHH - Count up to " + c)); } }; return Response.ok(streamingOutput).build(); } } </code></pre> <p>Full code here: <a href="http://pastebin.com/tEAMGFB3">http://pastebin.com/tEAMGFB3</a></p> <p>If I do</p> <p><code>curl -i -u Developer:Developer <a href="http://localhost:8081/ivy/api/designer/streams">http://localhost:8081/ivy/api/designer/streams</a></code></p> <p>the response would be:</p> <p><code>{ "errorId": "1578A42A15718503", "errorMessage": "Access to ivy environment outside a process request thread is not possible.\nCurrent thread: Thread[http-nio-8081-exec-14,5,main]", "statusCode": 500 }</code></p> <p>If I comment out the line ...</p> <p><code>Ivy.log().error("HHH - BREAK HERE");</code></p> <p>...the error disappears.</p> <p>Is there anyway to fix the access to <code>Ivy</code> with <code>StreamingOutput</code> implementation?</p>Genzer HawkerMon, 03 Oct 2016 14:50:20 -0400https://answers.axonivy.com/questions/2072/jax-rs-method-returns-streamingoutput-fails-with-access-to-ivy-environment-outside-a-process-request-thread-is-not-possibleivyrestHow can I analyze or log the root cause of my failing REST webservice call?https://answers.axonivy.com/questions/2033/how-can-i-analyze-or-log-the-root-cause-of-my-failing-rest-webservice-call<p>I'm calling a REST service which is provided by my client. While I'm able to call the development service, I get weird error status codes when I call the productive service on customer site. </p> <p>How can I analyse the REST service invocation and get detailed information how my request is processed? </p>SupportIvyTeamMon, 19 Sep 2016 08:57:04 -0400https://answers.axonivy.com/questions/2033/how-can-i-analyze-or-log-the-root-cause-of-my-failing-rest-webservice-callrestAxon ivy mobile experiencehttps://answers.axonivy.com/questions/1946/axon-ivy-mobile-experience<p>Hello Ivy Team,</p> <p>I want to provide some mobile experience to my users.</p> <p>There are currently 3 approaches in my head:</p> <p>1.Native Mobile Client - Native iOS and/or Android app - no Web View - communicating to Ivy via HTTP - only data returned, no HTML - offline support</p> <p>2.Hybrid Mobile Client - Phonegap or Ionic HTML SPA hosted on the device (web view) - communicating to Ivy via HTTP - only data returned, no HTML - offline support</p> <p>3.Mobile optimized web view - OOTB provided by Ivy web technologies - JSF and PrimeFaces - no offline support</p> <p>Option 3 is the easiest to implement and release, but it has the worse UX. My biggest concern for option 1 and 2 is the security in terms of session management.</p> <p>Witch approach would Ivy Team recommend ? I saw in the documentation about the Offline User Dialogs, but they goes to option 1</p> <p>Best Regards, Yordan Yunchov</p>Stelt0Mon, 08 Aug 2016 10:26:03 -0400https://answers.axonivy.com/questions/1946/axon-ivy-mobile-experiencehtmluserdialogmobilerestREST service securityhttps://answers.axonivy.com/questions/1858/rest-service-security<p>Hello All,</p> <p>What is the security context of the new REST services ? How to get/check the user that is consuming them ?</p> <p>Thanks a lot !</p> <p>Best Regards, Yordan Yunchov</p>Stelt0Mon, 04 Jul 2016 13:22:42 -0400https://answers.axonivy.com/questions/1858/rest-service-securitysecurityrestAjax call from HTML Dialog to consume Web Service and REST Servicehttps://answers.axonivy.com/questions/1837/ajax-call-from-html-dialog-to-consume-web-service-and-rest-service<p>Hi All,</p> <p>I have the situation where from HTML dialog I need to make custom Ajax call to ivy Web Service in the same process. I`m wandering what would be the implications of this approach regarding the security context.</p> <p>The Ajax call will send a HTTP request with the cookie session of the currently logged user. Will this be enough for ivy engine to identify the user ?</p> <p>This question is also valid for the future release 6.2 when it comes to REST services.</p> <p>Best Regards, Yordan</p>Stelt0Thu, 23 Jun 2016 17:40:38 -0400https://answers.axonivy.com/questions/1837/ajax-call-from-html-dialog-to-consume-web-service-and-rest-servicehtmldialogsecurityajaxrest