*
The moose likes EJB and other Java EE Technologies and the fly likes How to make EJB exception stack traces show line numbers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to make EJB exception stack traces show line numbers?" Watch "How to make EJB exception stack traces show line numbers?" New topic
Author

How to make EJB exception stack traces show line numbers?

Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Hi,

I'm getting a RemoteException from a call to an EJB I've deployed on a weblogic server. It's wrapping a NullPointerException, but the stack trace only tells me (UnknownSource) instead of the line number for the bean method where the exception originates. All the weblogic class methods in the stack traces have line numbers. Is there anything I can do to show me the line number of the bean code that throws the exception?

Eduardo Dela Rosa
Greenhorn

Joined: Apr 15, 2004
Posts: 25
Hi,

Unknown Source appears in the stack trace of exceptions when the actual
Java code is compiled using the -g:none flag, as in


By default, debugging info is on unless you override that setting.

If you compile your Java source codes without that flag, you'd see the
line number corresponding to the code where the exception was thrown.

In other words, download the Sun JDK API source codes and recompile them
the normal way. You shouldn't have problem about the licensing since you
are not modifying anything in any of the codes.


HTH.


Eduardo dela Rosa<br />SCJP 1.4
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Thank you for the reply, Eduardo!

The "Unknown Source" actually shows up for the bean class that I wrote myself. I compiled it using ANT in the following way:



How could the way that Sun's API are compiled affect the way that my own classes show up in the stack trace?

Thank you,
Yuriy Zilbergleyt
 
 
subject: How to make EJB exception stack traces show line numbers?