• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to make EJB exception stack traces show line numbers?

 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic