good news
On Thu, Dec 19, 2013 at 11:54 AM, Peter Palaga <ppalaga(a)redhat.com> wrote:
Thanks for the tip, Nicolas! I fixed it as you proposed:
https://github.com/gatein/gatein-portal/pull/741
-- PP
On 2013-12-18 11:41, Nicolas Filotto wrote:
> Hum, obviously you duplicated the code in gatein
>
https://github.com/ppalaga/gatein-portal/blob/
> 754306903290b517db4c33c954a9d324e261c452/component/
> management/src/main/java/org/exoplatform/management/data/
> RestResource.java
> so I cannot test. So what you should do, is to apply the same fix on
> your copy and tell me if it is fine with it.
>
> Here is the fix to apply on your side
>
https://github.com/exodev/ws/commit/04e1f72b2c6bac9e91ca790acd3639
> e54a5230c0
>
>
> On Wed, Dec 18, 2013 at 10:22 AM, Nicolas Filotto
> <nfilotto(a)exoplatform.com <mailto:nfilotto@exoplatform.com>> wrote:
>
> Thx for the PR, however it is not the correct fix. Please find more
> details here
>
https://github.com/exoplatform/ws/pull/5#issuecomment-30830512.
> How can I test my fix ?
>
>
> On Tue, Dec 17, 2013 at 7:44 PM, Nicolas Filotto
> <nfilotto(a)exoplatform.com <mailto:nfilotto@exoplatform.com>> wrote:
>
> That sounds correct, please fill in a JIRA issue in the WS
> project. I'll fix it asap
>
>
> On Tue, Dec 17, 2013 at 5:02 PM, Peter Palaga
> <ppalaga(a)redhat.com <mailto:ppalaga@redhat.com>> wrote:
>
> Hi Nicolas,
>
> I hope you are the best addressee for this question. I am
> just solving [1], where:
>
> (1) A NullPointerException is thrown in
> TemplateStatisticService.__getExecutionCount(__
> TemplateStatisticService.java:__120)
>
>
> (2) The NullPointerException is catched in
> RestResource.safeInvoke(__MethodInvoker, Map<String,
>
> List<String>>) where Response.serverError() is returned, see
> [2]. This is probably incorrect,
>
> Response.serverError().build()
>
> or
>
> Response.serverError().entity(__e.getMessage()).build()
>
>
> would probably be better.
>
> (3) But anyway, this return value is not handled properly in
> RequestDispatcher.__processResponse(...). There, the result
>
> is handled only based on the expected return type, in this
> case java.lang.Object, which boils down to the last else,
> see [3].
>
>
> Hence, the main question is if this can be fixed in
> RequestDispatcher. Could perhaps the Resource type check [4]
> be applied also on o, like this:
>
> else if (Response.class.__isAssignableFrom(returnType) || o
>
> instanceof Response)
>
> Or can you perhaps see other better possibilities to fix this?
>
> Thanks,
>
> Peter
>
>
> [1]
https://issues.jboss.org/__browse/GTNPORTAL-3292
> <
https://issues.jboss.org/browse/GTNPORTAL-3292>
> [2]
>
https://github.com/gatein/__gatein-portal/blob/master/__
> component/management/src/main/__java/org/exoplatform/__
> management/data/RestResource.__java#L223
> <
https://github.com/gatein/gatein-portal/blob/master/
> component/management/src/main/java/org/exoplatform/
> management/data/RestResource.java#L223>
> [3]
>
https://github.com/__exoplatform/ws/blob/master/__
> exo.ws.rest.core/src/main/__java/org/exoplatform/services/
> __rest/impl/RequestDispatcher.__java#L763
> <
https://github.com/exoplatform/ws/blob/master/
> exo.ws.rest.core/src/main/java/org/exoplatform/services/
> rest/impl/RequestDispatcher.java#L763>
> [4]
>
https://github.com/__exoplatform/ws/blob/master/__
> exo.ws.rest.core/src/main/__java/org/exoplatform/services/
> __rest/impl/RequestDispatcher.__java#L747
>
> <
https://github.com/exoplatform/ws/blob/master/
> exo.ws.rest.core/src/main/java/org/exoplatform/services/
> rest/impl/RequestDispatcher.java#L747>
>
>
>
>
> --
> Nicolas Filotto
> Project Leader JCR
> eXo Platform SAS
> nfilotto(a)exoplatform.com <mailto:nfilotto@exoplatform.com>
>
>
>
>
>
> --
> Nicolas Filotto
> Project Leader JCR
> eXo Platform SAS
> nfilotto(a)exoplatform.com <mailto:nfilotto@exoplatform.com>
>
>
>
>
>
> --
> Nicolas Filotto
> Project Leader JCR
> eXo Platform SAS
> nfilotto(a)exoplatform.com <mailto:nfilotto@exoplatform.com>
>
--
Nicolas Filotto
Project Leader JCR
eXo Platform SAS
nfilotto(a)exoplatform.com