Delegation model?

What is delegation model in java? What actually does it do?

Do you know how to google ???
http://www.google.be/search?hl=nl&q=What+is+delegation+model+in+java

Similar Messages

  • Event delegation model VS Listener interfaces?

    hello again,
    i got confused with "event delegation model and Listener interfaces".are both of these things are same or they are completely opposite, or they go hand in hand?
    can any body help me understand that concept.
    thanks

    event delegation would be the concept, passing out events to interested parties. listener interfaces and registering them with the event sources would be the implementation of that concept.

  • RMI and the class loader delegation model

    Hello,
    I need to know what the class loader delagation chain looks like when RMI does dynamic class loading. What is the RMIClassLoader's parent? Does it delegate to Thread.currentThread().getContextClassLoader()?
    In a test application I can debug the chain which looks like this:
    sun.misc.Launcher$AppClassLoader@bac748
    sun.misc.Launcher$ExtClassLoader@7172ea
    The AppClassLoader is the class loader for the test and is coincident with getSystemClassLoader(). Its parent is the ExtClassLoader which I believe is in charge of loading anything from jre/lib/ext. But I don't know how to get a reference to the RMIClassLoader in order to find out what it's parent is.
    I would appreciate any info on this.
    Thanks in advance,
    Joe

    Well that was easy.
    I just used the RMIClassLoader.getClassLoader(String codebase) and was able to determine the chain.
    FYI: the chian is as follows:
    ExtClassLoader <-- AppClassLoader <-- sun.rmi.server.LoaderHandler
    Of interest, if you have a custom class loader its parent will most likely be the AppClassLoader but the rmi class loader will not chain off of your custom class loader. It does some interesting things in order for this to work. It will look for custom class loader to load interfaces but will use the RMIClassLoader to load stubs. Pretty cool.
    Thanks anyway.
    Joe

  • Web console - delegating permissions correctly - Advice on best practice

    Hi,
    I'm in the process of rolling out the Orchestrator Console for wider use within our department.  After reading some posts on Console delegation I have been able to set a group up which when added to the Orchestrator root and Sub dirs, allows the folder
    views to be controlled, but only to some degree/very basic.
    What I mean - or what I'm finding is that I have what is turning out to be quite a 'deep' tree/subtree folder structure for my runbooks (currently about 4 levels) eg from root folder Runbooks->ProductionRunbooks->ServiceDeskRunbooks->ExchangeRunbooks
    - containing 2 exchange runbooks.
    So for this structure to delegate to Service desk staff I have created a security group (service desk_console) and given the basic Read permission at Runbook and ProductionRunbooks folder and then Full control (inc child Objects) at ServicedeskRunbooks folder
    to allow exectution of any runbooks below this level.
    My query is is this the way it should work - I initially thought I could set the read permission at the top level but then just at the Full control permission on the specific low level folder but this didnt work - I had to apply the read permission at each
    of the folders between root at target folder.
    So as the number of runbooks/folders grows and the possible mix of user groups who will require access to run a particular runbook I can see the delegation of permissions becoming very messy using the method I currently got working - ie with potentially
    several 'user groups' I will have to basically set explicitly the permissions for each user group at all levels on all folders?
    A possible solution I'm thinking of is to create a 'general console users' group and add the specific user groups to that (eg service desk,Exchange Team,VDI Team) to then set the read permissions on root Runbooks and Production Runbooks folders and then
    set Full control specific for the user groups on the folders containing the runbooks pertaining to that user group - any runbooks required by multiple groups could be set in a 'general folder with all groups having FC permissions to it.
    Thats my thoughts - seems a bit messy to me but just interested to hear and confirm that thats just the limitation and way console delegation is supposed to work or if there is a neater way I'd like to know!!
    Cheers - PS I know this descended into a bit of a ramble/discussion in my own head so apologies ;-)

    Hi Stefan, thanks for your reply and suggestion.  What I probably didnt explain, and what I was hoping to achieve in the delegation model was to try and only make visible the folders/runbooks to the relevant operators/user groups.
    The issue probably stems from me having a pretty messy folder structure (generally) and me wanting to hide that mess and confusion from operators who will be new to the console.  Basically I have a high level folder called production which underneath
    that I create neat and tidy folders/runbooks following a good naming convention - only production ready stuff goes in here and this is the focus of what I want to make visible and control access to.  However I also have High level folder for PreProduction
    and Also Testing and within those are a very large number of Folders/runbook which dont follow good naming and can easily loose track when multiple folders are expanded fully.
    So my issue with doing the List permission and let it be inherited down the tree then I assume I will be giving the console user the full (list) view of that structure even if they cant execute and runbooks.
    So is the only way to enforce views/ and run permission to specify explicit permissions accordingly at each level in the tree, ie you can't skip setting folder permissions at some of the in between 'organizational type' folders - eg from my example above
    the ProductionRunbooks->ServiceDeskrunbooks folder/subfolder are just to logically organize the folders containing runbooks such as Exchangerunbooks.  Ideally I would like to set the permissions in such a way that allows the service Desk group to view
    the runbooks at the Ecxhangerunbooks subfolder level.
    Hope that makes sense - I get the feeling to answer is no and the only way to enforce it is to use the multiple groups/explicit permissions at each level in the folder structure.  Happy to be told otherwise!!...

  • Role Delegation in Identity Server 5.1

    Have anyone try to set two adminitrators in Identity Server 5.1 say Admin-A & Admin-B so that Admin-A can only add/del Role-A to all user and Admin-B can only add/del Role-B to all user?
    Moreover, is it possible that users created by Admin-A can only remove by Admin-A and users created by Admin-B can only remove by Admin-B given that all users is in the same people container?
    Thanks,
    Clive Chan

    Yes it is possible to setup a delegation model like that ..
    This documentation should have been added to that identity server unfortunately it had been left out.
    Anyway the same documentation is provided in the link below ..
    http://docs.sun.com/source/816-6359-10/dadmadm.html#26847
    Note: this documentation is for portal server but portal server uses identity server as its infrastructure and is actually a service that sits on the identity server ..
    HTH ..

  • Diff betn Application and Web Sever

    Hi ,
    I want to know what is the difference between Web Server n Application Server
    Thanks in advance
    Rajendra

    Here you gooooooooooo.
    (1) Webserver serves pages for viewing in web browser, application server provides exposes businness logic for client applications through various protocols
    (2) Webserver exclusively handles http requests.application server serves bussiness logic to application programs through any number of protocols.
    (3) Webserver delegation model is fairly simple,when the request comes into the webserver,it simply passes the request to the program best able to handle it(Server side program). It may not support transactions and database connection pooling.
    (4) Application server is more capable of dynamic behaviour than webserver. We can also configure application server to work as a webserver.Simply applic! ation server is a superset of webserver.
    Hope you got the reqd info.

  • Classloader Again

    Sorry to bring up the classloader questions again and again. I am a bit confused by the language used in the documentation when it says things like each application has its own universe etc. And also, the following statement in the docs,
    "The exception is the Web Classloader, which follows the delegation model in the Servlet specification. The Web Classloader looks in the local classloader before delegating to its parent. You can make the Web Classloader delegate to its parent first by setting delegate="true" in the class-loader element of the sun-web.xml file. For details, see the Developer's Guide to Web Applications."
    I wanted to see if some one could answer the following. (These are very easy for me to test. But, at this point I have a very "rich" system classpath that includes a lot of classes/jars etc. Makes it harder to see a clear picture. And I want to see if what I am observing the correct behavior))
    I have a com.xyz.myClass packaged in utils.jar. I also have a test servlet and jsp page. The test servlet makes a call to com.xyz.myClass
    A) If I individually deploy my test servlet/jsp as a .WAR, where should I place utils.jar?
    (If I had utils.jar in the system classpath, is the WAR supposed to see it?)
    B) What if the a

    I have a com.xyz.myClass packaged in utils.jar. I also have > a test servlet and jsp page. The test servlet makes a call to > com.xyz.myClass
    A) If I individually deploy my test servlet/jsp as a .WAR,
    where should I place utils.jar?You can place it in any one of a number of locations:
    - within the WAR under WEB-INF/lib/. This location would be the most conventional, self-contained approach.
    - under $INSTANCE_ROOT/lib/. This location would mean that the same "version" the library would be shared by all apps (assuming that the other apps did not include their own copy).
    - under classpath-suffix setting for the instance. Similar to using $INSTANCE_ROOT/lib/, but you have to specify the JAR file name explicitly.
    (If I had utils.jar in the system classpath, is the WAR
    supposed to see it?)Yes.
    B) What if the above .WAR was part of a larger .EAR and I > deploy the .EAR instead of the .WAR? (Should utils.jar
    be in system class path or the web-inf/lib of the .WAR ?)Either.
    C) What if the .EAR above also had a few EJBs that
    accessed com.xyx.myClass ?- Self-contained approach would be to package the JAR file in the EAR and use the manifest classpath approach to denote its location for both the EJB JAR module and the WAR module.
    - Alternatively, you could either place the library either under $INSTANCE_ROOT/lib/ or specify the library in the classpath-suffix setting in the instance configuration.
    A good example of when it makes sense for the web classloader to look in the local classloader before delegating upward to the system classloader is the case in which your web application depends on a particular JAXP compatible XML parser that is different from that which is being used by the application server infrastructure. In this case, you would want the XML parser embedded in your web app or EAR to take precedence over the other XML parser packaged in the system classpath for use by the app server.
    Chris

  • "Best practice" for components calling components on different panels.

    I'm very new to Swing. I have been learning from tutorials, but these are always relatively simple interfaces , in which every component and container is initialised and added in the constructor of a main JFrame (extension) object.
    I would assume that more complex, real-world examples would have JPanels initialise themselves. For example, I am working on a project in which the JFrame holds multiple JPanels. One of these Panels holds a group of JToggleButtons (grouped in a ButtonGroup). The action event for each button involves calling the repaint method of one of the other Panels.
    Obviously, if you initialise everything in the JFrame, you can simply have the ActionListener refer to the other JPanel directly, by making the ActionListener a nested class within the JFrame class. However, I would like the JPanels to initialise their own components, including setting the button actions, by using an extension of class JPanel which includes the ActionListeners as nested classes. Therefore the ActionListener has no direct access to JPanel it needs to repaint.
    What, then, is considered "best practice" for allowing these components to interact (not simply in this situation, but more generally)? Should I pass a reference to the JPanel that needs to be repainted to the JPanel that contains the ActionListeners? Should I notify the main JFrame that the Action event has fired, and then have that call "repaint"? Or is there a more common or more correct way of doing this?
    Similarly, one of the JPanels needs to use a field belonging to the JFrame that holds it. Should I pass a reference to this object to the JPanel, or should I have the JPanel use "getParent()", or some other method?
    I realise there are no concrete answers to this query, but I am wondering whether there are accepted practices for achieving this. My instinct is to simply pass a JPanel reference to the JPanel that needs to call repaint, but I am unsure how extensible this would be, how tightly coupled these classes would become.
    Any advice anybody could give me would be much appreciated. Sorry the question is so long-winded. :)

    Hello,
    nice to get feedback.
    I've been looking at a few resources on this issue from my last post. In my application I have been using the Observer and Observable classes to implement the MVC pattern suggested by T.PD.(...)
    Two issues (not fatal, but annoying) with this are:
    -Observable is a class, not an interface; since most of my Observers already extend JPanel (or some such), I have had to create inner classes.
    -If an Observer is observing multiple Observables, it will have to determine which Observer called its update() method (by using reference equality or class comparison or whatever). Again, a very minor issue, but something to keep in mind.I don't deem those issues are minor. The second one in particular, is rather annoying in terms of maintenance ("Err, remind me, which widget is calling this "update()" method?").
    In addition to that, the Observable/Observer are legacy non-generified classes, that incurr a loosely-typed approach (the subject and context arguments to the update(Observable subject, Object context) methods give hardly any info in themselves, and they generally have to be cast to provide app-specific information.
    Note that the "notification model" from AWT and Swing widgets is not Observer-Observable, but merely EventListener . Although we can only guess what reasons made them develop a specific notification model, I deem this essentially stems from those reasons.
    The contrasting appraoches are discussed in this article from Bill Venners: The Event Generator Idiom (http://www.artima.com/designtechniques/eventgenP.html).
    N.B.: this article is from a previous-millenary series of "Design Techniques" articles that I found very useful when I learned OO design (GUI or not).
    One last nail against the Observer/Observable model: these are general classes that can be used regardless of the context (GUI/non-GUI code), so this makes it easier to forget about Swing threading rules when using them (essentially: is the update method called in the EDT or not).
    If anybody has any information on the performance or efficiency of using Observable/ObserverI would be very surprised if this had any performance impact. If it had, that would mean that you have either:
    - a lot of widgets that are listening to one another (and then the Mediator pattern is almost a must to structure such entangled dependencies). And even then I don't think there could be any impact below a few thousands widgets.
    - expensive or long-running computation in the update methods. That's unrelated to the notification model itself.
    - a lot of non-GUI components that use the Observer/Observable to communicate among themselves - all the more risk then, to have a GUI update() called outside the EDT, see remark above.
    (or whether there are inbuilt equivalents for Swing components)See discussion above.
    As far as your remark 2 goes (if one observer observes more than one subjects, the update() method contains branching logic) : this also occurs with the Event Delegation model indeed: for example, it is quite common that people complain that their actionPerformed() method becomes unwieldy when the same class listens for several JButtons.
    The usual advice for this is, use anonymous listeners, each of which handles the event from only one source (and generally very close in code to the definition of that source), and that simply translates the "generic" event notification method into a specific method call of a Controller or Mediator .
    Best regards.
    J.
    Edited by: jduprez on May 9, 2011 10:10 AM

  • [Initial Password] CUA vs IdM

    Hi,
    Please correct me if I am wrong: when the CUA cha,ges to password in the child systems, they are set as initial. It means that, on the first logon, the user has to change it.
    Is there a possibility for IdM to set "definitive" password. It seems so to me after reading
    |                     |        CUA        |  Identity Management       |
    | Password management | Initial passwords | yes incl. workflow support |
    in https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7037d982-40aa-2a10-e283-a76a9dfc93ab, page 29
    Thanks in advance.
    Best regards,
    Guillaume

    IdM can only do what SAP permits.  Depending on how one is authenticating determines the password policy.  An initial password, an expired password and a password reset by an administrator all set the same flag.  The user must change their password on next logon.  The only way around this to write directly to the db with SAP's hash.  A terrible idea and a big security risk. 
    UME uses a delegated model so the password policy depends on what you are authenticating against.  This question is normally asked because a company wants to do password synchronization; one is better off doing SSO.

  • Annotation-Processing Using Custom ClassLoader Fails

    Hi,
    I have the following problem concerning annotations.
    I am using Jaxb2 to marshal some classes and Jaxb relies heavily on processing annotation information contained in them.
    If I put the Jaxb JAR's directly in the classpath everything works fine.
    However, if I use a custom URLClassLoader to load all the Jaxb-related classes the annotation processing fails thus making Jaxb believe that the objects can't be marshaled.
    Note that the classes to marshal containing the annotations to read are loaded with a different ClassLoader which is higher in the hierarchy.
    I tracked down the problems to the class RuntimeInlineAnnotationReader of the Jaxb API which simply calls Class.getAnnotion(..).
    When searching for this bug I also found the bug report 5015623 which relates to this problem. But it is rather outdated, so I hope that there are some better solutions than just ignoring it.
    I wouldn't like having the Jaxb JARs on the global classpath 'cause they are used in only one class out of 100 and thats not worth the possible conflicts with other 3rd party libs.
    Best regards,
    beebop

    No problem, I will give you some details about my architecture.
    First of all I encapsulated the code which uses the Jaxb-API in one class, say Foo, which implements the interface FooInterface.
    Secondly I load the Foo class in another class, Bar, using my derivation of URLClassLoader, called MyClassLoader. Then I use the interface to marshal an object gen of type GenClass where GenClass was generated using xjc:
    class Bar {
      void method(URL[] urls, GenClass gen) {
        ClassLoader parent = Bar.class.getClassLoader();
        ClassLoader myCL = new MyClassLoader(urls,parent);
        Class clazz = myCL.loadClass("Foo");
        FooInterface foo = (FooInterface)clazz.newInstance();
        foo.marshal(gen);
    }So my class loader will be a child of the current class loader. The delegation model of class loading is reversed in MyClassLoader so that first the urls will be checked and then, if the class was not found, the parent class loader.
    Note that GenClass and its ObjectFactory which acutally contain the annotations Jaxb needs will be loaded by the current class loader, not my own. All classes of the Jaxb-API will be loaded by MyClassLoader. If I try to marshal gen, the annotations of the ObjectFactory corresponding to GenClass won't be readable causing the Class.getAnnotation(...) method called in the class RuntimeInlineAnnotationReader to return null.
    If I don't use my own class loader, say
    FooInterface foo = new Foo();everything works fine and the annotations of the ObjectFactory are loaded correctly.
    I observed the different behaviour by stepping through the classes and methods around JaxbContext.newInstance(...).
    MyClassLoader is not that different from URLClassLoader, only the loadClass method is overridden to change the delegation behaviour. Thats why I suspect an error in the annotations framework and not in my class loader but I may be mistaken.
    Best regards,
    beebop

  • ClassLoader problems..

    <Unsure where this should be posted>
    Hi, I have a bit of a problem with loading a class using defineClass.
    When I load the bytes of a class file and covert that file to a class, using defineClass, the generated Class object seems to work fine. I can call new instance without a problem.
    The problem occurrs when I try to cast the generated class. It seems that the JVM doesn't recognize the generated object to be an instanceof what I am casting to (although I know it is).
    Here is the class loader I am using:
    class loader extends ClassLoader {
        public loader(){
            super();
        public Class<?> loadClass(String className) throws ClassNotFoundException {
              try{
                   return super.loadClass(className);
            } catch (Exception e) {
                 return null;
        public Class<?> loadClass(String className, byte bytes[])  {
            Class ret = super.defineClass(className, bytes, 0, bytes.length);
            super.resolveClass(ret);       
            return ret;
    }And here is the code I am using to call:
    DataInputStream in = new DataInputStream(new FileInputStream(new File("TestApp.class")));
    byte[] bytes = new byte[in.available()];
    in.readFully(bytes);
    loader classLoader = new loader();
    TestApp testapp = (TestApp)classLoader.loadClass("TestApp", bytes).newInstance();
    //This line generats a ClassCast Exception ^     Using..
    TestApp ta = (TestApp)classLoader.loadClass("TestApp").newInstance();works fine however. It seems my define class is causing this problem.
    If anyone could help, I'd greatly appreciate it.
    - Adam
    <Unsure where this should be posted>

    <Unsure where this should be posted>Somewhere under "Core API's" :)
    The problem occurrs when I try to cast the generated
    class. It seems that the JVM doesn't recognize the
    generated object to be an instanceof what I am
    casting to (although I know it is).A type is defined as a <classloader,name> pair. For the cast to succeed you have to get both parts of the pair the same.
    Here is the class loader I am using:
    class loader extends ClassLoader {
    public loader(){
    super();
    public Class<?> loadClass(String className)
    throws ClassNotFoundException {
         try{
    eturn super.loadClass(className);
    } catch (Exception e) {
         return null;
    public Class<?> loadClass(String className, byte
    bytes[]) {
    Class ret = super.defineClass(className,
    bytes, 0, bytes.length);
    super.resolveClass(ret);
    return ret;
    }Your classloader is not defined correctly as it breaks the delegation model. Your classloader should always see if its parent loader can load a class of a given name before the loader itself tries to. In this case you are bypassing the parent - which obviously could load the class if given the opportunity - and defining it directly. Hence ...
    TestApp testapp = (TestApp)classLoader.loadClass("TestApp",
    bytes).newInstance();
    //This line generats a ClassCast Exception ^     ... the type of the class you load explicitly is <classLoader, "TestApp">. The type being checked for by your cast is <current-loader, "TestApp">. As the current loader is not your custom classLoader, the types are different and you get the exception.
    Hope that clarifies things.
    Message was edited by:
    davidholmes

  • Classloading in WLS

    We have a web applicaton deployed on WLS.
    we have added few jar files inside WEB-INF/lib directory of the application war. Within our app , we have a requirement to scan through the jar files (inside WEB-INF/lib) manifests and detects something.
    Is it guaranteeing that all the Jar files inside WEB-INF/lib is loaded into application class loader?
    If yes, can i get hold of the application classloader from within a java class inside the Web application ?
    Thanks
    Joseph George

    "Is it guaranteeing that all the Jar files inside WEB-INF/lib is loaded into application class loader?"
    Note that this depends on which classes (jars) you have in the WEB-INF/lib directory. WebLogic uses the delegation
    model to load classes; when classes are already loaded, they do not get loaded again by the application class loader.
    WebLogic provides an override mechanism by the so-called filtering class loader configuration. Some examples are given here:
    - http://middlewaremagic.com/weblogic/?p=5861
    - http://middlewaremagic.com/weblogic/?p=6725
    "... can i get hold of the application classloader from within a java class inside the Web application ?"
    Very good question. Not to my knowledge - http://docs.oracle.com/cd/E21764_01/web.1111/e13706/classloading.htm#i1080994

  • Custom ClassLoader = frustration & pain.

    Short version : I need to override the findLibrary() method of ClassLoader so I can load .dlls from a .jar. I can't simply loadLibrary() or load() them because when one particular .dll is loaded (j3dcore-ogl-cg.dll) it insists on attempting to load its dependents. If I have control of findLibrary(), then I can load them from wherever I want.
    The problem is, I can't see my ClassLoader in use. Here's the skeleton of what I'm using as the ClassLoader :
    public class Test extends ClassLoader
         public static void main(String[] args)
              System.out.println("Test parent class loader = "+Test.class.getClassLoader());
              Test l = new Test(
                   Test.class.getClassLoader()
              System.out.println("Custom class loader = "+l);
              try
                   Class<?> test2 = l.loadClass("Test2", true);
                   Method main = test2.getMethod("main", Array.newInstance(String.class, 0).getClass());
                   main.invoke(null, new Object[] {args});
              catch (SecurityException e)          {     e.printStackTrace();     }
              catch (NegativeArraySizeException e)     {     e.printStackTrace();     }
              catch (IllegalArgumentException e)     {     e.printStackTrace();     }
              catch (ClassNotFoundException e)          {     e.printStackTrace();     }
              catch (NoSuchMethodException e)          {     e.printStackTrace();     }
              catch (IllegalAccessException e)          {     e.printStackTrace();     }
              catch (InvocationTargetException e)     {     e.printStackTrace();     }
         Test(ClassLoader parent)
              super(parent);
    }and here's the class I'm loading :
    public class Test2
         public static void main(String[] args)
              System.out.println("Daughter class loader = "+Test2.class.getClassLoader());
    }The parent of my ClassLoader is sun.misc.Launcher$AppClassLoader@11b86e7 which I guess is the system class loader.
    My custom loader identifies as Test@3e25a5However, the daughter class that's loaded identifies its class loader as sun.misc.Launcher$AppClassLoader@11b86e7Why is this? Why isn't my class loader being used to load the class? I'm developing in Eclipse - would that make a difference?
    Thanks for any pointers, and apologies for any stupid mistakes.

    jtahlborn wrote:
    yes, that is feasible. the problem with your test classloader is that classloaders load classes in "parent first" order (by default). therefore, since your Test2 class is available from the app classloader, that is where it is loaded from. in order to have it loaded from your classloader, you have to either make it not available via the parent classloader, or change the "parent first" delegation by overloading one of the appropriate methods in ClassLoader. however, this isn't really relevant to what you want to do, because you want to change findLibrary, not findClass.Aha. I'm completely new to custom class loaders, and this "parent first" delegation model was throwing me. I couldn't figure out a way of hiding the class I wanted to load, so I overrode loadClass(String, boolean). Does this look sensible to you (apart from the odd error I know I'm not catching) ?
    @Override protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
              if (!name.equals("Test2"))
                   return super.loadClass(name, resolve);
              System.out.println("loadClass("+name+","+resolve+")");
              File classFile = new File("Test2.class");
              long length = classFile.length();
              byte[] buf = new byte[(int)length];
              FileInputStream fis = null;
              try
                   fis = new FileInputStream(classFile);
                   int offset = 0;
                   int numRead = 0;
                   while ((offset < buf.length) && (numRead = fis.read(buf, offset, buf.length-offset)) >= 0)
                       offset += numRead;
                   if (offset < buf.length)
                        throw new IOException("Could not completely read file " + classFile.getName());
                   fis.close();
              catch (FileNotFoundException e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              catch (IOException e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              finally
                   if (fis != null)
                        try
                             fis.close();
                        catch (IOException e)     {}
            return super.defineClass("Test2", buf, 0, (int)length);
         }It feels... odd, having to duplicate code like that instead of just using super() and using the result, but it does work.
    Anyway, this is partly just a test. I need to be the ClassLoader for the loaded class so that I can then override findLibrary().
    that said, are you sure that the subsequent attempts to load dlls from the first dll go through the java findLibrary method? i would imagine that dlls use os specific means to find the other dlls.No clue! However, given that the Exception (hmm... sometimes an Exception, sometimes a severe Error) looks like :
    Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Documents and Settings\[...]\Local Settings\Temp\IST_1277997889218\j3dcore-ogl-cg.dll: Can't find dependent libraries
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(Unknown Source)
            at java.lang.ClassLoader.loadLibrary(Unknown Source)
            at java.lang.Runtime.load0(Unknown Source)
            at java.lang.System.load(Unknown Source)
            at SystemTest.loadLib(SystemTest.java:144)
            at SystemTest.loadFromJar(SystemTest.java:110)
            at SystemTest.<clinit>(SystemTest.java:91)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at SystemTestLauncher.main(SystemTestLauncher.java:42)This suggests to me that either Java is trying to load the dependent libraries itself, or that the OS is failing, reporting an error to the VM, which is then packaging it up for me as an exception. I'm hoping for the former.
    Once I'm the class loader, I should at least be able to tell what's happening.
    Thanks for the hints!
    Edited by: CodeMonkey9358 on Jul 1, 2010 8:30 AM

  • Plzzzzz help me

    I like to know all about event handling ,for my project.
    Plzzzz help me in my project
    Thanx

    Hi nitasha,
    Can you please summarise your query, since event handling is such a big topic in Java.
    Event handling in Java is based on Event delegation model.
    Its principal elements are
    1) Event classes that can encapsulate information about different type of user interaction.
    2) Event source objects that inform event listeners about events when these occur and supply the necessary information about these events.
    There are different classes for events.
    1) Action Event.
    2) Adjustment Event
    3) Item Event
    4) Text Event
    I hope this will help you.
    Thanks
    Bakrudeen

  • Org.jdom.input.JDOMParseException: Error on line 0: File not found

    Hi Everybody!
    I´ve changed the version of Weblogic from 8.6 to 9.2 and I had several problems. One of them was that several web services made in Axis2 didn´t work because when I tried to access to wsdl the program resolve an error. I solved this problem including in weblogic.xml the following lines:
    <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    This solutins works fine with the services but now I have another problem. I have to open a xml file and to do that I use the following senetences:
    SAXBuilder builder=new SAXBuilder(false);
    org.jdom.Document doc=builder.build(myXML);
    In the second line the program fails and show me the following:
    org.jdom.input.JDOMParseException: Error on line 0: File "c:/temp/1219308978141\
    docucad.xml" not found.
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:468)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:891)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml.AssignXMLAttrib
    utes(__bzupdatexml.java:292)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml.ModifyXML(__bzu
    pdatexml.java:263)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml._jspService(__b
    zupdatexml.java:697)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:283)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(Servlet
    StubImpl.java:391)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:309)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at com.matrixone.servlet.CustomFilter.handleDefault(CustomFilter.java:99
    at com.matrixone.servlet.CustomFilter.doFilter(CustomFilter.java:86)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3212)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:1983)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:1890)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1344)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Caused by: org.xml.sax.SAXParseException: File "c:/temp/1219308978141\docucad.xm
    l" not found.
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1022
    at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocume
    nt(DefaultEntityHandler.java:499)
    at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:3
    04)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:907)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:453)
    ... 23 more
    Caused by: org.xml.sax.SAXParseException: File "c:/temp/1219308978141\docucad.xm
    l" not found.
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1022
    at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocume
    nt(DefaultEntityHandler.java:499)
    at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:3
    04)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:907)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:453)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:891)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml.AssignXMLAttrib
    utes(__bzupdatexml.java:292)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml.ModifyXML(__bzu
    pdatexml.java:263)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml._jspService(__b
    zupdatexml.java:697)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:283)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(Servlet
    StubImpl.java:391)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:309)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at com.matrixone.servlet.CustomFilter.handleDefault(CustomFilter.java:99
    at com.matrixone.servlet.CustomFilter.doFilter(CustomFilter.java:86)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3212)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:1983)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:1890)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1344)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Caused by: org.xml.sax.SAXParseException: File "c:/temp/1219308978141\docucad.xm
    l" not found.
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1022
    at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocume
    nt(DefaultEntityHandler.java:499)
    at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:3
    04)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:907)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:453)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:891)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml.AssignXMLAttrib
    utes(__bzupdatexml.java:292)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml.ModifyXML(__bzu
    pdatexml.java:263)
    at jsp_servlet._engineeringcentral._custom.__bzupdatexml._jspService(__b
    zupdatexml.java:697)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:283)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(Servlet
    StubImpl.java:391)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:309)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at com.matrixone.servlet.CustomFilter.handleDefault(CustomFilter.java:99
    at com.matrixone.servlet.CustomFilter.doFilter(CustomFilter.java:86)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3212)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:1983)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:1890)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1344)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    If I change the value <prefer-web-inf-classes>true</prefer-web-inf-classes> from true to false the previous senences works fine but the web services don´t work.
    Any idea?
    Thanks in advance.
    Pope

    Yes, I entirely agree with James's comment : filtering class loader mechanism is THE way to play with classloaders.
    The child-delegation model (with the option "prefer-web-inf-classes") comes from WebLogic 6.1 : it's the old-fashion way to do so. Moreover it can bring some linkage errors or unexepected behaviors.
    In addition to the official documentation, I would suggest to read the article on my blog.
    I tried to explain it in a easy way.
    http://m-button.blogspot.com/2008/08/how-to-use-weblogic-filteringclassloade.html
    Hope this helps.

