Dynamic loading of a class at runtime with known inheritance

Hi,
I am trying to dynamically load a class during runtime where I know that the class implements a particular interface 'AInterface'. Also, this class may be linked to other classes in the same package as that class, with their implementations/extensions given in their particular definitions.
The class is found by using a JFileChooser to select the class that implements 'AInterface', and loaded up.
Because the name of the class can be practically anything, my current approach only works for certain classes under the package 'Foo' with classname 'Bar'. Some names have been changed to keep it abstract.
private AInterface loadAInterface(URL url) throws Exception {
     URL[] urls = { url };
     // Create a new class loader with the directory
     URLClassLoader cl = new URLClassLoader(urls);
     // Load in the class
     Class<?> cls = cl.loadClass("Foo.Bar");
     return (AInterface) cls.newInstance();
}As you can see, all that is being returned is the interface of the class so that the interface methods can be accessed. My problem is that I don't know what the class or package is called, I just know that the class implements AInterface. Also note that with this approach, the class itself isn't selected in the JFileChooser, rather the folder containing Foo/Bar.class is.

ejp wrote:
The class is found by using a JFileChooser to select the class that implements 'AInterface', and loaded up.
Also note that with this approach, the class itself isn't selected in the JFileChooser, rather the folder containing Foo/Bar.class is.These two statements are mutually contradictory...My apologies, I worded that wrong. My current approach (the one given in the code) selects the root package folder. However, what I want to be able to do, is to simply select a single class file. The current code just makes some assumptions so that I can at least see results in the program.
As you said, if the root of the package hierarchy is known, then this could be achieved. The problem is that the user either selects the package root or the AInterface class, but not both.
Is there a way to get package details from a .class file to be used in the actual loading of the class?

