File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RuntimeException treated as application exception

 
Dumitru Postoronca
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am calling an EJB that throws a RuntimeException which gets re-thrown exactly as is to the client.



The code outputs 'Exception in thread "main" java.lang.RuntimeException at ses.MyOtherSes.methodThrowsSystemEx(MyOtherSes.java:23)'.
I'm using jboss 5.1GA.

I don't have an ejb-jar.xml file and i haven't specified RuntimeException to be an application exception. I do NOT understand why it throws it as is instead of throwing an EJBException.

Thank you.
 
Joe carco
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that is rather strange, I tried that on Glassfish 3.1, a client with main method calling a remote SLSB that throws a RuntimeException in its business method. The client gets an EJBException ... caused by RemoteException
 
Dumitru Postoronca
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a new class & new client and this time I get the expected EJBException.
No idea what happened before.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic