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;
}

Similar Messages

  • How to find out when data was deleted from table in oracle and Who deleted that

    HI Experts,
    Help me for below query:
    how to find out when data was deleted from table in oracle and Who deleted that ?
    I did that to fidn out some data from dba_tab_modifications, but I m not sure that what timestamp shows, wether it shows for update,insert or delete time ?
    SQL> select TABLE_OWNER,TABLE_NAME,INSERTS,UPDATES,DELETES,TIMESTAMP,DROP_SEGMENTS,TRUNCATED from dba_tab_modifications where TABLE_NAME='F9001';
    TABLE_OWNER                    TABLE_NAME                        INSERTS    UPDATES    DELETES     TIMESTAMP         DROP_SEGMENTS TRU
    PRODCTL                        F9001                                                     1683         46       2171            11-12-13 18:23:39             0                   NO
    Audit is enable in my enviroment?
    customer is facing the issue and data missing in the table and I told him that yes there is a delete at 11-12-13 18:23:39 in table after seeing the DELETS column and timestamp in dba_tab_modifications, but not sure I am right or not
    SQL> show parameter audit
    NAME                                 TYPE        VALUE
    audit_file_dest                      string      /oracle/admin/pbowe/adump
    audit_sys_operations                 boolean     TRUE
    audit_syslog_level                   string
    audit_trail                          string      DB, EXTENDED
    please help
    Thanks
    Sam

    LOGMiner --> Using LogMiner to Analyze Redo Log Files
    AUDIT --> Configuring and Administering Auditing

  • I lost my iphone4 is there anyway to track it if i didnt have "find my iphone" installed? anyway to find out where it was located last?

    I lost my iphone4 is there anyway to track it if i didnt have "find my iphone" installed? anyway to find out where it was located last?

    No.
    Sorry.

  • 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()

  • I've been getting harassing calls from "restricted"  There's no record of the call in recent or missed calls.  I'm told I can't block them but can I find out where they're originating from?

    I've been getting harassing calls from "restricted"  There's no record of the calls in recent calls or missed calls.  I'm told I can't block these calls.  Is there any way I can find out who is making them?

    There's a fee based service called Trap Call which can give you information about the caller.

  • How to find out, where the iphone is from?

    I bought an iphone from a friend and its locked. i want to know about its details, like when and where it is bought.

    Try asking your friend.

  • TS3376 Can I find out where my iphone was located from? I think my account was hacked and my position was located..

    Got an alert on my phone that said "find my iphone alert" and it started beeping. I changed my password and I think Im ok now, but can I find out where I was located from?

    BrandinGNJ wrote:
    Yea your right, and thank you. A way to see where it came from would be a useful feature..
    But that might allow a thief (who may now have seen your diary) to locate your place of residence.

  • HT201365 my iPad was stolen and I just got a message that it was turned on and now locked and my message posted. How do I find out where that happened? it's now off again but I'd like to know the location of where find my iPad occurred!

    I have had email notification that my ipad that was stolen was turned on and connected to the internet however no other info was avail about where the unit was turned on to help me find a location of where it is. It is now off again. The site has no info on how to find data on where it was turned on. I've received emails saying it's now locked and message displayed. There myt be a way to find out where it was turned on!
    Any ideas!

    Unless the device has power and an internet connection there is no way to locate it.

  • Is there a way to find out where iMessages are being sent from? I've received messages from an unknown email that are offensive and considered to be harassment.

    Is there a way to find out where iMessages are coming from? I've contacted security personnel at my school and I'm brig harassed. I just want it to stop.

    '''Here is an update to my former response.'''
    Here is a safe way to look at an email which you think is suspicious:
    * right click on the message and select 'Save As'
    * the file name will be the email subject followed by an extension of .eml
    * store it in a folder you can find easily, such as your Documents
    * using your file explorer, right click on the file name and open it with Notepad or a similar text editor (NOT Thunderbird!)
    * even though the format is not easy to read, you should be able to see who sent it to you, and also read the message text.
    Since you are looking at the message in a text editor, there is no chance a link can activate something bad. I have used this method many times, and have found several spoofs of email names of my friends.

  • Find where Actionscript class is loaded from

    Hi folks,
              Is there anyway to tell where an actionscript class is loaded from (i.e. what swf file) at runtime? I've had a look at some of the reflection api's and some of the sample code but none seem to address this. I'm originally a Java developer and this is a fairly straightforward call. For any java developers who may be viewing this if I may I'll put in the java for which I'm looking for the equivalent actionscript if possible.
    Thread.currentThread().getContextClassLoader().getResource("java/lang/String.class").getPa th();
    This will give me the location jar/folder path from where the String class is loaded for the particular thread.
    Any help would be greatly appreciated,
    Mark.

    No official API, but there is a getSWFRoot on SystemManager that might help.

  • How do I activate AUTOMATIC superscripting for numbers / dates; e.g. 1st, 2nd, 3rd, 4th, etc .... It used to do this in all PRE-5.0 versions of Pages; now, it is GONE from Pages 5.0, and I cannot find out where / how to activate it !!

    How do I activate AUTOMATIC superscripting for numbers / dates; e.g. 1st, 2nd, 3rd, 4th, etc .... It used to do this in all PRE-5.0 versions of Pages; now, it is GONE from Pages 5.0, and I cannot find out where / how to activate it !!

    Whilst I appreciate your responding - I do not think this helps with what I was enquiring (at least not without further explanations anyways).
    I am aware of, and do use, the function - System Preferences > Keyboard > Text - for various replacements like (tm), (c), etc .... and also for fractions like 1/2, 1/4, 1/3.
    However, my question was in relation to SUPERSCRIPTS for dates / numbers - namely, superscripting numerical suffixes for things like 1st, 2nd, 3rd, 4th,
    So - please help - HOW do I set this up ? If indeed it is possible without System Preferences > Keyboard > Text ???

  • Where do Pipeline Component classes get loaded from?

    Can someone please point me to some documentation that describes where my Pipeline
    Component classes get loaded from?
    I have just wasted hours on this - to find that they are not loaded from WEB-INF/classes
    - but instead they must be available to the EJB classloader. The sampleportal
    is completely misleading in putting the classes in WEB-INF/classes - because they
    are in fact loaded from the sampleportal EJB jar!
    Did I miss something obvious?
    regards,
    Nick

    Nick
    Refer to this portal doc on dev2dev
    ftp://edownload:[email protected]/pub/downloads/webflow.doc
    -tulan
    "Nick Minutello" <[email protected]> wrote
    in message news:[email protected]..
    >
    >
    Can someone please point me to some documentation that describes where myPipeline
    Component classes get loaded from?
    I have just wasted hours on this - to find that they are not loaded fromWEB-INF/classes
    - but instead they must be available to the EJB classloader. Thesampleportal
    is completely misleading in putting the classes in WEB-INF/classes -because they
    are in fact loaded from the sampleportal EJB jar!
    Did I miss something obvious?
    regards,
    Nick

  • 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

  • HT5085 I ordered a TV series-I can see where the $$ was taken from our account but I can't find the series anywhere on my iTunes account??

    ordered a TV series…I can see where the $$ was taken from our account but I can't find the shows anywhere in our itunes account.

    Hello NMS1,
    It sounds like you are unable find these TV shows you purchased in a series, but you have been charged for them. I would start by checking to see if you can download them from your Purchases in the iTunes Store with this article:
    Download past purchases
    http://support.apple.com/kb/ht2519
    The steps are different if you are on an iOS device vs. a computer, so choose the appropriate section for the device you want to download them to.
    If you cannot find it in your Purchases, I would next reach out to the iTunes Store support team for additional assistance:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBooks Store purchase
    http://support.apple.com/kb/ht1933
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • Find out where an iPhone 3G was bought by his serial

    Hi everybody,
    Is there anyway to find out where an iPhone 3G was bought, by his serial #? The serial number is 86827HMQY7H
    Thanks!

    Your only hope is if AppleCare(if there is an AppleCare in Spain) can tell you. You could try calling them & give them the phone's IMEI number. Otherwise, you'll just have to try sims from Movistar, Orange or Vodafone. Good luck.

