You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openwebbeans.apache.org by Rafael Pestano <rm...@yahoo.com.br> on 2012/06/26 01:43:37 UTC

Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Hi guys,

the CDI interceptor below works without problems in weld but fails in OWB, i want to know if its the expected behavior(weld is not following the spec), if im doing something wrong or if its a bug:


I define the interceptor logic in a superclass, eg:

public abstract class AbstractSecurityInterceptor implements Serializable {

@AroundInvoke 
         public Object checkPermition(InvocationContext ic) throws Exception {
if(userHasPermition()){
return ic.proceed();
}
                       else {
addFacesMessage("Some message");
}

}

     public abstract boolean userHasPermition();

}

@Interceptor
@MyQualifier
public class MyInterceptor extends AbstractSecurityInterceptor {


     public  boolean userHasPermition(){
//will never be invoked in Openwebbeans but works with weld.
}
}


thanks in advance.


Att, 

Rafael M. Pestano

Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
http://code.google.com/p/jsf-conventions-framework/
http://rpestano.wordpress.com
http://twitter.com/realpestano

Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Posted by Mark Struberg <st...@yahoo.de>.

Hi!

From a gut feeling I'd say the superclass method should work. But it's not really described in the spec (neither CDI nor interceptors spec). So I'm not sure if it's a spec issue or an owb issue...

In any case, glad the 'workaround' worked for you ;)

LieGrue,
strub



>________________________________
> From: Rafael Pestano <rm...@yahoo.com.br>
>To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org> 
>Sent: Wednesday, June 27, 2012 12:38 AM
>Subject: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
> 
>
>Yes, this just works:
>
>
>    @AroundInvoke
>    public Object checkPermission(InvocationContext ic) throws Exception {
>       return super.checkPermition(ic);
>    }
> 
>thank you guys.
>
>
>
>
>
>
>Att, 
>
>Rafael M. Pestano
>
>Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>Graduando em Ciência da Computação UFRGS
>http://code.google.com/p/jsf-conventions-framework/
>http://rpestano.wordpress.com
>http://twitter.com/realpestano
>
>
>
>
>________________________________
> De: Gerhard Petracek <ge...@gmail.com>
>Para: user@openwebbeans.apache.org 
>Enviadas: Terça-feira, 26 de Junho de 2012 12:34
>Assunto: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
> 
>
>@ mark:
>yes - that's the workaround (+ you have to annotate the method with @AroundInvoke).
>
>
>regards,
>gerhard
>
>
>
>
>2012/6/26 Mark Struberg <st...@yahoo.de>
>
>I can only guess that it's due to having the @AroundInvoke in the parent class and we do not check it.
>>
>>Can you just override it and call super() ?
>>
>>That should then work in both containers.
>>
>>
>>LieGrue,
>>strub
>>
>>
>>
>>----- Original Message -----
>>> From: Rafael Pestano <rm...@yahoo.com.br>
>>
>>> To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>; Mark Struberg <st...@yahoo.de>
>>> Cc:
>>
>>> Sent: Tuesday, June 26, 2012 1:43 PM
>>> Subject: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
>>>
>>> Hi Mark,
>>>
>>> i got no exceptions, the interceptor just isnt called. 
>>>
>>> I'll work on this issue(if there is one) and try to isolate the problem if i
>>> find something related to owb i'll bring a sample that reproduces the
>>> problem.
>>>
>>> thanks.
>>>  
>>> Att,
>>> Rafael M. Pestano
>>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>> Graduando em Ciência da Computação UFRGS
>>> http://code.google.com/p/jsf-conventions-framework/
>>> http://rpestano.wordpress.com
>>> http://twitter.com/realpestano
>>>
>>>
>>>
>>> ----- Mensagem original -----
>>> De: Mark Struberg <st...@yahoo.de>
>>> Para: "user@openwebbeans.apache.org"
>>> <us...@openwebbeans.apache.org>
>>> Cc:
>>> Enviadas: Terça-feira, 26 de Junho de 2012 3:03
>>> Assunto: Re: Defining interceptor @AroundInvoke in superclass fails in
>>> Openwebbeans
>>>
>>> Hi Rafael!
>>>
>>> What Exception/message do you get?
>>>
>>> LieGrue,
>>> strub
>>>
>>>
>>>
>>> ----- Original Message -----
>>>>  From: Rafael Pestano <rm...@yahoo.com.br>
>>>>  To: "user@openwebbeans.apache.org"
>>> <us...@openwebbeans.apache.org>
>>>>  Cc:
>>>>  Sent: Tuesday, June 26, 2012 2:26 AM
>>>>  Subject: Re: Defining interceptor @AroundInvoke in superclass fails in
>>> Openwebbeans
>>>>
>>>>  Hi again, 
>>>>
>>>>  i think its a problem with tomcat cause it even works with weld but i have
>>> the
>>>>  same app hosted at openshift(JBoss + weld 1.1.4) and the AroundInvoke works
>>> in
>>>>  the superclass.
>>>>
>>>>  so any clues are welcome.
>>>>
>>>>   
>>>>   
>>>>  Att,
>>>>  Rafael M. Pestano
>>>>  Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>>>  Graduando em Ciência da Computação UFRGS
>>>>  http://code.google.com/p/jsf-conventions-framework/
>>>>  http://rpestano.wordpress.com
>>>>  http://twitter.com/realpestano
>>>>
>>>>
>>>>
>>>>  ----- Mensagem original -----
>>>>  De: Rafael Pestano <rm...@yahoo.com.br>
>>>>  Para: "user@openwebbeans.apache.org"
>>>>  <us...@openwebbeans.apache.org>
>>>>  Cc:
>>>>  Enviadas: Segunda-feira, 25 de Junho de 2012 20:43
>>>>  Assunto: Defining interceptor @AroundInvoke in superclass fails in
>>> Openwebbeans
>>>>
>>>>  Hi guys,
>>>>
>>>>  the CDI interceptor below works without problems in weld but fails in OWB,
>>> i
>>>>  want to know if its the expected behavior(weld is not following the spec),
>>> if im
>>>>  doing something wrong or if its a bug:
>>>>
>>>>
>>>>  I define the interceptor logic in a superclass, eg:
>>>>
>>>>  public abstract class AbstractSecurityInterceptor implements Serializable {
>>>>
>>>>  @AroundInvoke 
>>>>           public Object checkPermition(InvocationContext ic) throws
>>> Exception {
>>>>  if(userHasPermition()){
>>>>  return ic.proceed();
>>>>  }
>>>>                         else {
>>>>  addFacesMessage("Some message");
>>>>  }
>>>>
>>>>  }
>>>>
>>>>       public abstract boolean userHasPermition();
>>>>
>>>>  }
>>>>
>>>>  @Interceptor
>>>>  @MyQualifier
>>>>  public class MyInterceptor extends AbstractSecurityInterceptor {
>>>>
>>>>
>>>>       public  boolean userHasPermition(){
>>>>  //will never be invoked in Openwebbeans but works with weld.
>>>>  }
>>>>  }
>>>>
>>>>
>>>>  thanks in advance.
>>>>
>>>>
>>>>  Att,
>>>>
>>>>  Rafael M. Pestano
>>>>
>>>>  Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>>>  Graduando em Ciência da Computação UFRGS
>>>>  http://code.google.com/p/jsf-conventions-framework/
>>>>  http://rpestano.wordpress.com
>>>>  http://twitter.com/realpestano
>>>>
>>>
>>
>
>
>
>
>

Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Posted by Rafael Pestano <rm...@yahoo.com.br>.
Yes, this just works:

    @AroundInvoke
    public Object checkPermission(InvocationContext ic) throws Exception {
       return super.checkPermition(ic);
    }
 
thank you guys.



Att, 

Rafael M. Pestano

Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
http://code.google.com/p/jsf-conventions-framework/
http://rpestano.wordpress.com
http://twitter.com/realpestano



________________________________
 De: Gerhard Petracek <ge...@gmail.com>
Para: user@openwebbeans.apache.org 
Enviadas: Terça-feira, 26 de Junho de 2012 12:34
Assunto: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
 

