• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic