About Question enthuware.oce-ejbd.v6.2.621 :

Moderator: admin

Post Reply
doriamauro@gmail.com
Posts: 7
Joined: Wed May 03, 2017 8:14 am
Contact:

About Question enthuware.oce-ejbd.v6.2.621 :

Post by doriamauro@gmail.com »

hello,
about this point of explenation:

2. Ideally,  an interceptor method should have a throws Exception clause but not having it is also ok. This is based on the logic of overriding a method.


I don't see any superclass and then any overriding logic.

thanks in advanced

Mauro

admin
Site Admin
Posts: 10034
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by admin »

Yes, I am not sure what that statement means.

The specification allows an interceptor method to have a throws clause. Business method interceptor methods may throw runtime exceptions or application exceptions that are allowed in the throws clause of the business method. But the method can choose not to have it.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.

brunomg00
Posts: 3
Joined: Mon Nov 20, 2017 8:41 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by brunomg00 »

According to the question of the following link: viewtopic.php?f=4&t=2161, I believe that description is wrong.
Since it seems to be that an Interceptor for a business method must declare throws Exception, it is not ok to not declare it as stated by the explanation.
That said, I believe that the correct answer would be:
The interceptor class will fail to deploy.
Thanks in advance.

dfigueira
Posts: 21
Joined: Thu May 05, 2016 2:50 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by dfigueira »

I failed this question choosing the option "The bean class will fail to deploy."

Because the question's code has:

Code: Select all

Bean code:// 
Stateless 
@Interceptors ({MyAroundInterceptor.class} )
@ is missing before Stateless... Please fix the code in this question.

Tks

admin
Site Admin
Posts: 10034
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by admin »

You are right. Will be fixed asap.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.

henrid
Posts: 31
Joined: Sun Oct 13, 2013 1:20 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by henrid »

I guess it is still not fixed, because I also failed my correct answer.

admin
Site Admin
Posts: 10034
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by admin »

Sorry about that. Definitely fixed now in v 1.83.
If you like our products and services, please help us by posting your review here.

henrid
Posts: 31
Joined: Sun Oct 13, 2013 1:20 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by henrid »

Thanks. I hope you can re-use questions after 1Z0-895 retires on March 31.

henrid
Posts: 31
Joined: Sun Oct 13, 2013 1:20 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by henrid »

From earlier questions, I learned that an interceptor method MUST have "throws Exception" in the signature.
Now it looks like it is not needed. So please let me know what is the real requirement?

admin
Site Admin
Posts: 10034
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by admin »

As per the the Interceptor specification the around invoke interceptor method should have "throws Exception" clause but the EJB specification does not explicitly list this as a requirement. It merely states that an interceptor method is allowed to throw exception.

So, in our opinion, both i.e. having a throws clause and not having a throws clause, are valid. We haven't seen any one getting a question that depends on this aspect of an interceptor method. In other words, you will not have to select the correct option based on whether the throws clause is mandatory or not.
If you like our products and services, please help us by posting your review here.

henrid
Posts: 31
Joined: Sun Oct 13, 2013 1:20 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.621 :

Post by henrid »

Thank you!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests