About Question enthuware.oce-ejbd.v6.2.454 :
Moderators: Site Manager, fjwalraven
-
- Posts: 54
- Joined: Tue Apr 19, 2011 10:32 am
- Contact:
About Question enthuware.oce-ejbd.v6.2.454 :
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.
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.454 :
You are right. This has been updated.
Thanks for the suggestion!
Thanks for the suggestion!
-
- Posts: 16
- Joined: Sun Aug 04, 2013 9:54 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.454 :
Hi would this be valid as a correct answer?
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
Code: Select all
@ApplicationException
public class MyException extends EJBException
Since EJBException extends RuntimeException, I believe this is valid. Please correct me if I'm wrong.
Thanks,
Kenneth
-
- Posts: 26
- Joined: Fri Jul 06, 2012 1:08 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.454 :
Yes, it is valid
For example
http://en.wikipedia.org/wiki/Is-a#Java
http://www.tutorialspoint.com/java/java_inheritance.htm
J
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.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.
For example
http://en.wikipedia.org/wiki/Is-a#Java
http://www.tutorialspoint.com/java/java_inheritance.htm
J
-
- Posts: 16
- Joined: Sun Aug 04, 2013 9:54 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.454 :
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.
-
- Posts: 26
- Joined: Fri Jul 06, 2012 1:08 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.454 :
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
J
-
- Posts: 16
- Joined: Sun Aug 04, 2013 9:54 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.454 :
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.
EJBException IS-A RuntimeException, therefore that's(my code snippet above) still an application exception which is a runtime exception.
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.454 :
You are right. EJBException should also be a valid choice. It has now been added as a valid choice.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 10 guests