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

Moderator: admin

Post Reply
johnlong
Posts: 185
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong »

Make Y implement MessageListener instead of MessageDrivenBean.
is marked as correct
Make Y implement MessageListener also.
is marked as incorrect

This means that MDB would be not valid in case if it implements both MessageListener and MessageDrivenBean, which is not correct.
The question does not say what is required, it just asks to fix the code. You can fix it by just adding required MessageListener interface to the current implements clause.

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

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

Post by admin »

Did you read the explanation?
Y does not implement the methods from the MessageDrivenBean interface (ejbRemove and setMessageDrivenContext) so making it implement MessageListener without removing MessageDrivenBean from its implements clause will not solve the problem.
If you like our products and services, please help us by posting your review here.

johnlong
Posts: 185
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong »

I did, but did not understand. Would you please explain why it is important to remove MessageDrivenBean from its implements clause.

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

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

Post by admin »

If a class says it implements MessageDrivenBean interface, then it would have to implement all its methods (otherwise declare the class abstract). The given class does not contain implementations for ejbRemove and setMessageDrivenContext and is neither declared abstract.
If you like our products and services, please help us by posting your review here.

johnlong
Posts: 185
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong »

I see, thank you for explanation.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest