• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

CreateException/EJBException :/  RSS feed

 
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
 
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!