Hello IvyTeam, 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:
The JAX-RS Resource is located in the same project as the process. It works without problem in a Process (IvyScript Step). 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() Thanks in advance Here the StackTrace I get:
asked 18.04.2018 at 15:06 Emmanuel Comba Alex Suter ♦♦ |
This bug has been fixed with Ivy 7.0.5 and Ivy 7.2. For other versions consider the workaround via a sub process call. Have a look at ConnectivityDemos:
Does this code snippet fit you rneeds?
answered 19.04.2018 at 01:39 Alex Suter ♦♦ |
Hi Alex, Thanks for your answer. This is unfortunately not exactly my use-case. What I want to achieve is:
Normally
is the easiest way to perform that. But in the case of a jax-rs Rest Resource, I suppose that the we are outside any "real" Ivy context. That could explain why I get the Error I have posted in my first post. Do you know another way to perform that? Thanks in advance Emmanuel answered 19.04.2018 at 01:55 Emmanuel Comba 1
hi @Emmanuel Comba
I think you're right about in RestAPI we're outside of 'real' ivy context. I also can't use some api like Normally i need to create callablesub just to execute I'm looking forward for another solution. :)
(19.04.2018 at 07:12)
trungdv
Hi @trungdv and @Alex Suter Thanks for your help. Calling a subcallable that compute, the given processName url, from the rest Resource is working fine. It is a little bit more complex but it is acceptable ;) It would be great to have access to the Ivy Context within a jax rs resource. Thanks and cheers Emmanuel
(19.04.2018 at 08:37)
Emmanuel Comba
1
Hello everybody. Thanks for the additional info. We think that this is a bug and we will fix that. But some api like ivy.repo.get(), will still fail, because they relates to a case. And in the rest context, there is no case set. There you must use ivy.repo.find(): XIVY-2504
(19.04.2018 at 09:51)
Alex Suter ♦♦
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 18.04.2018 at 15:06
Seen: 2,350 times
Last updated: 25.04.2018 at 03:10