Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

difference between system exception and application exception  RSS feed

 
rajareddy annavaarm
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any body tell difference between system exception and application exceptions in EJB?
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System is one that the container or JVM throws, whereas Application Exception are exceptions that you throw directly in your code. Basically your own made up exceptions, but not limited completely to that.

Mark
 
Mahesh Desai
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any exception that is a subclass of Exception, but not a subclass of RuntimeException and RemoteException, is an application exception. All the application exceptions are checked exceptions, So, when we call another method in our method that can throw an application exception, we must either declare it in the throws clause of the calling method or catch it in the body of the calling method or both.

All system exceptions are unchecked exceptions except RemoteExceptions and it can't be handled by the user.



Thanks,
Mahesh

----------
SCJP 1.4 | SCWCD 1.4 | SCBCD 1.3 | SCEA Part I - In Progress
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!