Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CreateException/EJBException :/

 
Dominik Ratajski
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i'm trying to throw a message with a meaningful message in the above code.

it appears like it's nesting my exception in a InvocationTargetException in a CreateException in a EJBException:

output from e.getMessage() = nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.lang.reflect.InvocationTargetException

output from e.getCausedByException().getMessage() = nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.lang.reflect.InvocationTargetException

why doesn't this print out "my message" to console? i get a stack trace and message that doesn't mention "my message" at all.

Cheers.

DSR
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like something your EJB container does specifically. For stateless session beans, your container's the only one to care if it gets created, so it's not like anybody else (except you) is going to see that message anyways. I suppose you could try specializing CreateException and override its toString method -- but that's alot of work just for a stack trace.
 
Dominik Ratajski
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

It does look that way - incidentally this is on Sun ONE Application Server 7.0

I'll output to log a message along with the throw.

DSR
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!