@ mark:
yes - that's the workaround (+ you have to annotate the method with @AroundInvoke).

regards,
gerhard



2012/6/26 Mark Struberg <st...@yahoo.de>

I can only guess that it's due to having the @AroundInvoke in the parent class and we do not check it.
>
>Can you just override it and call super() ?
>
>That should then work in both containers.
>
>
>LieGrue,
>strub
>
>
>
>----- Original Message -----
>> From: Rafael Pestano <rm...@yahoo.com.br>
>
>> To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>; Mark Struberg <st...@yahoo.de>
>> Cc:
>
>> Sent: Tuesday, June 26, 2012 1:43 PM
>> Subject: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
>>
>> Hi Mark,
>>
>> i got no exceptions, the interceptor just isnt called. 
>>
>> I'll work on this issue(if there is one) and try to isolate the problem if i
>> find something related to owb i'll bring a sample that reproduces the
>> problem.
>>
>> thanks.
>>  
>> Att,
>> Rafael M. Pestano
>> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>> Graduando em Ciência da Computação UFRGS
>> http://code.google.com/p/jsf-conventions-framework/
>> http://rpestano.wordpress.com
>> http://twitter.com/realpestano
>>
>>
>>
>> ----- Mensagem original -----
>> De: Mark Struberg <st...@yahoo.de>
>> Para: "user@openwebbeans.apache.org"
>> <us...@openwebbeans.apache.org>
>> Cc:
>> Enviadas: Terça-feira, 26 de Junho de 2012 3:03
>> Assunto: Re: Defining interceptor @AroundInvoke in superclass fails in
>> Openwebbeans
>>
>> Hi Rafael!
>>
>> What Exception/message do you get?
>>
>> LieGrue,
>> strub
>>
>>
>>
>> ----- Original Message -----
>>>  From: Rafael Pestano <rm...@yahoo.com.br>
>>>  To: "user@openwebbeans.apache.org"
>> <us...@openwebbeans.apache.org>
>>>  Cc:
>>>  Sent: Tuesday, June 26, 2012 2:26 AM
>>>  Subject: Re: Defining interceptor @AroundInvoke in superclass fails in
>> Openwebbeans
>>>
>>>  Hi again, 
>>>
>>>  i think its a problem with tomcat cause it even works with weld but i have
>> the
>>>  same app hosted at openshift(JBoss + weld 1.1.4) and the AroundInvoke works
>> in
>>>  the superclass.
>>>
>>>  so any clues are welcome.
>>>
>>>   
>>>   
>>>  Att,
>>>  Rafael M. Pestano
>>>  Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>>  Graduando em Ciência da Computação UFRGS
>>>  http://code.google.com/p/jsf-conventions-framework/
>>>  http://rpestano.wordpress.com
>>>  http://twitter.com/realpestano
>>>
>>>
>>>
>>>  ----- Mensagem original -----
>>>  De: Rafael Pestano <rm...@yahoo.com.br>
>>>  Para: "user@openwebbeans.apache.org"
>>>  <us...@openwebbeans.apache.org>
>>>  Cc:
>>>  Enviadas: Segunda-feira, 25 de Junho de 2012 20:43
>>>  Assunto: Defining interceptor @AroundInvoke in superclass fails in
>> Openwebbeans
>>>
>>>  Hi guys,
>>>
>>>  the CDI interceptor below works without problems in weld but fails in OWB,
>> i
>>>  want to know if its the expected behavior(weld is not following the spec),
>> if im
>>>  doing something wrong or if its a bug:
>>>
>>>
>>>  I define the interceptor logic in a superclass, eg:
>>>
>>>  public abstract class AbstractSecurityInterceptor implements Serializable {
>>>
>>>  @AroundInvoke 
>>>           public Object checkPermition(InvocationContext ic) throws
>> Exception {
>>>  if(userHasPermition()){
>>>  return ic.proceed();
>>>  }
>>>                         else {
>>>  addFacesMessage("Some message");
>>>  }
>>>
>>>  }
>>>
>>>       public abstract boolean userHasPermition();
>>>
>>>  }
>>>
>>>  @Interceptor
>>>  @MyQualifier
>>>  public class MyInterceptor extends AbstractSecurityInterceptor {
>>>
>>>
>>>       public  boolean userHasPermition(){
>>>  //will never be invoked in Openwebbeans but works with weld.
>>>  }
>>>  }
>>>
>>>
>>>  thanks in advance.
>>>
>>>
>>>  Att,
>>>
>>>  Rafael M. Pestano
>>>
>>>  Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>>  Graduando em Ciência da Computação UFRGS
>>>  http://code.google.com/p/jsf-conventions-framework/
>>>  http://rpestano.wordpress.com
>>>  http://twitter.com/realpestano
>>>
>>
>

Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Posted by Gerhard Petracek <ge...@gmail.com>.
@ mark:
yes - that's the workaround (+ you have to annotate the method with
@AroundInvoke).

