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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
deadlock_gr
Posts: 54
Joined: Tue Apr 19, 2011 10:32 am
Contact:

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

Post by deadlock_gr »

This is not an error, but a minor suggestion. The dialog says to create a valid EJB 3.0 exception. I would change that to EJB 3.x, but this is personal taste.

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

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

Post by admin »

You are right. This has been updated.

Thanks for the suggestion!

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

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

Post by kdmandawe »

Hi would this be valid as a correct answer?

Code: Select all

@ApplicationException
public class MyException extends EJBException
Take note I'm using EJBException instead of RuntimeException.
Since EJBException extends RuntimeException, I believe this is valid. Please correct me if I'm wrong.

Thanks,
Kenneth

kezman9
Posts: 26
Joined: Fri Jul 06, 2012 1:08 am
Contact:

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

Post by kezman9 »

Yes, it is valid
A system exception is an exception that is a java.rmi.RemoteException (or one of its subclasses) or a RuntimeException that is not an application exception.
EJBException is a RuntimeException so you can annotate it with @ApplicationException. In Java langauge it is called "is a" relationship. The other one is "has a" one.

For example
http://en.wikipedia.org/wiki/Is-a#Java
http://www.tutorialspoint.com/java/java_inheritance.htm

J

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

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

Post by kdmandawe »

If that's valid, then that's another alternative to the DnD question. Just to clarify since there is also 'EJBException' among the choices. It was not indicated there that there are more than one correct answers.

kezman9
Posts: 26
Joined: Fri Jul 06, 2012 1:08 am
Contact:

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

Post by kezman9 »

Yes, it seems like it is valid option. But for me annotating EJBException as application exceptions looks awkward at least;-) I'm curious what Paul thinks about it.

J

kdmandawe
Posts: 16
Joined: Sun Aug 04, 2013 9:54 am
Contact:

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

Post by kdmandawe »

The DnD question says: "Create a valid EJB 3.x application exception that is a runtime exception."

EJBException IS-A RuntimeException, therefore that's(my code snippet above) still an application exception which is a runtime exception.

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

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

Post by admin »

You are right. EJBException should also be a valid choice. It has now been added as a valid choice.

thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests