Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

Is it possible for me to get the class file of dynamically generated proxy class?

Thread view: 
billdavidcn@gmail.com - 19 Aug 2007 11:45 GMT
I come to the proxy class when I am debugging my application, but I
can't get into it. Is is possible for me to get the class file of
dynamically generated proxy class so that I can decompile and dig into
it?

In my memory, we can write any class in classpath into a file. But I
forget how to do it.
Daniel Pitts - 19 Aug 2007 21:15 GMT
On Aug 19, 3:45 am, billdavi...@gmail.com wrote:
> I come to the proxy class when I am debugging my application, but I
> can't get into it. Is is possible for me to get the class file of
[quoted text clipped - 3 lines]
> In my memory, we can write any class in classpath into a file. But I
> forget how to do it.

Proxy classes are generated at runtime, and there really isn't much to
know about them.  They intercept all calls, and pass it to the
InvocationHandler to handle.  If your proxy class ultimately delegates
to another class, then set a breakpoint inside that other class.  If
you are trying to debug what happens after the call, before the
delegation, then set a breakpoint inside the InvocationHandler.
Twisted - 20 Aug 2007 04:05 GMT
> On Aug 19, 3:45 am, billdavi...@gmail.com wrote:
>
[quoted text clipped - 12 lines]
> you are trying to debug what happens after the call, before the
> delegation, then set a breakpoint inside the InvocationHandler.

If you can get ahold of an instance programmatically, you can use
getClass(), and then seriously reflective stuff (probably starting
with getting the ClassLoader), and wind up being able to access the
class binary representation as a byte array. Dump this to a file and
use javap.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.