regards,
gerhard



2012/6/26 Mark Struberg <st...@yahoo.de>

> I can only guess that it's due to having the @AroundInvoke in the parent
> class and we do not check it.
>
> Can you just override it and call super() ?
>
> That should then work in both containers.
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Rafael Pestano <rm...@yahoo.com.br>
> > To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>; Mark
> Struberg <st...@yahoo.de>
> > Cc:
> > Sent: Tuesday, June 26, 2012 1:43 PM
> > Subject: Re: Defining interceptor @AroundInvoke in superclass fails in
> Openwebbeans
> >
> > Hi Mark,
> >
> > i got no exceptions, the interceptor just isnt called.
> >
> > I'll work on this issue(if there is one) and try to isolate the problem
> if i
> > find something related to owb i'll bring a sample that reproduces the
> > problem.
> >
> > thanks.
> >
> > Att,
> > Rafael M. Pestano
> > Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> > Graduando em Ciência da Computação UFRGS
> > http://code.google.com/p/jsf-conventions-framework/
> > http://rpestano.wordpress.com
> > http://twitter.com/realpestano
> >
> >
> >
> > ----- Mensagem original -----
> > De: Mark Struberg <st...@yahoo.de>
> > Para: "user@openwebbeans.apache.org"
> > <us...@openwebbeans.apache.org>
> > Cc:
> > Enviadas: Terça-feira, 26 de Junho de 2012 3:03
> > Assunto: Re: Defining interceptor @AroundInvoke in superclass fails in
> > Openwebbeans
> >
> > Hi Rafael!
> >
> > What Exception/message do you get?
> >
> > LieGrue,
> > strub
> >
> >
> >
> > ----- Original Message -----
> >>  From: Rafael Pestano <rm...@yahoo.com.br>
> >>  To: "user@openwebbeans.apache.org"
> > <us...@openwebbeans.apache.org>
> >>  Cc:
> >>  Sent: Tuesday, June 26, 2012 2:26 AM
> >>  Subject: Re: Defining interceptor @AroundInvoke in superclass fails in
> > Openwebbeans
> >>
> >>  Hi again,
> >>
> >>  i think its a problem with tomcat cause it even works with weld but i
> have
> > the
> >>  same app hosted at openshift(JBoss + weld 1.1.4) and the AroundInvoke
> works
> > in
> >>  the superclass.
> >>
> >>  so any clues are welcome.
> >>
> >>
> >>
> >>  Att,
> >>  Rafael M. Pestano
> >>  Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> >>  Graduando em Ciência da Computação UFRGS
> >>  http://code.google.com/p/jsf-conventions-framework/
> >>  http://rpestano.wordpress.com
> >>  http://twitter.com/realpestano
> >>
> >>
> >>
> >>  ----- Mensagem original -----
> >>  De: Rafael Pestano <rm...@yahoo.com.br>
> >>  Para: "user@openwebbeans.apache.org"
> >>  <us...@openwebbeans.apache.org>
> >>  Cc:
> >>  Enviadas: Segunda-feira, 25 de Junho de 2012 20:43
> >>  Assunto: Defining interceptor @AroundInvoke in superclass fails in
> > Openwebbeans
> >>
> >>  Hi guys,
> >>
> >>  the CDI interceptor below works without problems in weld but fails in
> OWB,
> > i
> >>  want to know if its the expected behavior(weld is not following the
> spec),
> > if im
> >>  doing something wrong or if its a bug:
> >>
> >>
> >>  I define the interceptor logic in a superclass, eg:
> >>
> >>  public abstract class AbstractSecurityInterceptor implements
> Serializable {
> >>
> >>  @AroundInvoke
> >>           public Object checkPermition(InvocationContext ic) throws
> > Exception {
> >>  if(userHasPermition()){
> >>  return ic.proceed();
> >>  }
> >>                         else {
> >>  addFacesMessage("Some message");
> >>  }
> >>
> >>  }
> >>
> >>       public abstract boolean userHasPermition();
> >>
> >>  }
> >>
> >>  @Interceptor
> >>  @MyQualifier
> >>  public class MyInterceptor extends AbstractSecurityInterceptor {
> >>
> >>
> >>       public  boolean userHasPermition(){
> >>  //will never be invoked in Openwebbeans but works with weld.
> >>  }
> >>  }
> >>
> >>
> >>  thanks in advance.
> >>
> >>
> >>  Att,
> >>
> >>  Rafael M. Pestano
> >>
> >>  Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> >>  Graduando em Ciência da Computação UFRGS
> >>  http://code.google.com/p/jsf-conventions-framework/
> >>  http://rpestano.wordpress.com
> >>  http://twitter.com/realpestano
> >>
> >
>

Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Posted by Mark Struberg <st...@yahoo.de>.
I can only guess that it's due to having the @AroundInvoke in the parent class and we do not check it.