Maybe you are looking for

  • How do I avoid a pop-up from Firefox every time I go from an email back to my inbox?

    I go to my email in-box and click to read an email. When I'm finished, I want to go back to the email in-box. The easiest way for me is to hit the backspace key which brings me right back to the in-box. More then half the time, however, when I hit th

  • Interrupt a perform-on commit.

    Hi all, How to interrupt a perform which is done on ON-COMMIT statement. Will the ROLLBACK WORK will effect.. Thanks & Regards, Neslin.

  • Problem utl_dbws  oracle 10.2.0.1

    create or replace FUNCTION add_numbers (p_int_1 IN NUMBER, p_int_2 IN NUMBER) RETURN NUMBER AS l_service UTL_DBWS.service; l_call UTL_DBWS.call; l_wsdl_url VARCHAR2(32767); l_namespace VARCHAR2(32767); l_service_qname UTL_DBWS.qname; l_port_qname UTL

  • Question PSE9 backup - unexpected error

    Following a recent Windows reinstall, several programs like PSE 9 were also lost. This was reinstalled with the help from Adobe customer support. My Album was successfully retrieved from my Backup. However trying a new Full backup I've had about 5 at

  • Significance of BSV in stock determination

    Dear SAP gurus, I'm configuring my subcontract scenario. As per library when I do a GR (the amount is: - Ordered material: 10,000 - Raw material: 8,000 - Service for subcont: 2,000 I will get this journal: a. ordered material stock account: +10,000 b