Get a ClassLoader determined at runtime into the classpath

The class MyClass is dertermined at runtime and loaded from an URLClassLoader, which can not be in the original classpath.
An objectInputStream is deserializing classes from that type, but it throws an exception and can not resolve that class, because it isn't in the classpath.
Because the URLClassLoader is a JarFile, it is easy to iterate to them, but trying to do loadClass for each of them didn't enable the objectInputStream to recognize them.
Some ideas where to create bytestreams from my class and extend a classloader to load those, but is there no easier way to get a classloader into the classpath or a single class into the list of classes of the classpath?

I think that the main problem is that the ObjectInputStream cannot find the proper ClassLoader when deserializing.
I have never tried it, but I think what needs to be done is to set the ContextClassLoader property of the thread that is doing the deserialization.
Something like this:
ClassLoader cl = new URLClassLoader(....);
Thread t = Thread.currentThread();
t.setContextClassLoader(cl);
ObjectInputStream ois = new ObjectInputStream(....);
Object o = ois.readObject();
.

Similar Messages

  • Is there a way to stop the OS from switching to a newly opened app?  I would like to be able to continue what I'm doing while I wait for an app to launch and not get interrupted by a forced entry into the app.

    Is there a way to stop the OS from switching to a newly opened app?  I would like to be able to continue what I'm doing while I wait for an app to launch and not get interrupted by a forced entry into the app.
    As an example, I'm going to my email in safari, while I wait for it to load, I open an excel document, and the OS decides excel should be the front app, so I go back to safari so I can enter my login info, but halfway through my password the OS decides that excel is where I should finish typing my password.
    VERY ANNOYING.  Can I open apps in the background?

    Thank you everyone for the suggestions. J D, I'm not a terminal fan, but I'm sure it works.  I found a solution that I can use in the dock from another post. 
    Annoyed by Mac OS
    Works great and allows me to maximize those multitasking minutes.

  • I've been running Windows XP over bootcamp on an iMac for a few years now and I can't seem to get any sound from external devices into the machine. Any ideas?

    I've been running Windows XP over Bootcamp on iMac for a few years and I can't seem to get any sound from external devices into the machine. Any ideas?

    O.K. fgonoz98
    I would do 1 thing at a time:"now the micropohone is not working in facetime"
    Here is what you can check to get your mike working in facetime:
    1. Hold down option while you click on the speaker next to time a. date,
    under input Device see if your mic is marked. If not: ✔️
    2. Click the apple top left/System Prefs./click on the Sound speaker:
    under Input highlight microphone.
    3. When you have factime on go to video above scroll and see if your mic is marked ✔️
    If that does not get it to work there is more you can check:
    (Utilities/Audio, midi setup)
    For any other audio device you do this for input and output.
    If you get stock post back

  • I was an apple beta tester for iOS7 and now my iPhone 5 shut down, it's unresponsive it gets recognized by iTunes when plugged into the computer but that's it. Since I was a beta tester is there any way to fix my iPhone??

    I was an apple beta tester for iOS7 and now my iPhone 5 shut down, it's unresponsive it gets recognized by iTunes when plugged into the computer but that's it. Since I was a beta tester is there any way to fix my iPhone??

    Are you still running iOS 7 bet?. If so go to the private developer section for help. We cannot help you here with beta software.

  • If I have a movie on my mac on iTunes how do i get it off my computer and into the iCloud?

    f I have a movie on my mac on iTunes how do i get it off my computer and into the iCloud?

    You don't need to manually put iTunes Store purchases in the cloud. If that purchase can be stored there in your country, it's done so upon purchase. If not, it isn't possible.
    (84039)

  • HT1727 How do i get itunes to recognize music imported into the file structure?

    How do I get iTunes to recognize music imported into the file structure?

    Press Alt or Ctrl+B to reveal the menu bar if needed.
    Use File > Add Folder to Library if you just want to import it.
    If you're trying to relink broken entries in a library with the corresponding media then some more details would help.
    tt2

  • How do I get iTunes to accept FLAC files into the library?

    If I want to use iTunes to catalog FLAC files (but NOT play them...as I use my logitech Squeezebox fior that) how do I get iTunes to accept FLAC files into the library?

    As polydorus notes, iTunes has the huge shortcoming of not handling FLAC. 
    There are plugins that allow iTunes to play FLAC, but everything I've seen says they are problematic. 
    A much better approach is to get a 3rd party conversion program such as Switch and convert the FLAC files to an iTunes-compatible format such as  AAC or AIFF.
    Put the converted files in your iTunes library, and keep the original FLACs on hand for when you are using a more capable player.

  • HT1539 I purchased the Bu Ray/Digital Copy of "Voyage of the Dawn Treader" today at Best Buy, but when attempt to install the digital copy, I get a message about 3 minutes into the download that says that the download has been interrupted, and to check av

    I purchased the Bu Ray/Digital Copy of "Voyage of the Dawn Treader" today at Best Buy, but when attempt to install the digital copy, I get a message about 3 minutes into the download that says that the download has been interrupted, and to check available download in the store drop down menu in Itunes.  Nothing there!  The digital copy disc does not seem to play smoothly on my Imac, which may be the cause of the problem.  What do I need to do to download the digital copy to my computer/Itunes?
    Thank you, 
    Jonathan Mink

    I purchased the Bu Ray/Digital Copy of "Voyage of the Dawn Treader" today at Best Buy, but when attempt to install the digital copy, I get a message about 3 minutes into the download that says that the download has been interrupted, and to check available download in the store drop down menu in Itunes.  Nothing there!  The digital copy disc does not seem to play smoothly on my Imac, which may be the cause of the problem.  What do I need to do to download the digital copy to my computer/Itunes?
    Thank you, 
    Jonathan Mink

  • How can I get pdf files to minimize up into the upper left corner of my Windows 8.1 Pro screen?

    Hi -
    I have both a laptop and a desktop running Windows 8.1 Pro. When I open a pdf file on my laptop, and I click on the adobe reader icon in my taskbar at the bottom of the screen, the pdf doc is minimized up into the left hand corner of the screen where I can then right mouse click and insert the pdf file left or right of any other document I pull up onto my screen, i.e. I can create side by side windows of the two documents. But if I try the same thing on my desktop and then click on the adobe reader icon, it will not minimize up into the left hand corner. Does anyone now I can get my desktop to do what my laptop is doing since they are running the same OS?
    Thank you!

    This can be a bug on Mac.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • I have games that I bought in the App store prior to registering in the Game Center.  How do I get those games on my iPad into the game cenetr?

    I have games on my iPad that I bought in the App Store prior to registering in the Game Cenetr.  How can I get those games into the Game Cenetr?

    Have you tried downloading the shows via the purchased tab in the iTunes app? That is where you will be able to find previously purchased TV shows. Try in there, but take note.
    Note: Previously purchased TV shows are only available through iTunes in the Cloud in Australia, Canada, United Kingdom, and United States.
    You can read more here ....
    Downloading past purchases ....

  • XSLT for converting the determination server xml into the debugger xml

    I've seen this before but i can't find the post. I'm looking for an xsl or xslt document to convert a determination server xml payload request into something that can be imported into the debugger for analysis. It would be cool if the xml was constrained by the same xsd or dtd. Does anyone have a 10.3 xsl or xslt they could share? Or a past xsl?

    A while back I wrote some XSLT to convert SOAP request messages to the XDS format. I created a simple C# GUI to select the input SOAP and output XDS files. It was modelled on 10.1 schema though and I haven't adapted it yet for 10.2+. I will at some point though.
    I've found quickly being able to convert to the XDS format and debugging in the OPM rather than trawling through 1000's of lines of decision report a huge time saver.
    Evert

  • Why don't I get google results when typing keyword into the location bar?

    When typing keywords into the location bar, instead of taking me to Google I get a "problem loading page the connection was reset" error. And the domain it automatically takes me to is domainnotfound.Internetserviceprovider.net. Is there any way that if I don't type in a full url and just press enter it will give me the google results for those keywords? thank you for the assistance

    Sounds that your ISP is detecting whether a DNS look up fails in redirect you to that optimum.net url.
    In such a case you need to contact your ISP and ask them for alternative DNS servers that do not redirect you or you can set other DNS servers yourself.
    *http://kb.mozillazine.org/Error_loading_websites#DNS

  • Since updating ITunes sofwr some time ago, Used to be able to go to ,"File", "Get Info" and dragdrop my picture into the artwork box,click OK.No longer!Won't save/displayWHY?

    Since updating my Itunes software some time ago, I've not been able to add my own artwork,ie album covers, to my own personal albums.Used to be able to go to "File," "Get Info" and drag/drop my photo into the artwork box, hit save/OK and Voila! No longer and it's Really frustrating. It will let me drag it there but it
    won't save it or display it. (Why they go and break somethin' that was working fine?....just an aside) What must one do now to display their own artwork for albums that are non purchasable online?

    Winter 7 wrote:
    Thanks again. Though I'm not really tech savy, I don't believe this issue has to do with Tags.
    it has everyrhing to do with tags.
    The artwork is stoed in the Artwork tag field.
    Since WAV files do not have tags, there is no where to store the tags.
    If you use iTunes to get artwork for WAV files, it puts themn into the AlbumArt folder adn links it to the correct files via the iTunes library.itl file.
    All other formats (MP3, AAC, AIFF, Apple Lossless) have na artwork tag to store the artwork in the media file itself.
    in the past, to add my own personal artwork,
    Not to WAV files. You must have imported them as a different format.

  • How can I get all tracks from an album into the album in my library?

    When importing the albums from a folder, the tracks for some of the albums were split up.  How can I get them in one?

    Hello JudyD276
    The article below will give the steps to get the songs grouped together for you.
    Why aren't songs with the same album art grouped together?
    http://support.apple.com/kb/TS1468
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • How do I get old photos in an album into the Photo Stream?

    I just activated the iCloud, and I have the Photo Stream Upload/Download files working just fine between my PC and the iPad2 for pictures I put in right now. However, I was hoping to slide over an old album of photos into the Stream to my PC and there doesn't seem to be an option for that.
    Anyone have a tip?

    mads111 wrote:
    That's what I was doing but they just don't seem to show up at all. Even when I drop and drag them from the iPhoto into the stream.
    Is there a limit on how many photos can be in the stream at one time?
    yes definitely. 1000.  THe oldest are deleted. THis may be your problem.

Maybe you are looking for

  • Safari 4.1.1 opens but won't open a window or a tab

    Safari 4.1.1 opens quickly without a window. When you try to open a window nothing happens. When you try to open a tab, the tab briefly opens and then Safari crashes. Tried reinstalling Safari to no avail. Firefox operates with no problems, but I wan

  • CS4 files from pc not saving on Mac CS5

    I did some illustrations in CS4 (v11.0.2) on a PC and now the client is having a problem working with them in CS5 on his Mac. I did seven illustrations for a book our church is publishing. I provided the illustrations to the graphic designer who is u

  • Cannot restart core application after change for writeback

    Hi, I added the entry to enable writeback in the instanceconfig.xml for presentation services - coreapplication_obips1 but now find that coreapplication will not restart, ceteris parabus. The initial error seems to be 'Mbean operation failed' with la

  • HT5631 security questions - how to change them "for good"

    The process to change the security questions is extremely confusing. Your instructions on apple support are not complete. You suggest to click on a button to turn off a two-step verification but that button does not exist.

  • OSX will not run on my new Seagate 7200 rpm 160GB drive

    I tried 'restoring' to this drive as an external drive but this Macbook will not start up from it. I have been all over the internet and seen where people are using this drive as a replacement internal drive. I partitioned it as one partition and the