Maybe you are looking for

  • Help for first install of macpro with osx server

    Hello to all it's my first message on this forum, i'm seeking for help because i'm kind of new with Mac systems. I'm gonna explain the problem So we are going to buy a mac pro and put 4*2To inside with raid 5 and osx server. The problem is that the c

  • I have about had it with AppleCare and my PB....

    After an unfortunate dropping incident this past July my computer appeared to be "dead" the following month in August. (My warranty expired the previous April). I took it into my Apple store in Orlando and they told me it was either my logic board or

  • Input Ready Query, Variable read mode setting Only Values for InfoProvider

    Hi, I have a problem with Selection Variable for a BEx Query : - I'm working with SAP BI 7.0 support package 15 - My query is an input ready query built for an "aggregation level" based on "real time infocube" (Planning); - Characteristic, I want to

  • Trigger badi after giving data in custom tab of po item

    Hi, We have added custom tab in po item level, now we want to make those fields manditory for specific document type.We are using badi ME_PROCESS_PO_CUST . The message is getting triggered initially , but after giving data in the custom fields the ba

  • How to disable multiple select option in OO ALV.?

    I want to display an ALV with the multiple select button disabled.I want the "select" button at the start of each row but  the "select all/deselect all" button at the right hand top corner of the display be disabled. Please help me out.