Similar Messages

  • How to dynamically load static (inner) class

    I have an urgnent question, any comments would be appricated.
    I have a static inner class definition.
    Class myObject
    public static class innerObject
    I want to dynamically load the static innerObject class such as
    Class c = Class.forName ( "myObject.innerObject" );
    innerObject t = ( innerObject ) c.newInstance();
    I can't do this as it give me ClassNotFound Exception, Do I need to load myObject first? any comments?
    The other alternative is that to define my myObject as having a static variable referencing the static class.
    Class myObject
    staic innerObject m_inner = new innerObject();
    public static class innerObject
    Is there any option in java allowing me to load a static variable?
    Many thanks
    Jay

    I can't do this as it give me ClassNotFound Exception,Use "myObject$innerObject" instead of "myObject.innerObject".
    Is there any option in java allowing me to load a
    static variable?What do you mean by that?

  • Help on dynamically loading of simple classes - ClassLoader

    Hello,
    does somebody know how to load simple classes with java.lang.ClassLoader in a stateless session bean running on SneakPreview 6.40?
    i found many solutions for j2ee servers on the net but no one works. i always get a ClassNotFoundException but i can read the class file to a byte array.
    this is one way i tried to solve the problem:
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    Class aClass = Class.forName(strClassName, true, loader);
    hopefully someone can help me,
    thanks
    erich

    Hi Erich,
    for such a kind of problems (not knowing for sure where the classloader is looking for the class) I am used to use http://www.sysinternals.com/ntw2k/source/filemon.shtml
    Just write <i>Class.forName("ABC123", true, loader);</i> and then you can check the places where the classloader is looking for this ABC123 class...
    Hope it helps
    Detlev

  • Dynamically Loading VI using DLL

    Hi all,
    In Labview, I have made a GUI and a library for interfacing to a device. I have compiled this to an .exe and it all work well.
    I haved compiled these exposed VIs into a DLL using LV2012 and written a small C++ program that is linked to my DLL. The problem I am having is that when I run my "begin" function (it calls some dynamically loaded VIs), I get Error 7 Path not found. Now, I imagine that this is something to do with either me not including the dynamic VIs when I compile the DLL (which I am sure I have done) or, the paths somehow being changed. When I load my VI, I use a relative path constant e.g. "UserCommands\Device1\Device1CommandFactory.vi" that gets converted to an absolute path.
    What do I need to do in order to get the DLL to load the VI properly?
    Thanks in advance

    I'm not trying to load a front panel VI dynamically. I load a "server" vi that interfaces with the device. I also dynamically load my device class. I do this because, the DLL should be able to interface with 2 different devices.
    I've added the error source as an output of my begin vi and I can see that the error occurs when trying to load my device class. It's in german sorry
    Get LV Class Default Value.vi<APPEND>
    <b>Vollstõndige Aufrufkette:</b>
         Get LV Class Default Value.vi
         myDevice_Interface.lvlib:LoadDeviceFromAbsolutePath.vi
         myDevice_Interface.lvlib:LoadDevice.vi
         myDevice_Interface.lvlib:begin.vi
         myDevice_Interface.lvlib:begin.vi.ProxyCaller
    <b>Klasse wurde versucht, hier zu laden:</b>
    C:\Users\myname\Desktop\myDevice_Interface_DLL_Example\myDeviceInterface.dll\myDevice Interface\Devices\myDevice1\myDevice1.lvclass
    I have included the class in the source data tab when I compile the DLL. I do specify the path to find the class as Devices\myDevice1\myDevice1.lvclass. Where should it be looking?

  • How do I dynamically load a SWF that was compiled from an Fla with a linked external class file

    I am dynamically loading external SWFs in a Main Fla in response to clicks on a menu.
    The loading code is standard and works fine for all of the SWFs except one. When I try to load it I get the following error:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
    I am certain that the URL to the problem SWF is correct. The SWF itself doesn't load any other SWFs or images.
    The problem SWF is linked to an external class file and compiled with it.
    i.e. in the properties panel of the main timeline of the problem SWF's Fla I have entered the path to the external class.
    1. there is no problem compiling this SWF with the class (it works fine by itself)
    2. if I remove the external class from the properties panel and don't use it the resulting SWF imports without a problem into the Main Fla mentioned before
    So the problem seems to be the fact that the external class is linked in the properties panel. Is this a path problem?
    Would appreciate any suggestions,
    Thanks!

    despite what you say, that loaded swf most likely is loading something and that's the cause of the error.
    you could test that by putting the main swf's embedding html file in the same directory with problematic swf.  if the problem is as explained above, you'll have no problem when the main html is in the same directory with the loaded swf.

  • What is the workflow to compile and load an external class as a runtime library?

    I have a set of classes (with some large embeds) that I only want to load one by one at runtime as needed.
    I think that I need to compile each of these classes into a separate SWF and use one of the available loaders out there to load and link to them dynamically at runtime (am I on track so far?).
    I got a little mixed up in the details though, so I'd just like someone to give me the basic rundown on doing this, get the right termonology, and if you have any reference to the right tutorial on doing it, all the better!
    I'm using flex builder, and this is to be used in a flex application.
    Thanks!
    David

    Hi, thanks for the response!
    A couple of questions arise:
    1) If I use this approach am I correct in my understanding that all classes referenced by my library will be compiled into the final SWF? That will create a lot of duplicated classes since those classes are already being used and loaded in the main SWF. Is there a way to avoid this duplication problem?
    2) In trying to play with this approach I ran into a problem. When I create the SWF it fails to find a class Vector ("Type was not found or was not a compile-time constant: Vector"), I think I understand that this is because I am targeting flash player 9, but the code I am using require 10. I can't seem to find an option to change the target in a flex library project as I can in a regular actionscript or MXML project.
    Dave

  • Spry Tabbed panels + Progressive Enhancement and Dynamic Loading of Content With Spry

    Is there any way to combine tabbed panels together with "Progressive Enhancement and Dynamic Loading of Content With Spry"?
    Visit: http://labs.adobe.com/technologies/spry/articles/best_practices/progressive_enhancement.ht ml#updatecontent
    And click on the "Using Spry.Utils.updateContent()"
    The 3rd example shows how to use a fade transition whenever the content changes.
    I already have tabbed panels. My menu contains buttons (on tabs) and my Content div contains the panels.
    Tabs code;
    <ul class="TabbedPanelsTabGroup">
              <li class="TabbedPanelsTab">
                   <table class="Button"  >
                        <tr>
                        <td style="padding-right:0px" title ="Home">
                        <a href="javascript:TabbedPanels1.showPanel(1);" title="Home" style="background-image:url(/Buttons/Home.png);width:172px;height:75px;display:block;"><br/></a>
                        </td>
                        </tr>
                   </table>
              </li>
    etc
    etc
    etc
    and the panel code:
    <div class="TabbedPanelsContent" id="Home">
         CONTENT
    </div>
    I hoped i can use the example code from the link into my tabbed panels.
    I thought this code:
    onclick="FadeAndUpdateContent('event', 'data/AquoThonFrag.html'); return false;"
    could be added to the tab code like this:
    <a href="javascript:TabbedPanels1.showPanel(1);" onclick="FadeAndUpdateContent('event', 'data/AquoThonFrag.html'); return false;" title="Home" style="background-image:url(/Buttons/Home.png);width:172px;height:75px;display:block;"><br/></a>
    But the content doesnt fade...
    I know i need to change the header etc.
    The following is from the link:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Aquo Events</title>
    <script src="../../../includes/SpryEffects.js" type="text/javascript"></script>
    <script src="../../../includes/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    function FadeAndUpdateContent(ele, url)
    try {
         Spry.Effect.DoFade(ele,{ duration: 500, from: 100, to: 0, finish: function() {
              Spry.Utils.updateContent(ele, url, function() {
                        Spry.Effect.DoFade(ele,{ duration: 500, from: 0, to: 100 });
    }catch(e){ alert(e); }
    -->
    </script>
    <style type="text/css">
    /* IE HACK to prevent bad rendering when fading. */
    #event { background-color: white; }
    </style>
    </head>
    So i changed my header etc, put the SpryEffects.js and SpryData.js into position and nothing changed...
    Is there a way to keep my tabbed panel (or change as less as possible) and let
    A. The fade work
    B. The loading work.
    The problem now is that it loads all pages instead of only the home. Therefore i wanted this Progressive Enhancement.
    And the fading part is just because its nice...

    It doesnt show in the post but off course i changed this link;
    "data/AquoThonFrag.html"
    into;
    "javascript:TabbedPanels1.showPanel(1);"
    I must say i dont know if this even works...

  • How to load all the classes in a JAR file at runtime?

    Any clues o:
    "How can I force JVM to load all the classes in a specified JAR at once?"
    Thanx!
    -Rajeev

    Well I was thinking may be there exists an option with "java", when I
    am starting an application from a jar file, I could force it to load all
    the classes in the JAR. I don't want to do it programically. Is there such
    an option available?? Or in other words can I ask JVM to not do the dynamic
    loading for the JAR??
    Thanx.
    List all JarEntries and convert the paths to fully
    qualified class files
    e.g file in jar
    [1] /com/mycompany/proj/X.class
    should become
    [2] com.mycompany.proj.X
    then for each entry issue
    Class.forName( [2] );

  • How to load a specific set of classes at runtime.

    Howdy!
    I want to load all the classes in a directory that implement a specific Interface, at runtime. Of course i can load all the classes if i know the String name.
    Class t = Class.forName(ruleClass);
         cnst = t.getConstructor( new Class[] { Session.class } );
         try {
             Object obj = cnst.newInstance(new Object[] {            
                                              m_fwkSession });
             IRules rule = (IRules)obj;
                ...................where IRule is an interface.
    How do i get all the files in that directory and find the classes implementing that interfaces ?

    You can either load all the classes and then test if they are assignable from IRule.class (isAssignableFrom())
    (you could use a custom classloader if you wanted these classes to be garbage collected)
    or
    Open the class files and scan them to see if they contain
    "myPackage/IRule"
    (maybe you would have to parse the .class file, but just scanning it might be good enough)

  • Dynamic creation of class at runtime

    I need to be able to dynamically create an instance of a
    class that isn't known until runtime - actually based on the
    filename
    so in my fla:
    var className:String="Test"; /* code to get a class name
    derived from the filename */
    var obj = new [className]();
    trace(obj);
    the code above only works if i put the literal directly in [
    like so:
    var obj = new ["Test"]();
    is there a way to do this???
    Any help much appreciated
    cheers Steve

    This might help you out:
    http://dynamicflash.com/2005/03/class-finder/
    "steveanson" <[email protected]> wrote in
    message
    news:e3fcnv$6c7$[email protected]..
    > I need to be able to dynamically create an instance of a
    class that isn't
    known
    > until runtime - actually based on the filename
    >
    > so in my fla:
    > var className:String="Test"; /* code to get a class name
    derived from
    the
    > filename */
    > var obj = new ();
    > trace(obj);
    >
    > the code above only works if i put the literal directly
    in
    > like so:
    > var obj = new ();
    >
    > is there a way to do this???
    > Any help much appreciated
    > cheers Steve
    >
    >
    >

  • Dynamically loading a class that is part of a larger loaded package

    I am dynamically loading a class that is part of a large package, much of which is loaded at startup. The code directly references protected variables in the parts of the package that is loaded by the default class loader. Attempting to access these protected variables gives an access error when the class is dynamically loaded that doesnt occur when the class is loaded at startup.
    Is there a way to make this work?

    To answer my own question -- no
    A reference from http://access1.sun.com/techarticles/DR-article.html says:
    The use of Dynamic Class Reloading can introduce problems when classes that are being dynamically reloaded make calls to non-public methods of helper classes that are in the same package. Such calls are likely to cause a java.lang.IllegalAccesserror to be thrown. This is because a class that is dynamically reloaded is loaded by a different classloader than the one used to load the helper classes. Classes that appear to be in the same package are effectively in different packages when loaded by different classloaders. If class com.myapp.MyServlet is loaded by one classloader and an instance of it tries to call a non-public method of an instance of class com.myapp.Helper loaded by a different classloader, the call will fail because the two classes are in different packages.
    So not being able to access non-private variables in this scenario is the way it works.

  • Remote debugging an executable with dynamically loaded subpanel VIs

    All,
    A colleague of mine is attempting to perform remote debugging of an executable he has inherited. It includes subpanels that show dynamically loaded VIs. When connecting with the remote debugger, the main executable shows fine, but the dynamically loaded VIs are not showing their front panels. They appear ok on the remote PC where the executable is running, but they don't appear on his laptop from where he is running the debugger.
    I don't have access to LabVIEW currently, and he cannot get this to work, so I thought I'd ask the community this generic question:
    "Is it possible to remotely debug a LabVIEW executable with subpanels that show dynamically loaded subVIs?"
    Technically he can see and probe the block diagram of the main executable, but the subpanels are blank where the dynamcally loaded subVI front panel should show, making it impossible to interact with the program.
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

    Thanks Josh. Does this issue have a CAR number I can tag?
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • Problems with the dynamic loader... And well... I SERIOUSLY messed up.

    So you might call me an idiot.  Go ahead... I deserve it.
    I was in the process of updating my netbook over SSH because I left it back home when I went to school.  I ended up running into problems with glibc etc...  So I did something that I seriously regret...
    I executed the command...
    mv /lib/* /usr/lib*
    This has to be the most retarded thing I have ever done ever... Like I'm not even shitting you.
    To make things worse... I don't have busybox and have no method of getting busybox onto the computer.
    Now I have seen about using the dynamic loader "ld-linux.so.2" to execute programs using a user defined library path.  So I thought perfect, I can do this.  The problem is... I can't find it.  I looked on two healthy Arch machines at the locations and names.  I used that to try this.  I am sure at least I have a recent version of glibc installed (<current version>-1 I believe).  But I still cannot find this at all.  I am logged in as root over SSH but it fails to log in again on another session.  So I have one session to work with it I can work it at all.
    Do you have any suggestions to fix this?  If not, I can always have someone tomorrow dd a copy of an arch iso tomorrow and possibly fix everything... But I would really like this fixed without all of that... Thanks...

    See these two threads.

  • Alpha transparency borders on dynamically loaded images for use with textures

    Hi there folks. Well, I have been beating my head over this
    and am hoping one of you can help me out.
    Essentially I have 16bit images that are loaded into my
    shockwave application at run-time. These images are user defined
    which means that I will not know their size ahead of time. Once the
    images are loaded I then create textures and apply them to various
    shaders. Ok, all of this works just fine. What I need to do though
    is create an alpha transparent border around the images, so when I
    apply them to their surfaces I only see the image and nothing
    around it. I am doing this because these images will only appear at
    specific parts on a surface, textureRepeat will be false, and many
    models will be stacked in the same exact location using the same
    model resource. I have everything working, but I cannot figure out
    the alpha part for the life of me. Also, when I test the alpha
    based image by itself it works just fine. It is not until I try and
    combine the 16bit (converted to 32bit at run-time) image that I run
    into problems.
    I have tried:
    - Creating a 32bit alpha image in Fireworks with a
    transparent border and a black rect for the inside. I then copy the
    dynamic image over the alpha image (only after going from 16bit to
    32bit in imaging Lingo) and leave a little room at the edges for
    the transparency. Well, I get a crazy amount of streaks here even
    when I try to up the trans border by around 24 pixels on each side.
    - Using another similiar alpha based image as a mask with
    copyPixels and extractAlpha/setAlpha like this... (code is a little
    rough here)
    newImage = new(#bitmap)
    newImage.name = "place_Test"
    newImage.image = member("place").image
    newAlpha = new(#bitmap)
    newAlpha.name = "AHH"
    newAlpha.image = image(newImage.image.width + 24,
    newImage.image.height + 24, 32)
    newAlpha.image.useAlpha = true
    newAlpha.image.copyPixels(member("vase").image,
    newAlpha.image.rect, member("vase").image.rect)
    newAlphaInfo = newAlpha.image.extractAlpha()
    newAlpha.image.useAlpha = false
    --reverse dark to light
    iAlphaReverse = image(newAlpha.image.width,
    newAlpha.image.height, 8, #grayscale)
    iAlphaReverse.fill(iAlphaReverse.rect, rgb(0,0,0))
    iAlphaReverse.copyPixels(newAlphaInfo, iAlphaReverse.rect,
    newAlphaInfo.rect, [#ink : #reverse])
    --newAlphaInfo.copyPixels(iAlphaReverse, newAlphaInfo.rect,
    iAlphaReverse.rect, [#ink:#subtractpin])
    newAlphaMask = iAlphaReverse.createMask()
    rescaleAbs(newImage, newImage.image.width,
    newImage.image.height, "place_Test", 32)
    destImage = member("place_Test").image.duplicate()
    destImage.fill(destImage.rect, rgb(0,0,0))
    newAlpha.image.useAlpha = false
    destImage.copyPixels(newImage.image, newImage.image.rect,
    newImage.image.rect, [#maskImage:newAlphaMask, #ink:#add])
    destImage.setAlpha(iAlphaReverse)
    destImage.useAlpha = true
    member("place_Test").image = destImage
    I apologize for the messy code. I have cut and pasted from
    all over the place and am getting confused. In any case, I think I
    am making this harder then it needs to be and hope someone can
    help.
    Thank you in advance,
    Dave

    Hi, you can try using other texture layer as mask on the same
    shader. As usually you create the texture from a dynamic loaded
    image, then apply this texture to the shader on the texture list
    index 1 (textureList[1]). Next part does the job, create other
    texture from a 32 bits image with the alpha information and fill
    all pixels with white color, this is very important because the
    second texture layer will be multiply with the first texture layer.
    This texture set its render format to rgba8888. Apply the mask
    texture to the same shader at texture list index 2, verify that the
    blendFunctionList index 2 is #multiply.
    I include the code of a project that use this masking
    approach:
    property pMember
    property pEarthSphere
    property pNightSphere
    property pLastTransform
    on beginSprite me
    pMember = sprite(me.spriteNum).member
    me.setupWorld()
    end
    on setupWorld(me)
    pMember.resetWorld()
    repeat with i = pMember.light.count down to 1
    pMember.deletelight(i)
    end repeat
    vEarthModelResource = pMember.newModelResource("EARTH MODEL
    RESOURCE", #sphere)
    vEarthModelResource.radius = 50.000
    vEarthModelResource.resolution = 20
    vEarthTexture = pMember.newTexture("EARTH TEXTURE",
    #fromCastMember, member(3,1))
    vEarthShader = pMember.newShader("EARTH SHADER", #standard)
    vEarthShader.emissive = color(255,255,255)
    vEarthShader.flat = TRUE
    vEarthShader.transparent = FALSE
    vEarthShader.textureList[1] = vEarthTexture
    pEarthSphere = pMember.newModel("EARTH MODEL",
    vEarthModelResource)
    pEarthSphere.shaderList = vEarthShader
    vNightModelResource = pMember.newModelResource("NIGHT MODEL
    RESOURCE", #sphere)
    vNightModelResource.radius = 50.2000
    vNightModelResource.resolution = 20
    vNightTexture = pMember.newTexture("NIGHT TEXTURE",
    #fromCastMember, member(4,1))
    vNightTexture.quality = #lowFiltered
    vNightTexture.nearFiltering = FALSE
    vNightTexture.renderFormat = #rgba8880
    vNightShader = pMember.newShader("NIGHT SHADER", #standard)
    vNightShader.emissive = color(255,255,255)
    vNightShader.flat = TRUE
    vNightShader.transparent = TRUE
    vNightShader.textureList[1] = vNightTexture
    vMaskNightTexture = pMember.newTexture("MASK NIGHT TEXTURE",
    #fromCastMember, member(6,1))
    vMaskNightTexture.renderFormat = #rgba8888
    vNightShader.textureList[2] = vMaskNightTexture
    vNightShader.textureModeList[2] = #wrapPlanar
    pNightSphere = pMember.newModel("NIGHT MODEL",
    vNightModelResource)
    pNightSphere.shaderList[1] = vNightShader
    pNightSphere.parent = pEarthSphere
    end
    on exitFrame(me)
    pEarthSphere.rotate(0.0,0.1,0.0)
    me.moveMaskNightTexture()
    end
    on moveMaskNightTexture(me)
    vRotationVector = - pEarthSphere.transform.rotation
    pNightSphere.shaderList[1].wrapTransformList[2].rotation =
    vRotationVector
    end

  • How to dynamically load jar files - limiting scope to that thread

    Dynamically loading jar files has been discussed a lot. I have read a quite a few posts, articles, and demo code for doing just that. However, I have yet to find a solution to my problem. Most people modify their system class loader and are happy. I have done that and was happy for a time. Occasionally, you will see reference to an application server or tomcat or some other large project that have successfully been able to load and unload jar files, allow for dynamic deployment of code, etc. However, I have not been able to achieve similar success; And my problem is much less complicated.
    I have an application that executes a thread to send a given file/message to a standard JMS Server Queue. Depending on the parameters selected by the user, this thread may need to communicate with one of a number of JMS Servers, ie. JBoss, WebLogic, EAServer, Glassfish, etc. All of which can be done with the same code, but each needs to load their own flavor of JMS Client Jar files. In this instance, spawning a separate JVM for each communication would work from a classloader perspective. However, I need to keep it in the family and run under the same JVM, albeit each JMS Server Connection will be created and maintained in separate Threads.
    I am close, I am doing the following...
    1. Creating a new URLClassLoader in the run() method of each thread.
    2. Set this threads contextClassLoader to the new URLClassLoader.
    3. Load the javax.jms.JMSException class with the URLClassLoader.loadClass() method.
    4. Create an initialContext object within this thread.
    Note: I read that the initialContext and subsequent conext lookup calls would use the Thread�s
    contextClassLoader for finding/loading classes.
    5. Perform context.lookup calls for a connectionFactory and Queue name.
    6. Create JMS Connection, etc. Send Message.
    Most of this seems to work. However, I am still getting a NoClassDefFoundError exception for the javax.jms.JMSException class ( Note step #3 - tried to cure unsuccessfully).
    If I include one of the JMS Client jar files ( ie wljmsclient.jar for weblogic ) in the classpath then it works for all the different JMS Servers, but I do not have confidence that each of the providers implemented these classes that now resolve the same way. It may work for now, but, I believe I am just lucky.
    Can anyone shine some light on this for me and all the others who have wanted to dynamically load classes/jar files on a per Thread basis?

    Thanks to everyone - I got it working!
    First, BenSchulz' s dumpClassLoader() method helped me to visualize the classLoader hierarchy. I am still not completely sure I understand why my initial class was always found by the systemClassLoader, but knowning that - was the step I needed to find the solution.
    Second, kdgregory suggested that I use a "glue class". I thought that I already was using a "glue class" because I did not have any JMSClient specific classes exposed to the rest of the application. They were all handled by my QueueAdmin class. However...
    The real problem turned out to be that my two isolating classes (the parent "MessageSender", and the child "QueueAdmin") were contained within the same jar file that was included in the classpath. This meant that no matter what I did the classes were loaded by the systemClassLoader. Isolating them in classes was just the first step. I had to remove them from my jar file and create another jar file just for those JMSClient specific classes. Then this jar file was only included int custom classLoader that I created when I wanted to instantiate a JMSClient session.
    I had to create an interface in the primary jar file that could be loaded by the systemClassLoader to provide the stubs for the individual methods that I needed to call in the MessageSender/QueueAdmin Classes. These JMSClient specific classes had to implement the interface so as to provide a relationship between the systemClassLoader classes and the custom classLoader classes.
    Finally, when I loaded and instantiated the JMSClient specific classes with the custom classLoader I had to cast them to the interface class in order to make the method calls necessary to send the messages to the individual JMS Servers.
    psuedu code/concept ....
    Primary Jar File   -  Included in ClassPath                                                      
    Class<?> cls = ClassLoader.loadClass( "JMSClient.MessageSender" )
    JMSClientInterface jmsClient = (JMSClientInterface) cls.newInstance()                            
    jmsClient.sendMessage()                                                                      
    JMSClient Jar File  -  Loaded by Custom ClassLoader Only
    MessageSender impliments Primary.JMSClientInterface{
        sendMessage() {
            Class<?> cls=ClassLoader.loadClass( "JMSClient.QueueAdmin" )
            QueueAdmin queueAdmin=(QueueAdmin) cls.newInstance()
            queueAdmin.JMSClientSpecificMethod()
        }

Maybe you are looking for

  • Help me choose a 'Single Codec' for conversion?

    I am preparing my footage to edit a documentary which I shot using three cameras: DVCPRO HD (1080/25p) Panasonic 171 H264 (1080/25p) Canon 5D Mk II AVCHD (1080/50p) Panasonic TM700 My confusion is concerned with the DVCPRO HD stuff being 1440x1080 wh

  • Set index of an external swf in a mc

    Hello, i have a trouble with this: a main movie clip (photo_group) which call an external movieclip from xml which call another movieclip which load a video... but the video is placed at the bottom of my main stage and i would like to have it at the

  • FM for changing the condition type values in Purchase order

    Hi All, Is there any FM which will update the condition types in Purchase Order other than BAPI_PO_CHANGE. Please suggest. Thanks in Advance Regards Hari

  • Option/fuction disappeared

    After upgrading to iOS 4.3 the option for using my Iphone 4 as a modem has disappered. I have tried to upgrade it again and also done a cold-boot without success. Anyone else that has experienced the same?

  • How can I reset the method to send and track forms?

    How can I reset the method to send and track forms? I selected Adobe FormsCentral and now I want to switch back to e-mail. This is apparently not possible