Can you just override it and call super() ?

That should then work in both containers.

LieGrue,
strub



----- Original Message -----
> From: Rafael Pestano <rm...@yahoo.com.br>
> To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>; Mark Struberg <st...@yahoo.de>
> Cc: 
> Sent: Tuesday, June 26, 2012 1:43 PM
> Subject: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
> 
> Hi Mark,
> 
> i got no exceptions, the interceptor just isnt called. 
> 
> I'll work on this issue(if there is one) and try to isolate the problem if i 
> find something related to owb i'll bring a sample that reproduces the 
> problem.
> 
> thanks.
>  
> Att, 
> Rafael M. Pestano
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> Graduando em Ciência da Computação UFRGS
> http://code.google.com/p/jsf-conventions-framework/
> http://rpestano.wordpress.com
> http://twitter.com/realpestano
> 
> 
> 
> ----- Mensagem original -----
> De: Mark Struberg <st...@yahoo.de>
> Para: "user@openwebbeans.apache.org" 
> <us...@openwebbeans.apache.org>
> Cc: 
> Enviadas: Terça-feira, 26 de Junho de 2012 3:03
> Assunto: Re: Defining interceptor @AroundInvoke in superclass fails in 
> Openwebbeans
> 
> Hi Rafael!
> 
> What Exception/message do you get?
> 
> LieGrue,
> strub
> 
> 
> 
> ----- Original Message -----
>>  From: Rafael Pestano <rm...@yahoo.com.br>
>>  To: "user@openwebbeans.apache.org" 
> <us...@openwebbeans.apache.org>
>>  Cc: 
>>  Sent: Tuesday, June 26, 2012 2:26 AM
>>  Subject: Re: Defining interceptor @AroundInvoke in superclass fails in 
> Openwebbeans
>> 
>>  Hi again, 
>> 
>>  i think its a problem with tomcat cause it even works with weld but i have 
> the 
>>  same app hosted at openshift(JBoss + weld 1.1.4) and the AroundInvoke works 
> in 
>>  the superclass.
>> 
>>  so any clues are welcome.
>> 
>>   
>>   
>>  Att, 
>>  Rafael M. Pestano
>>  Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>  Graduando em Ciência da Computação UFRGS
>>  http://code.google.com/p/jsf-conventions-framework/
>>  http://rpestano.wordpress.com
>>  http://twitter.com/realpestano
>> 
>> 
>> 
>>  ----- Mensagem original -----
>>  De: Rafael Pestano <rm...@yahoo.com.br>
>>  Para: "user@openwebbeans.apache.org" 
>>  <us...@openwebbeans.apache.org>
>>  Cc: 
>>  Enviadas: Segunda-feira, 25 de Junho de 2012 20:43
>>  Assunto: Defining interceptor @AroundInvoke in superclass fails in 
> Openwebbeans
>> 
>>  Hi guys,
>> 
>>  the CDI interceptor below works without problems in weld but fails in OWB, 
> i 
>>  want to know if its the expected behavior(weld is not following the spec), 
> if im 
>>  doing something wrong or if its a bug:
>> 
>> 
>>  I define the interceptor logic in a superclass, eg:
>> 
>>  public abstract class AbstractSecurityInterceptor implements Serializable {
>> 
>>  @AroundInvoke 
>>           public Object checkPermition(InvocationContext ic) throws 
> Exception {
>>  if(userHasPermition()){
>>  return ic.proceed();
>>  }
>>                         else {
>>  addFacesMessage("Some message");
>>  }
>> 
>>  }
>> 
>>       public abstract boolean userHasPermition();
>> 
>>  }
>> 
>>  @Interceptor
>>  @MyQualifier
>>  public class MyInterceptor extends AbstractSecurityInterceptor {
>> 
>> 
>>       public  boolean userHasPermition(){
>>  //will never be invoked in Openwebbeans but works with weld.
>>  }
>>  }
>> 
>> 
>>  thanks in advance.
>> 
>> 
>>  Att, 
>> 
>>  Rafael M. Pestano
>> 
>>  Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
>>  Graduando em Ciência da Computação UFRGS
>>  http://code.google.com/p/jsf-conventions-framework/
>>  http://rpestano.wordpress.com
>>  http://twitter.com/realpestano
>> 
> 

Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Posted by Gerhard Petracek <ge...@gmail.com>.
hi rafael,

there's a workaround for it, however, we should discuss/re-visit it (since
weld handles it differently).

regards,
gerhard



2012/6/26 Rafael Pestano <rm...@yahoo.com.br>

> Hi Mark,
>
> i got no exceptions, the interceptor just isnt called.
>
> I'll work on this issue(if there is one) and try to isolate the problem if
> i find something related to owb i'll bring a sample that reproduces the
> problem.
>
> thanks.
>
> Att,
> Rafael M. Pestano
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> Graduando em Ciência da Computação UFRGS
> http://code.google.com/p/jsf-conventions-framework/
> http://rpestano.wordpress.com
> http://twitter.com/realpestano
>
>
>
> ----- Mensagem original -----
> De: Mark Struberg <st...@yahoo.de>
> Para: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
> Cc:
> Enviadas: Terça-feira, 26 de Junho de 2012 3:03
> Assunto: Re: Defining interceptor @AroundInvoke in superclass fails in
> Openwebbeans
>
> Hi Rafael!
>
> What Exception/message do you get?
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Rafael Pestano <rm...@yahoo.com.br>
> > To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
> > Cc:
> > Sent: Tuesday, June 26, 2012 2:26 AM
> > Subject: Re: Defining interceptor @AroundInvoke in superclass fails in
> Openwebbeans
> >
> > Hi again,
> >
> > i think its a problem with tomcat cause it even works with weld but i
> have the
> > same app hosted at openshift(JBoss + weld 1.1.4) and the AroundInvoke
> works in
> > the superclass.
> >
> > so any clues are welcome.
> >
> >
> >
> > Att,
> > Rafael M. Pestano
> > Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> > Graduando em Ciência da Computação UFRGS
> > http://code.google.com/p/jsf-conventions-framework/
> > http://rpestano.wordpress.com
> > http://twitter.com/realpestano
> >
> >
> >
> > ----- Mensagem original -----
> > De: Rafael Pestano <rm...@yahoo.com.br>
> > Para: "user@openwebbeans.apache.org"
> > <us...@openwebbeans.apache.org>
> > Cc:
> > Enviadas: Segunda-feira, 25 de Junho de 2012 20:43
> > Assunto: Defining interceptor @AroundInvoke in superclass fails in
> Openwebbeans
> >
> > Hi guys,
> >
> > the CDI interceptor below works without problems in weld but fails in
> OWB, i
> > want to know if its the expected behavior(weld is not following the
> spec), if im
> > doing something wrong or if its a bug:
> >
> >
> > I define the interceptor logic in a superclass, eg:
> >
> > public abstract class AbstractSecurityInterceptor implements
> Serializable {
> >
> > @AroundInvoke
> >          public Object checkPermition(InvocationContext ic) throws
> Exception {
> > if(userHasPermition()){
> > return ic.proceed();
> > }
> >                        else {
> > addFacesMessage("Some message");
> > }
> >
> > }
> >
> >      public abstract boolean userHasPermition();
> >
> > }
> >
> > @Interceptor
> > @MyQualifier
> > public class MyInterceptor extends AbstractSecurityInterceptor {
> >
> >
> >      public  boolean userHasPermition(){
> > //will never be invoked in Openwebbeans but works with weld.
> > }
> > }
> >
> >
> > thanks in advance.
> >
> >
> > Att,
> >
> > Rafael M. Pestano
> >
> > Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> > Graduando em Ciência da Computação UFRGS
> > http://code.google.com/p/jsf-conventions-framework/
> > http://rpestano.wordpress.com
> > http://twitter.com/realpestano
> >
>
>

Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Posted by Rafael Pestano <rm...@yahoo.com.br>.
Hi Mark,

i got no exceptions, the interceptor just isnt called. 

I'll work on this issue(if there is one) and try to isolate the problem if i find something related to owb i'll bring a sample that reproduces the problem.

thanks.
 
Att, 
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
http://code.google.com/p/jsf-conventions-framework/
http://rpestano.wordpress.com
http://twitter.com/realpestano



----- Mensagem original -----
De: Mark Struberg <st...@yahoo.de>
Para: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
Cc: 
Enviadas: Terça-feira, 26 de Junho de 2012 3:03
Assunto: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Hi Rafael!

What Exception/message do you get?

LieGrue,
strub



----- Original Message -----
> From: Rafael Pestano <rm...@yahoo.com.br>
> To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
> Cc: 
> Sent: Tuesday, June 26, 2012 2:26 AM
> Subject: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
> 
> Hi again, 
> 
> i think its a problem with tomcat cause it even works with weld but i have the 
> same app hosted at openshift(JBoss + weld 1.1.4) and the AroundInvoke works in 
> the superclass.
> 
> so any clues are welcome.
> 
>  
>  
> Att, 
> Rafael M. Pestano
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> Graduando em Ciência da Computação UFRGS
> http://code.google.com/p/jsf-conventions-framework/
> http://rpestano.wordpress.com
> http://twitter.com/realpestano
> 
> 
> 
> ----- Mensagem original -----
> De: Rafael Pestano <rm...@yahoo.com.br>
> Para: "user@openwebbeans.apache.org" 
> <us...@openwebbeans.apache.org>
> Cc: 
> Enviadas: Segunda-feira, 25 de Junho de 2012 20:43
> Assunto: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
> 
> Hi guys,
> 
> the CDI interceptor below works without problems in weld but fails in OWB, i 
> want to know if its the expected behavior(weld is not following the spec), if im 
> doing something wrong or if its a bug:
> 
> 
> I define the interceptor logic in a superclass, eg:
> 
> public abstract class AbstractSecurityInterceptor implements Serializable {
> 
> @AroundInvoke 
>          public Object checkPermition(InvocationContext ic) throws Exception {
> if(userHasPermition()){
> return ic.proceed();
> }
>                        else {
> addFacesMessage("Some message");
> }
> 
> }
> 
>      public abstract boolean userHasPermition();
> 
> }
> 
> @Interceptor
> @MyQualifier
> public class MyInterceptor extends AbstractSecurityInterceptor {
> 
> 
>      public  boolean userHasPermition(){
> //will never be invoked in Openwebbeans but works with weld.
> }
> }
> 
> 
> thanks in advance.
> 
> 
> Att, 
> 
> Rafael M. Pestano
> 
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> Graduando em Ciência da Computação UFRGS
> http://code.google.com/p/jsf-conventions-framework/
> http://rpestano.wordpress.com
> http://twitter.com/realpestano
>


Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Posted by Mark Struberg <st...@yahoo.de>.
Hi Rafael!

What Exception/message do you get?

LieGrue,
strub



----- Original Message -----
> From: Rafael Pestano <rm...@yahoo.com.br>
> To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
> Cc: 
> Sent: Tuesday, June 26, 2012 2:26 AM
> Subject: Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
> 
> Hi again, 
> 
> i think its a problem with tomcat cause it even works with weld but i have the 
> same app hosted at openshift(JBoss + weld 1.1.4) and the AroundInvoke works in 
> the superclass.
> 
> so any clues are welcome.
> 
>  
>  
> Att, 
> Rafael M. Pestano
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> Graduando em Ciência da Computação UFRGS
> http://code.google.com/p/jsf-conventions-framework/
> http://rpestano.wordpress.com
> http://twitter.com/realpestano
> 
> 
> 
> ----- Mensagem original -----
> De: Rafael Pestano <rm...@yahoo.com.br>
> Para: "user@openwebbeans.apache.org" 
> <us...@openwebbeans.apache.org>
> Cc: 
> Enviadas: Segunda-feira, 25 de Junho de 2012 20:43
> Assunto: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans
> 
> Hi guys,
> 
> the CDI interceptor below works without problems in weld but fails in OWB, i 
> want to know if its the expected behavior(weld is not following the spec), if im 
> doing something wrong or if its a bug:
> 
> 
> I define the interceptor logic in a superclass, eg:
> 
> public abstract class AbstractSecurityInterceptor implements Serializable {
> 
> @AroundInvoke 
>          public Object checkPermition(InvocationContext ic) throws Exception {
> if(userHasPermition()){
> return ic.proceed();
> }
>                        else {
> addFacesMessage("Some message");
> }
> 
> }
> 
>      public abstract boolean userHasPermition();
> 
> }
> 
> @Interceptor
> @MyQualifier
> public class MyInterceptor extends AbstractSecurityInterceptor {
> 
> 
>      public  boolean userHasPermition(){
> //will never be invoked in Openwebbeans but works with weld.
> }
> }
> 
> 
> thanks in advance.
> 
> 
> Att, 
> 
> Rafael M. Pestano
> 
> Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> Graduando em Ciência da Computação UFRGS
> http://code.google.com/p/jsf-conventions-framework/
> http://rpestano.wordpress.com
> http://twitter.com/realpestano
> 

Re: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Posted by Rafael Pestano <rm...@yahoo.com.br>.
Hi again, 

i think its a problem with tomcat cause it even works with weld but i have the same app hosted at openshift(JBoss + weld 1.1.4) and the AroundInvoke works in the superclass.

so any clues are welcome.

 
 
Att, 
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
http://code.google.com/p/jsf-conventions-framework/
http://rpestano.wordpress.com
http://twitter.com/realpestano



----- Mensagem original -----
De: Rafael Pestano <rm...@yahoo.com.br>
Para: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
Cc: 
Enviadas: Segunda-feira, 25 de Junho de 2012 20:43
Assunto: Defining interceptor @AroundInvoke in superclass fails in Openwebbeans

Hi guys,

the CDI interceptor below works without problems in weld but fails in OWB, i want to know if its the expected behavior(weld is not following the spec), if im doing something wrong or if its a bug:


I define the interceptor logic in a superclass, eg:

public abstract class AbstractSecurityInterceptor implements Serializable {

@AroundInvoke 
         public Object checkPermition(InvocationContext ic) throws Exception {
if(userHasPermition()){
return ic.proceed();
}
                       else {
addFacesMessage("Some message");
}

}

     public abstract boolean userHasPermition();

}

@Interceptor
@MyQualifier
public class MyInterceptor extends AbstractSecurityInterceptor {


     public  boolean userHasPermition(){
//will never be invoked in Openwebbeans but works with weld.
}
}


thanks in advance.


Att, 

Rafael M. Pestano

Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
http://code.google.com/p/jsf-conventions-framework/
http://rpestano.wordpress.com
http://twitter.com/realpestano