Howto find out location from where class was loaded

Hi all.
Is there any way I can find out from which directory, jar or url a certain object/class was loaded?
Somewhere in the code the object is instantiated (class is loaded). E.g. like so:
SomeObject someObjectInstance = SomeObjectFactory.getInstance();
Can I use this object to find out from where in the file system it was loaded? E.g.
someObjectInstance.class.fooMethod() or
someObjectInstance.class.getClassLoader.barMethod()
Thanks for any help.
Joe

Usage is actually like so:
MyClass myInstance = (...)
myInstance.getClass().getResource("/package/MyClass.class") returns the url object, pointing to the class;
if you want a string instead, simply append toString():
myInstance.getClass().getResource("/package/MyClass.class").toString()

Similar Messages

  • I purchased Pages. But i can't find the icon or where it was loaded. I need to write a resume...

    I purchased Pages. But i can't find the icon or where it was loaded. I need to write a resume

    Did you purchase it from the iTunes Store or did you do the purchase from the App Store on the iPad?
    Go to Search, and type in Pages, if nothing shows your iPad hasn't downloaded it.
    Tap on App Store > Updates > Purchases, any sign of installation in progress? It is reasonably large so may take a while.
    Peter

  • Find out where class was loaded from

    Is there a way to find out from what resource the java runtime loaded a class from? I know that -verbose:class argument will tell where classes were loaded from during runtime for only normal sun libs (core libraries from rt.jar), but it does not say where it is loading external stuff from. Can this be found out?
    For example, if a particular third party class is available several times (through accidental redundancy in classpaths)-- find out which resource it was taken from.
    I am sure you could get down into the weeds and look thorugh all the classpath entries for which ones contain which classes-- but there has got to be a better way.

    import java.io.File;
    import java.net.JarURLConnection;
    import java.net.URL;
    import java.net.URLDecoder;
    private File getPathToClass(Class c)
         try
              URL url = getClass().getResource(c.getName() + ".class");
              if( url.getProtocol().equals("jar") )
                   JarURLConnection jarCon = (JarURLConnection)url.openConnection();
                   url = jarCon.getJarFileURL();
              File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
              return file;
         catch(Exception e)
              return null;
    }

  • How to find the class name, the location from where it invoked a method

    Hi,
    I have a class A. The caller calls A.someMethod(), whenever this method is invoked, I want to find out the caller info, which class invoked this method, from where this class was loaded (may be the jar file name). Any help will be appreciated.
    Thanks.

    However since version 1.4 there is an easier way to extract that information from the Throwable:
    java.lang.Throwable
    public StackTraceElement[] getStackTrace()
    Provides programmatic access to the stack trace information printed by printStackTrace(). Returns an array of stack trace elements, each representing one stack frame.

  • How do I find out what Package a class is in

    I am trying to find out what Package the classes XMLNode and XMLInterface are located in. Is there a way to search for a class to find out what package it is held in ?
    Quite often I see example code but spend wore time working out what package the class is in than actually writing code. Am I being really stupid ? (Don't answer that !!)
    Many thanks for any tips
    Dan

    you can find the class path by searching the $JAVA_TOP directory.
    Login to apps server.
    cd $JAVA_TOP
    find . -name "Classname.class"
    --Prasanna                                                                                                                                                                                                                                                                                                                   

  • Is there metadata of any kind on an export file that shows me the project file from where it was created?

    Is there any way in looking at the meta data of a .MOV exported from Final Cut 7 that allows me to see what the project file was? I have this exported file, but I can't locate the original project file from where it was from. Was hoping there would be some sort of data that exists that shows me the directory. I've searched by filename and date created all over my drives but no luck.

    Well, FCP comes from an age where it was assumed the editor had his $#%^ together.
    EDIT: One of my mentors had the conviction that every day when you left the cutting room, you should leave it in such a way that a perfect stranger could walk in in the morning and pick up right where you left off. I really strive to live up to that ideal. I know we all get crazy busy and don't always properly archive our stuff, but it DOES save a lot of headaches down the road.
    Message was edited by: Jim Cookman

  • Not able to find out the path where i need to place the .plx file on server

    I have to make some changes in the PLL (library) file and compile it into it's .plx file and move the .plx to the server.
    I am not able to find out the path where i need to place the .plx file on the server.
    I have placed it in /iasapp01/app_name/library,but it is not taking it into effect.
    Please help,if anyone knows about this,as to how to solve this issue
    Thanks
    GAG

    Hi Andreas,
    My Forms Version is 9.0.2 and the application server is 9iAS( 9.0.2)
    The variable FORMS90_PATH in the .env file has the following entries
    FORMS90_PATH=/iasapp01/app_name/fmx:/iasapp01/app_name/library:/iaspp01/app_name/html
    and i have placed the plx in the /iasapp01/app_name/fmx path,but somehow its not referencing it.
    My Formsweb.cfg has the following entry...
    [app_name]
    pagetitle=app_name_WEB
    serverapp=/app_name/app_name
    width=800
    height=550
    colorscheme=blue
    separateframe=true
    form=log.fmx
    otherparams=REPORT_PATH=/iasapp01/app_name/html/report_files/ FILE_PATH=/iasapp01/app_name/rep/
    WEB_PATH=http://server.com:7778/app_name/
    envfile=/ias01/app/oracle/product/ias_9.0.2/forms90/server/app_name.env
    I have another question which is ..Does applciation built on Forms 9.0.2 would work on Internet Explorer 8 and Windows 8 environment using Sun JRE.
    I was going through this website
    http://nutthaphon.blogspot.com/2009/05/how-do-jinitiator-and-jpi-parameters.html
    and followed the steps as mentioned,but it did not work for me.
    Can you help me if you have any info on this?
    Thanks
    GAG

  • How can I find out WHEN a specific iPhone was reported stolen?

    I bought a storage unit at auction.  There was a brand new iphone 4S, among other items, in the locker.  Many had receipts with the owner's name so I know it wasn't a storage unit full of stolen merchandise.  I ran a check of the iphone through a website, imei.info, and it seemed to come up clean (Verizon locked).  The Ebay buyer backed out of the auction and now, days later, is claiming the phone is stolen.  I'm thinking the buyer for some unknown reason, is the one who reported it stolen, just recently, and is trying to scam me.  When I called Verizon, they confirmed that this phone was either lost or stolen but could not tell me when it was reported.
    DOES ANYONE KNOW HOW I CAN FIND OUT THE DATE THE PHONE WAS REPORTED STOLEN, AND POSSIBLY WHO REPORTED IT STOLEN?
    Many Thanks!!!
    Anthony

    Buyer fraud has become a problem on eBay.
    I ran a check of the iphone through a website, imei.info, and it seemed to come up clean (Verizon locked). 
    It probably would have been better to contact Verizon directly, but if you kept records of that research, use it to dispute the buyer's subsequent claim. Unfortunately, eBay buyers hold all the cards these days, and eBay's robots will simply order you to accept a return or face suspension of your account and seizure of your PayPal assets.
    To dispute a SNAD may require that you obtain a court order to subpoena Verizon's record of the theft, which will entail an expense that will almost certainly exceed absorbing the loss.
    Ebay is a buyer's paradise. For sellers, not so much.

  • How do i find out what year my imac was made so i can upgrade?

    how do i find out what year my imac was made so i can upgrade?

    Go to the Apple then About this Mac then More Info then enter the Model Identifier Number in this search window:
    http://support.apple.com/specs/#imac

  • Is there any way to stop and resume update from where it was pause in iTunes?, is there any way to stop and resume update from where is was pause in itunes?

    Every time when I pause update process in iTune
    and when I try to resume update process, it start from begining.
    is there any way to re-start downloading update from where it was left in itune?

    No, it will start over, and you should try to never pause an update, let it finish if at all possible.

  • Can anybody please help me to find out the link where small co.

    can anybody please help me to find out the link where small companies implementing saps.

    Hi,
         SAP is providing a solution to Small Scale Industries with SMB (Small and Midsize Business) Product for various industries. It's a Pre configured SAP Solution pertaining to a specific industry(like Pharma, Oil..etc) with which the implementation as well as the cost will also decreases.
    Regards,
      Jayaram...

  • I got notification - Your Apple ID was used to sign in to FaceTime on an iPad 2 . It was not me - How do I find out who or what number was called?

    I got notification - Your Apple ID was used to sign in to FaceTime on an iPad 2 . It was not me - How do I find out who or what number was called?

    hi i was wondering about how can i set up my apple id min order to get notified via email when someone is using my aplle id to find my iphone?
    please help

  • Need to know how to find out when a friend request was sent?

    I really need to know how to find out when a friend request was sent. if anyone knows please tell me

    Btw.   The original purchase information on your app is available in your computer, in your iTunes account.
    Click apps and find the app you are looking for.
    Right click on the app and "get info"
    This will show when it was purchased and under what Apple ID.

  • How do I find out who is where?

    Is there a way on here to find out who is from where? Or maybe I should say how do I find people from places,such as Australia or the UK?

    I agree with the breech of privacy. Wouldn't it be much easier if you could just do what you wanted?
    GeoRSS is supported by Google maps now, if Eddy wants to use it again.
    I was thinking something a little less intense for an interface than Google Maps, although if you have it: flaunt it.
    A simple directory would be fine.

  • How to find out OrgUnit from the MSS team viewer iview

    Hi Experts,
    Please refer following link:
    https://wiki.sdn.sap.com/wiki/display/profile/HowtoreadinformationfromtheteamviewerinWeb+Dynpro
    Using this link, I am able to find out the perno.
    I have to find out OrgUnit of selected person. I did the mapping. I have also written following code:
    String orgunit = wdContext.currentSelectedOrgUnitElement().getObjid();
    wdComponentAPI.getMessageManager().reportSuccess("You have selected orgunit "+ orgunit);
    However, orgunit value is always null
    Can you please let me know how we can get the orgunit in this case?
    Regards,
    Gary

    Hi Gabriel,
    Requirement 1
    Thanks. I did so. Using this I can see the OrgUnit. However, this is the OrgUnit of MSS user. It remains same through out the program. It is unlike pernr which changes as the user clicks on different Employees.
    My exact requirement is as below:
    User will click on Employee Selection drop down box. After that he will select "Employees from Organizational Structure". Here organization structure will be displayed. Now the user will expand Org Structure. I want to know the Org Unit of different Organization as the user will go on expanding the Org Structure using the buttons
    Requirement 2
    User will click on Employee Selection drop down box. After that he will select "Employees from Organizational Unit". Now we can see the Go button. I have to write some code on the button. Where I can find the code for the button. I spent lot of time. I am not able to find out the exact place where the view for the button is located.
    Please help.
    Regards,
    Gary

Maybe you are looking for

  • How to do set apps context in java concurrent program

    Hi, Can any body help me in setting apps context in Java Concurrent program. I tried using AppsContext class and methods but did not work. Thanks for help in advance Pavan

  • Updates on Mac Pro Prevent Boot from SSD

    Hey there everyone, I recently upgraded my 2010 Mac Pro (Quad Core) to an SSD Drive using the OCZ Petrol Drive and I coudn't be happier. The system is super snappy and works great. That said, I downloaded the latest updates to my system last night an

  • How do you unlock an object in Fireworks CS5?

    Hi There, I locked a few objects but now I can't find an unlock command - how do you do this in Fireworks? Found a menu in the layers palate which did the trick - pretty cryptic though! Cheers Ben

  • Nokia's Billing Blacklist

    Hello, I post this message today, in the hopes that someone at Nokia decides that customer service is in some way important, and seeks to help resolve this issuses that I and others have undoubtedly hit. The way it has unfolded is as follows: Upon re

  • Failed Software Upgrade

    Have a customer that reports a 4402 controller that has no console access after a software upgrade from 4.2.99 to 4.2.176. They report they thought 4.2.176 went in ok but failed to read the configuration. So they loaded 4.2.112.0 ER.aes. The controll