Problem in Class Loading

I am using Sun implementation of JAXB(jaxb-api.jar) for java-to-xml binding in my web application deployed in the latest version of oracle app server(10g release 3). The web server is loading Oracle implementation of JAXB from the shared archive xml.jar. To direct the web server to load application specific JAXB classes, I have used the property(<web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="false" />) in the deployment description - orion.xml file. But it does not solve the problem!
Thanks & regards

Hi,
Refer to this link on OC4J's Classloading Framework... http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b14433/classload.htm#sthref58 there are a couple of options you may be able to employ, including overriding the shared library - there is an example of doing this with the Oracle XML parser and Xerces.
I'm guessing you're on the right track, but you may want to try include-war-manifest-class-path="true". Also, are you sure that you've got your deployment descriptor file defined correctly? Its normally called orion-application.xml, and that particular element isn't defined in the documentation (http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b14433/descriptors.htm#sthref337). You could always try configuring it through the administration console.

Similar Messages

  • WebLogic class loading conflict causing ClassCastException

    Hi everyone,
    I am using Oracle XML Parser v2 for my JCA adapter and I am getting the following exception when method from my adapter is invoked.
    java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to oracle.xml.jaxp.JXDocumentBuilderFactory
    I have already placed Oracle XML Parser v2 library (xmlparserv2.jar) inside $DOMAIN_DIR/lib. Below is the line that throws above exception.
    JXDocumentBuilderFactory factory =(JXDocumentBuilderFactory)JXDocumentBuilderFactory.newInstance();
    So it seems like WebLogic is using different JXDocumentBuilderFactory and there seems to be problem with class loading. How can I resolve this issue? Thanks in advance.
    Regards,
    K.H
    Edited by: K Hein on Dec 16, 2010 12:38 AM

    HI,
    You can use Class Loader Filtering feature of WebLogic to isolate the Classloaders....as described in the following link: http://middlewaremagic.com/weblogic/?page_id=192
    Thanks
    Jay SenSharma
    http://middlewaremagic.com/weblogic (Middleware Magic Is Here)

  • Application Class Loader problem calling virtual function

    Hello everyone
    I have run in to very strange behavior of JVM
    I have created a class loader which allows my to load classes from
    jar file, regardless that URLClassLoader supplies this functionality.
    I am using this class loader to load some classes and call their virtual functions. The class diagram looks like that:
    public interface I {
       public void init();
    public class AAA implements
       public void init(){
    public class BBB extends AAA{
       public void init(){
          //here comes implementation
    }Interface I and class AAA are loaded with System Class loader and Class BBB is loaded using my class loader from jar file.
    ByteStreamClassLoader  classLoader =  new ByteStreamClassLoader  ();
    Class cl = classLoader. loadClass(�com.product.BBB�,true);
    I myInterface = cl.newInstance();
    myInterface.init();The problem is that from some unknown reason java class AAA.init() instead of BBB.init().
    Can somebody help me what am I doing wrong?
    Class Loader code attached below
      public class ByteStreamClassLoader   extends ClassLoader {
        protected HashMap m_cache = new HashMap();
        public void clearCashe() {
          m_cache = new HashMap();
        private String definePackage(String className) {
          StringBuilder strB = new StringBuilder();
          //Class name must be removed from the URI in order to define a package
          String[] packageArray = className.split("\\.");
          for (int i = 0; i < packageArray.length - 1; i++) {
            strB.append(packageArray).append(".");
    String packageName = strB.toString();
    packageName = packageName.substring(0, packageName.length() - 1);
    if (getPackage(packageName) == null) {
    m_logger.log(Level.FINEST, "Defining package '" + packageName + "'");
    definePackage(packageName, null, null, null, null, null, null, null);
    return packageName;
    public synchronized Class loadClass(String name, boolean resolve) throws
    ClassNotFoundException {
    name = name.replaceAll("/", ".").replaceAll(".class", "");
    //Try to locate the Class in cashe
    Class c = (Class) m_cache.get(name);
    //Try to locate the Class in the System Class Loader
    if (c == null) {
    try {
    c = ClassLoader.getSystemClassLoader().loadClass(name);
    catch (Exception ex) {}
    else {
    m_logger.log(Level.FINEST, "Class '" + name + "' found in cache");
    //Load the class from byte array
    if (c == null) {
    String resourceName = name;
    if (!resourceName.endsWith(".class")) {
    resourceName = resourceName.concat(".class");
    //Retrieve class byte representation
    if (resourceName.indexOf(".") != -1) {
    resourceName =
    resourceName.replaceAll("\\.", "/").replaceAll("/class", ".class");
    //Use the ByteStreamClassLoader to load the class from byte array
    byte[] classByteArray = null;
    try {
    classByteArray = getResourceBytes(resourceName);
    catch (IOException ex1) {
    throw new ClassNotFoundException(
    "Could not load class data." + ex1.getMessage());
    m_logger.log(
    Level.FINEST, "Loading class '" +
    name + "' Byte Length: " + classByteArray.length);
    String p = definePackage(name);
    c = defineClass(
    name,
    classByteArray,
    0,
    classByteArray.length,
    ByteStreamClassLoader.class.getProtectionDomain());
    m_cache.put(name, c);
    if (resolve) {
    resolveClass(c);
    return c;

    Hello everyone
    I have run in to very strange behavior of JVM
    I have created a class loader which allows my to load classes from
    jar file, regardless that URLClassLoader supplies this functionality.
    I am using this class loader to load some classes and call their virtual functions. The class diagram looks like that:
    public interface I {
       public void init();
    public class AAA implements
       public void init(){
    public class BBB extends AAA{
       public void init(){
          //here comes implementation
    }Interface I and class AAA are loaded with System Class loader and Class BBB is loaded using my class loader from jar file.
    ByteStreamClassLoader  classLoader =  new ByteStreamClassLoader  ();
    Class cl = classLoader. loadClass(�com.product.BBB�,true);
    I myInterface = cl.newInstance();
    myInterface.init();The problem is that from some unknown reason java class AAA.init() instead of BBB.init().
    Can somebody help me what am I doing wrong?
    Class Loader code attached below
      public class ByteStreamClassLoader   extends ClassLoader {
        protected HashMap m_cache = new HashMap();
        public void clearCashe() {
          m_cache = new HashMap();
        private String definePackage(String className) {
          StringBuilder strB = new StringBuilder();
          //Class name must be removed from the URI in order to define a package
          String[] packageArray = className.split("\\.");
          for (int i = 0; i < packageArray.length - 1; i++) {
            strB.append(packageArray).append(".");
    String packageName = strB.toString();
    packageName = packageName.substring(0, packageName.length() - 1);
    if (getPackage(packageName) == null) {
    m_logger.log(Level.FINEST, "Defining package '" + packageName + "'");
    definePackage(packageName, null, null, null, null, null, null, null);
    return packageName;
    public synchronized Class loadClass(String name, boolean resolve) throws
    ClassNotFoundException {
    name = name.replaceAll("/", ".").replaceAll(".class", "");
    //Try to locate the Class in cashe
    Class c = (Class) m_cache.get(name);
    //Try to locate the Class in the System Class Loader
    if (c == null) {
    try {
    c = ClassLoader.getSystemClassLoader().loadClass(name);
    catch (Exception ex) {}
    else {
    m_logger.log(Level.FINEST, "Class '" + name + "' found in cache");
    //Load the class from byte array
    if (c == null) {
    String resourceName = name;
    if (!resourceName.endsWith(".class")) {
    resourceName = resourceName.concat(".class");
    //Retrieve class byte representation
    if (resourceName.indexOf(".") != -1) {
    resourceName =
    resourceName.replaceAll("\\.", "/").replaceAll("/class", ".class");
    //Use the ByteStreamClassLoader to load the class from byte array
    byte[] classByteArray = null;
    try {
    classByteArray = getResourceBytes(resourceName);
    catch (IOException ex1) {
    throw new ClassNotFoundException(
    "Could not load class data." + ex1.getMessage());
    m_logger.log(
    Level.FINEST, "Loading class '" +
    name + "' Byte Length: " + classByteArray.length);
    String p = definePackage(name);
    c = defineClass(
    name,
    classByteArray,
    0,
    classByteArray.length,
    ByteStreamClassLoader.class.getProtectionDomain());
    m_cache.put(name, c);
    if (resolve) {
    resolveClass(c);
    return c;

  • Plz help me out with class loader problem

    hai forum members,
    I have a code which loads class files from local disk.
    It works fine with some classes ,
    But i get this exception when i am selecting certain other class files
    I am using jdeveloper.
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Filter (wrong name: project1/Filter)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at com.jutframe.JavaUnitTester.selectClass_actionPerformed(JavaUnitTester.java:449)
         at com.jutframe.JavaUnitTester$7.actionPerformed(JavaUnitTester.java:338)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1766)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
                        JFileChooser jfilechooser=new JFileChooser();
                        Filterclass filter=new Filterclass();
                        //Set selection mode for file chooser
                        jfilechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                        //set file filter
                        jfilechooser.setFileFilter(filter);
                        int returnVal = jfilechooser.showOpenDialog(this);
                        if(returnVal == JFileChooser.APPROVE_OPTION)
                            try
                                    String str = jfilechooser.getSelectedFile().getName();
                                    String parent=jfilechooser.getSelectedFile().getParent();
                                     // Create a File object on the root of the directory containing the class file
                                     File file = new File(parent);
                                     // Convert File to a URL
                                     URL url = file.toURL();         
                                     URL[] urls = new URL[]{url};
                                     // Create a new class loader with the directory
                                     ClassLoader cl = new URLClassLoader(urls);
                                     StringTokenizer st = new StringTokenizer(str,".");
                                     String s = st.nextToken ();
                                     Class c = cl.loadClass(s);  //ERROR IS SHOWN IN THIS PARTICULAR LINE
                                     Object instance=c.newInstance();
    --------------------------------------------please help me trace my mistake.
    thank you all.

    i think the problem that i have set a particular class path for my class files and my application loads files from that alone.
    So plz tell me if theres any way to access the class path of a particular file dynamically?
    regards

  • Dynamic class loading problem using unknown JAR archive and directory names

    I read the following article, which enlightened me a lot:
    Ted Neward: Understanding Class.forName().
    However, it took me some while to understand that my problem is the other way around:
    I know the name of the class, I know the name of the method,
    but my program/JVM does not know where to load the classes from.
    Shortly, my problem is that the server engine that I am writing
    uses two different versions of the same library.
    So I am trying out the following solution:
    My program is named TestClassPathMain.java
    Assume the two libraries are named JAR1.jar and JAR2.jar
    and the class/instance method that should
    be exposed to TestClassPathMain.java by them is named
    TestClass1.testMethod().
    As long as I was depending on just one library,
    I put JAR1.jar in the classpath before starting java,
    and I was happy for a while.
    At the moment I got the need to use another version of
    TestClass1.testMethod() packaged in JAR2.jar,
    a call would always access JAR1.jar's
    TestClass1.testMethod().
    I then decided to remove JAR1.jar from the classpath,
    and programmatically define two separate ClassLoaders, one for use
    with JAR1.jar and the other for use with JAR2.jar.
    However, the problem is only partly solved.
    Please refer to the enclosed code for details.
    (The code in the JAR1.jar/JAR2.jar is extremely simple,
    it just tells (by hardcoding) the name of the jar it is packaged in
    and instantiates another class packaged in the same jar using
    the "new" operator and calls a method on it. I don't enclose it.)
    The TestClassPathMain.java/UC1.java/UC2.java code suite was
    successfully compiled with an arbitrary of JAR1 or JAR2 in the classpath,
    however removed from the classpath at runtime.
    (I know that this could have been done (more elegantly...?) by producing an Interface,
    but I think the main problem principle is still untouched by this potential lack of elegancy(?))
    1) This problem should not be unknown to you experts out there,
    how is it generally and/or most elegantly solved?
    The "*** UC2: Variant 2" is the solution I would like best, had it only worked.
    2) And why arent "*** UC2: Variant 2" and
    "*** static UC2: Variant 2" working,
    while "*** Main: Variant 2" is?
    3) And a mal-apropos:
    Why can't I catch the NoClassDefFoundError?
    The output:
    *** Main: Variant 1 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** Main: Variant 1 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** Main: Variant 2 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** Main: Variant 2 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** UC1: Variant 1 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** UC1: Variant 1 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** static UC2: Variant 2 JAR 1 ***:
    Exception in thread "main" java.lang.NoClassDefFoundError: TestClass1
            at UC2.runFromJarVariant2_static(UC2.java:56)
            at TestClassPathMain.main(TestClassPathMain.java:52)
    TestClassPathMain.java
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class TestClassPathMain {
        public static void main(final String args[]) throws MalformedURLException, ClassNotFoundException, InstantiationException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
                // Commented out because I cannot catch the NoClassDefFoundError.
                // Why?
                try {
                    final TestClass1 testClass1 = new TestClass1();
                    System.out.println(
                        "\nThe class TestClass1 is of some unexplicable reason available." +
                        "\nFor the purpose of the test, it shouldn't have been!" +
                        "\nExiting");
                    System.exit(1);
                } catch (NoClassDefFoundError e) {
                    System.out.println("\nPositively confirmed that the class TestClass1 is not available:\n" + e);
                    System.out.println("\n\nREADY FOR THE TEST: ...");
                // Works fine
                System.out.println("\n*** Main: Variant 1 JAR 1 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** Main: Variant 1 JAR 2 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Works fine
                System.out.println("\n*** Main: Variant 2 JAR 1 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** Main: Variant 2 JAR 2 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Works fine
                final UC1 uc1 = new UC1();
                System.out.println("\n*** UC1: Variant 1 JAR 1 ***:");
                uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** UC1: Variant 1 JAR 2 ***:");
                uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Crashes
                System.out.println("\n*** static UC2: Variant 2 JAR 1 ***:");
                UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** static UC2: Variant 2 JAR 2 ***:");
                UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Crashes
                final UC2 uc2 = new UC2();
                System.out.println("\n*** UC2: Variant 2 JAR 1 ***:");
                uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** UC2: Variant 2 JAR 2 ***:");
                uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
        private static void runFromJarVariant1(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final Object testClass1 = clazz.newInstance();
            final Method testMethod1 = clazz.getMethod("testMethod", null);
            testMethod1.invoke(testClass1, null);
        private static void runFromJarVariant2(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
    UC1.java
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class UC1 {
        public void runFromJarVariant1(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final Object testClass1 = clazz.newInstance();
            final Method testMethod1 = clazz.getMethod("testMethod", null);
            testMethod1.invoke(testClass1, null);
    UC2.java
    import java.lang.reflect.InvocationTargetException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class UC2 {
        public void runFromJarVariant2(final String jarFileURL)
        throws MalformedURLException,
               ClassNotFoundException,
               InstantiationException,
               IllegalArgumentException,
               IllegalAccessException,
               InvocationTargetException,
               SecurityException,
               NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
         * Identic to the "runFromJarVariant2" method,
         * except that it is static
        public static void runFromJarVariant2_static(final String jarFileURL)
        throws MalformedURLException,
               ClassNotFoundException,
               InstantiationException,
               IllegalArgumentException,
               IllegalAccessException,
               InvocationTargetException,
               SecurityException,
               NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
    }

    2. i need to load the class to the same JVM (i.e. to
    the same environment) of the current running
    aplication, so that when the loaded class is run, it
    would be able to invoke methods on it!!!
    ClassLoader(s) do this. Try the URLClassLoader.
    (I was talking about relatively esoteric "security"
    issues when I mentioned the stuff about Class objects
    "scope".) You might use the URLClassLoader kind of
    like this.
    Pseudo-code follows:
    // setup the class loader
    URL[] urls = new URL[1];
    urls[0] = new URL("/path/to/dynamic/classes");
    URLClassLoader ucl = new URLClassLoader(urls);
    // load a class & use make an object with the default constructor
    Object tmp = ucl.loadClass("dynamic.class.name").newInstance();
    // Cast the object to a know interface so that you can use it.
    // This may be used to further determine which interface to cast
    // the class to. Or it may simply be the interface to which all
    // dynamic classes have to conform in your program.
    InterfaceImplementedByDynamicClass loadedObj =
        (InterfaceImplementedByDynamicClass)tmp;It's really not as hard as it sounds, just write a little test of
    this and you will see how it works.

  • Cocoon2 weblogic (5.1 sp6) class loader security problem

    Hello folks,
    System:
    Cocoon: v2.0
    JDK: Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C),
    Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
    OS: NT4 SP5
    Servlet: v2.2
    AppServer: Weblogic 5.1 SP6
    Symptoms:
    I've updated our application from Cocoon 1.7.4 to Cocoon2. After I
    figured out what libraries I need on the Weblogic's classpath, I managed
    to envoke the MyServlet (MyServlet extends CocoonServlet). The technique
    I am using is the one I used with the Cocoon v1.7.4: extend Cocoon
    servlet and wrap the HttpServletRequest in MyRequest to provide the XML
    content. I changed the line <map:generators default="request"> in
    sitemap.xmap to specify the location of the source. Configuration files
    seem to be read correctly and the file
    <myWebAppContext>/WEB-INF/_tmp_war/org/apache/cocoon/www/sitemap_xmap.java
    is generated (but there is no class file generated)!
    I looked at the cocoon.log file and looks like a class loader security
    problem: the \WEB-INF\_tmp_war gets locked! Is there any workaround this
    problem? Any help is much appreciated!
    cocoon.log file generated:
    DEBUG 62 [cocoon  ] (ExecuteThread-11): Using configuration file:
    /cocoon.xconf
    INFO 62 [cocoon  ] (ExecuteThread-11): Reloading from:
    file:D:/Programs/cocoon-1.8.2/samples/cocoon.xconf
    DEBUG 93 [cocoon  ] (ExecuteThread-11): New Cocoon object.
    DEBUG 93 [cocoon  ] (ExecuteThread-11): Using parser:
    org.apache.cocoon.components.parser.JaxpParser
    DEBUG 109 [cocoon  ] (ExecuteThread-11): Creating Repository with
    this directory: D:\programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war
    DEBUG 109 [cocoon  ] (ExecuteThread-11): Classpath =
    D:\Programs\cocoon-1.8.2\samples\WEB-INF\classes;D:\Programs\cocoon-1.8.2\samples\WEB-INF\lib\javac.jar;D:\avue\lib\servlet.jar;D:\avue\lib\jaxp.jar;D:\avue\lib\xerces.jar;D:\avue\lib\xalan.jar;D:\avue\lib\cocoon.jar;D:\avue\lib\avalonapi.jar;D:\avue\lib\logkit.jar;D:\avue\lib\maybeupload.jar;D:\avue\lib\jakarta-regexp-1.2.jar;D:\avue\lib\jstyle.jar;D:\avue\lib\javac.jar;D:\weblogic\lib\weblogic510sp6boot.jar;D:\weblogic\classes\boot;
    DEBUG 109 [cocoon  ] (ExecuteThread-11): Work directory =
    D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war
    DEBUG 125 [cocoon  ] (Thread-0): ComponentFactory creating new
    instance of org.apache.cocoon.components.parser.JaxpParser.
    DEBUG 140 [cocoon  ] (Thread-0): ComponentFactory creating new
    instance of org.apache.cocoon.components.parser.JaxpParser.
    DEBUG 140 [cocoon  ] (Thread-0): ComponentFactory creating new
    instance of org.apache.cocoon.components.parser.JaxpParser.
    DEBUG 140 [cocoon  ] (Thread-0): ComponentFactory creating new
    instance of org.apache.cocoon.components.parser.JaxpParser.
    DEBUG 390 [cocoon  ] (ExecuteThread-11): Root configuration:
    cocoon
    DEBUG 390 [cocoon  ] (ExecuteThread-11): Configuration version:
    2.0
    DEBUG 390 [cocoon  ] (ExecuteThread-11): Setting up components...
    DEBUG 406 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.parser.Parser =
    org.apache.cocoon.components.parser.JaxpParser)
    DEBUG 406 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.language.generator.ProgramGenerator =
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl)
    DEBUG 406 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.url.URLFactory =
    org.apache.cocoon.components.url.URLFactoryImpl)
    DEBUG 406 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.saxconnector.SAXConnector =
    org.apache.cocoon.components.saxconnector.NullSAXConnector)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.avalon.util.datasource.DataSourceComponentSelector =
    org.apache.cocoon.components.CocoonComponentSelector)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.avalon.util.pool.PoolController =
    org.apache.cocoon.components.ComponentPoolController)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.language.programming.ProgrammingLanguageSelector
    = org.apache.cocoon.components.CocoonComponentSelector)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.language.markup.MarkupLanguageSelector =
    org.apache.cocoon.components.CocoonComponentSelector)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.store.Store =
    org.apache.cocoon.components.store.MemoryStore)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.classloader.ClassLoaderManager =
    org.apache.cocoon.components.classloader.ClassLoaderManagerImpl)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Setting up the sitemap.
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Sitemap location =
    sitemap.xmap
    DEBUG 703 [cocoon  ] (ExecuteThread-11): ComponentFactory creating
    new instance of org.apache.cocoon.components.url.URLFactoryImpl.
    DEBUG 703 [cocoon  ] (ExecuteThread-11): Getting the URLFactories
    DEBUG 703 [cocoon  ] (ExecuteThread-11): for protocol:
    resource org.apache.cocoon.components.url.ResourceURLFactory
    DEBUG 718 [cocoon  ] (ExecuteThread-11): for protocol: context
    org.apache.cocoon.components.url.ContextURLFactory
    DEBUG 718 [cocoon  ] (ExecuteThread-11): Beginning sitemap
    regeneration
    DEBUG 718 [cocoon  ] (ExecuteThread-11): Making URL from
    file:/D:/Programs/cocoon-1.8.2/samples/sitemap.xmap
    DEBUG 718 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.
    DEBUG 718 [cocoon  ] (Thread-1): Could not find ComponentHandler,
    attempting to create one for role:
    org.apache.cocoon.components.language.generator.ServerPagesSelector
    DEBUG 718 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.generator.GeneratorSelector.
    DEBUG 718 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.
    DEBUG 718 [cocoon  ] (Thread-1): CocoonComponentSelector setting
    up with root element:
    DEBUG 718 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of org.apache.cocoon.components.CocoonComponentSelector.
    DEBUG 718 [cocoon  ] (Thread-1): CocoonComponentSelector setting
    up with root element: markup-languages
    DEBUG 734 [cocoon  ] (Thread-1): Adding
    org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage for
    xsp
    DEBUG 734 [cocoon  ] (Thread-1): Adding
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage
    for sitemap
    DEBUG 734 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of org.apache.cocoon.components.CocoonComponentSelector.
    DEBUG 734 [cocoon  ] (Thread-1): CocoonComponentSelector setting
    up with root element: programming-languages
    DEBUG 750 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.programming.java.JavaLanguage.
    DEBUG 750 [cocoon  ] (Thread-1): Looking up
    org.apache.cocoon.components.classloader.ClassLoaderManager
    DEBUG 750 [cocoon  ] (Thread-1): Setting the parameters
    DEBUG 750 [cocoon  ] (Thread-1): Adding
    org.apache.cocoon.components.language.programming.java.JavaLanguage for
    java
    DEBUG 765 [cocoon  ] (Thread-1): The instance was not accessible,
    creating it now.
    DEBUG 765 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
    DEBUG 1718 [cocoon  ] (Thread-1): Making URL from
    jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
    DEBUG 1718 [cocoon  ] (Thread-1): Logicsheet
    Used:jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
    WARN 4109 [cocoon  ] (Thread-1): Could not load class for program
    'org\apache\cocoon\www\sitemap_xmap'
    java.security.AccessControlException: access denied
    (java.io.FilePermission
    \D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
    at
    java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at
    java.security.AccessController.checkPermission(AccessController.java:399)
    at
    java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.net.URLClassLoader$5.run(URLClassLoader.java:463)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.getPermissions(URLClassLoader.java:461)
    at
    java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at
    org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.loadClass(ClassLoaderManagerImpl.java:58)
    at
    org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:121)
    at
    org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:163)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 4109 [cocoon  ] (Thread-1): Language Exception
    org.apache.cocoon.components.language.LanguageException: Could not load
    class for program 'org\apache\cocoon\www\sitemap_xmap' due to a
    java.security.AccessControlException: access denied
    (java.io.FilePermission
    \D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
    at
    org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:124)
    at
    org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:163)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 4109 [cocoon  ] (Thread-1): ComponentFactory decommissioning
    instance of
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
    DEBUG 4109 [cocoon  ] (Thread-1): Can't load ServerPage
    org.apache.avalon.ComponentManagerException: Could not add component for
    class: org.apache.cocoon.www.sitemap_xmap
    at
    org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:61)
    at
    org.apache.cocoon.components.language.generator.GeneratorSelector.select(GeneratorSelector.java:50)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.select(ProgramGeneratorImpl.java:263)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:172)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 4109 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
    DEBUG 4359 [cocoon  ] (Thread-1): Making URL from
    jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
    DEBUG 4359 [cocoon  ] (Thread-1): Logicsheet
    Used:jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
    WARN 6109 [cocoon  ] (Thread-1): Could not load class for program
    'org\apache\cocoon\www\sitemap_xmap'
    java.security.AccessControlException: access denied
    (java.io.FilePermission
    \D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
    at
    java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at
    java.security.AccessController.checkPermission(AccessController.java:399)
    at
    java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.net.URLClassLoader$5.run(URLClassLoader.java:463)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.getPermissions(URLClassLoader.java:461)
    at
    java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at
    org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.loadClass(ClassLoaderManagerImpl.java:58)
    at
    org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:121)
    at
    org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:210)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 6109 [cocoon  ] (Thread-1): Language Exception
    org.apache.cocoon.components.language.LanguageException: Could not load
    class for program 'org\apache\cocoon\www\sitemap_xmap' due to a
    java.security.AccessControlException: access denied
    (java.io.FilePermission
    \D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
    at
    org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:124)
    at
    org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:210)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 6109 [cocoon  ] (Thread-1): ComponentFactory decommissioning
    instance of
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
    ERROR 6109 [cocoon  ] (Thread-1): Error compiling sitemap
    org.apache.avalon.ComponentManagerException: Could not add component for
    class: org.apache.cocoon.www.sitemap_xmap
    at
    org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:61)
    at
    org.apache.cocoon.components.language.generator.GeneratorSelector.select(GeneratorSelector.java:50)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.select(ProgramGeneratorImpl.java:263)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:219)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 6109 [cocoon  ] (ExecuteThread-11): Changing Cocoon
    context(sitemap.xmap) to prefix()
    DEBUG 6109 [cocoon  ] (ExecuteThread-11): from
    context(file:/D:/Programs/cocoon-1.8.2/samples/) and prefix()
    DEBUG 6109 [cocoon  ] (ExecuteThread-11): at URI
    DEBUG 6109 [cocoon  ] (ExecuteThread-11): New context is
    file:/D:/Programs/cocoon-1.8.2/samples/
    ERROR 6140 [cocoon  ] (ExecuteThread-11): Problem with servlet
    org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is
    not available.
    at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:106)
    at org.apache.cocoon.Cocoon.process(Cocoon.java:218)
    at
    org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:417)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:123)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:761)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:708)
    at
    weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252)
    at
    weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:346)
    at
    weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
    INFO 6187 [cocoon  ] (ExecuteThread-11): '' Processed by Apache
    Cocoon 2.0a4 in 5.75 seconds.
    ================================================================
    Regards,
    Georgi

    Hello folks,
    System:
    Cocoon: v2.0
    JDK: Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C),
    Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
    OS: NT4 SP5
    Servlet: v2.2
    AppServer: Weblogic 5.1 SP6
    Symptoms:
    I've updated our application from Cocoon 1.7.4 to Cocoon2. After I
    figured out what libraries I need on the Weblogic's classpath, I managed
    to envoke the MyServlet (MyServlet extends CocoonServlet). The technique
    I am using is the one I used with the Cocoon v1.7.4: extend Cocoon
    servlet and wrap the HttpServletRequest in MyRequest to provide the XML
    content. I changed the line <map:generators default="request"> in
    sitemap.xmap to specify the location of the source. Configuration files
    seem to be read correctly and the file
    <myWebAppContext>/WEB-INF/_tmp_war/org/apache/cocoon/www/sitemap_xmap.java
    is generated (but there is no class file generated)!
    I looked at the cocoon.log file and looks like a class loader security
    problem: the \WEB-INF\_tmp_war gets locked! Is there any workaround this
    problem? Any help is much appreciated!
    cocoon.log file generated:
    DEBUG 62 [cocoon  ] (ExecuteThread-11): Using configuration file:
    /cocoon.xconf
    INFO 62 [cocoon  ] (ExecuteThread-11): Reloading from:
    file:D:/Programs/cocoon-1.8.2/samples/cocoon.xconf
    DEBUG 93 [cocoon  ] (ExecuteThread-11): New Cocoon object.
    DEBUG 93 [cocoon  ] (ExecuteThread-11): Using parser:
    org.apache.cocoon.components.parser.JaxpParser
    DEBUG 109 [cocoon  ] (ExecuteThread-11): Creating Repository with
    this directory: D:\programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war
    DEBUG 109 [cocoon  ] (ExecuteThread-11): Classpath =
    D:\Programs\cocoon-1.8.2\samples\WEB-INF\classes;D:\Programs\cocoon-1.8.2\samples\WEB-INF\lib\javac.jar;D:\avue\lib\servlet.jar;D:\avue\lib\jaxp.jar;D:\avue\lib\xerces.jar;D:\avue\lib\xalan.jar;D:\avue\lib\cocoon.jar;D:\avue\lib\avalonapi.jar;D:\avue\lib\logkit.jar;D:\avue\lib\maybeupload.jar;D:\avue\lib\jakarta-regexp-1.2.jar;D:\avue\lib\jstyle.jar;D:\avue\lib\javac.jar;D:\weblogic\lib\weblogic510sp6boot.jar;D:\weblogic\classes\boot;
    DEBUG 109 [cocoon  ] (ExecuteThread-11): Work directory =
    D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war
    DEBUG 125 [cocoon  ] (Thread-0): ComponentFactory creating new
    instance of org.apache.cocoon.components.parser.JaxpParser.
    DEBUG 140 [cocoon  ] (Thread-0): ComponentFactory creating new
    instance of org.apache.cocoon.components.parser.JaxpParser.
    DEBUG 140 [cocoon  ] (Thread-0): ComponentFactory creating new
    instance of org.apache.cocoon.components.parser.JaxpParser.
    DEBUG 140 [cocoon  ] (Thread-0): ComponentFactory creating new
    instance of org.apache.cocoon.components.parser.JaxpParser.
    DEBUG 390 [cocoon  ] (ExecuteThread-11): Root configuration:
    cocoon
    DEBUG 390 [cocoon  ] (ExecuteThread-11): Configuration version:
    2.0
    DEBUG 390 [cocoon  ] (ExecuteThread-11): Setting up components...
    DEBUG 406 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.parser.Parser =
    org.apache.cocoon.components.parser.JaxpParser)
    DEBUG 406 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.language.generator.ProgramGenerator =
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl)
    DEBUG 406 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.url.URLFactory =
    org.apache.cocoon.components.url.URLFactoryImpl)
    DEBUG 406 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.saxconnector.SAXConnector =
    org.apache.cocoon.components.saxconnector.NullSAXConnector)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.avalon.util.datasource.DataSourceComponentSelector =
    org.apache.cocoon.components.CocoonComponentSelector)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.avalon.util.pool.PoolController =
    org.apache.cocoon.components.ComponentPoolController)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.language.programming.ProgrammingLanguageSelector
    = org.apache.cocoon.components.CocoonComponentSelector)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.language.markup.MarkupLanguageSelector =
    org.apache.cocoon.components.CocoonComponentSelector)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.store.Store =
    org.apache.cocoon.components.store.MemoryStore)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Adding component
    (org.apache.cocoon.components.classloader.ClassLoaderManager =
    org.apache.cocoon.components.classloader.ClassLoaderManagerImpl)
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Setting up the sitemap.
    DEBUG 422 [cocoon  ] (ExecuteThread-11): Sitemap location =
    sitemap.xmap
    DEBUG 703 [cocoon  ] (ExecuteThread-11): ComponentFactory creating
    new instance of org.apache.cocoon.components.url.URLFactoryImpl.
    DEBUG 703 [cocoon  ] (ExecuteThread-11): Getting the URLFactories
    DEBUG 703 [cocoon  ] (ExecuteThread-11): for protocol:
    resource org.apache.cocoon.components.url.ResourceURLFactory
    DEBUG 718 [cocoon  ] (ExecuteThread-11): for protocol: context
    org.apache.cocoon.components.url.ContextURLFactory
    DEBUG 718 [cocoon  ] (ExecuteThread-11): Beginning sitemap
    regeneration
    DEBUG 718 [cocoon  ] (ExecuteThread-11): Making URL from
    file:/D:/Programs/cocoon-1.8.2/samples/sitemap.xmap
    DEBUG 718 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.
    DEBUG 718 [cocoon  ] (Thread-1): Could not find ComponentHandler,
    attempting to create one for role:
    org.apache.cocoon.components.language.generator.ServerPagesSelector
    DEBUG 718 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.generator.GeneratorSelector.
    DEBUG 718 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.
    DEBUG 718 [cocoon  ] (Thread-1): CocoonComponentSelector setting
    up with root element:
    DEBUG 718 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of org.apache.cocoon.components.CocoonComponentSelector.
    DEBUG 718 [cocoon  ] (Thread-1): CocoonComponentSelector setting
    up with root element: markup-languages
    DEBUG 734 [cocoon  ] (Thread-1): Adding
    org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage for
    xsp
    DEBUG 734 [cocoon  ] (Thread-1): Adding
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage
    for sitemap
    DEBUG 734 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of org.apache.cocoon.components.CocoonComponentSelector.
    DEBUG 734 [cocoon  ] (Thread-1): CocoonComponentSelector setting
    up with root element: programming-languages
    DEBUG 750 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.programming.java.JavaLanguage.
    DEBUG 750 [cocoon  ] (Thread-1): Looking up
    org.apache.cocoon.components.classloader.ClassLoaderManager
    DEBUG 750 [cocoon  ] (Thread-1): Setting the parameters
    DEBUG 750 [cocoon  ] (Thread-1): Adding
    org.apache.cocoon.components.language.programming.java.JavaLanguage for
    java
    DEBUG 765 [cocoon  ] (Thread-1): The instance was not accessible,
    creating it now.
    DEBUG 765 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
    DEBUG 1718 [cocoon  ] (Thread-1): Making URL from
    jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
    DEBUG 1718 [cocoon  ] (Thread-1): Logicsheet
    Used:jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
    WARN 4109 [cocoon  ] (Thread-1): Could not load class for program
    'org\apache\cocoon\www\sitemap_xmap'
    java.security.AccessControlException: access denied
    (java.io.FilePermission
    \D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
    at
    java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at
    java.security.AccessController.checkPermission(AccessController.java:399)
    at
    java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.net.URLClassLoader$5.run(URLClassLoader.java:463)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.getPermissions(URLClassLoader.java:461)
    at
    java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at
    org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.loadClass(ClassLoaderManagerImpl.java:58)
    at
    org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:121)
    at
    org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:163)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 4109 [cocoon  ] (Thread-1): Language Exception
    org.apache.cocoon.components.language.LanguageException: Could not load
    class for program 'org\apache\cocoon\www\sitemap_xmap' due to a
    java.security.AccessControlException: access denied
    (java.io.FilePermission
    \D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
    at
    org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:124)
    at
    org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:163)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 4109 [cocoon  ] (Thread-1): ComponentFactory decommissioning
    instance of
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
    DEBUG 4109 [cocoon  ] (Thread-1): Can't load ServerPage
    org.apache.avalon.ComponentManagerException: Could not add component for
    class: org.apache.cocoon.www.sitemap_xmap
    at
    org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:61)
    at
    org.apache.cocoon.components.language.generator.GeneratorSelector.select(GeneratorSelector.java:50)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.select(ProgramGeneratorImpl.java:263)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:172)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 4109 [cocoon  ] (Thread-1): ComponentFactory creating new
    instance of
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
    DEBUG 4359 [cocoon  ] (Thread-1): Making URL from
    jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
    DEBUG 4359 [cocoon  ] (Thread-1): Logicsheet
    Used:jar:file:/D:/avue/lib/cocoon.jar!/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
    WARN 6109 [cocoon  ] (Thread-1): Could not load class for program
    'org\apache\cocoon\www\sitemap_xmap'
    java.security.AccessControlException: access denied
    (java.io.FilePermission
    \D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
    at
    java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at
    java.security.AccessController.checkPermission(AccessController.java:399)
    at
    java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.net.URLClassLoader$5.run(URLClassLoader.java:463)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.getPermissions(URLClassLoader.java:461)
    at
    java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at
    org.apache.cocoon.components.classloader.ClassLoaderManagerImpl.loadClass(ClassLoaderManagerImpl.java:58)
    at
    org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:121)
    at
    org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:210)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 6109 [cocoon  ] (Thread-1): Language Exception
    org.apache.cocoon.components.language.LanguageException: Could not load
    class for program 'org\apache\cocoon\www\sitemap_xmap' due to a
    java.security.AccessControlException: access denied
    (java.io.FilePermission
    \D:\Programs\cocoon-1.8.2\samples\WEB-INF\_tmp_war\- read)
    at
    org.apache.cocoon.components.language.programming.java.JavaLanguage.loadProgram(JavaLanguage.java:124)
    at
    org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:119)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:245)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:210)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 6109 [cocoon  ] (Thread-1): ComponentFactory decommissioning
    instance of
    org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage.
    ERROR 6109 [cocoon  ] (Thread-1): Error compiling sitemap
    org.apache.avalon.ComponentManagerException: Could not add component for
    class: org.apache.cocoon.www.sitemap_xmap
    at
    org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:61)
    at
    org.apache.cocoon.components.language.generator.GeneratorSelector.select(GeneratorSelector.java:50)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.select(ProgramGeneratorImpl.java:263)
    at
    org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:219)
    at org.apache.cocoon.sitemap.Handler.run(Handler.java:173)
    at java.lang.Thread.run(Thread.java:484)
    DEBUG 6109 [cocoon  ] (ExecuteThread-11): Changing Cocoon
    context(sitemap.xmap) to prefix()
    DEBUG 6109 [cocoon  ] (ExecuteThread-11): from
    context(file:/D:/Programs/cocoon-1.8.2/samples/) and prefix()
    DEBUG 6109 [cocoon  ] (ExecuteThread-11): at URI
    DEBUG 6109 [cocoon  ] (ExecuteThread-11): New context is
    file:/D:/Programs/cocoon-1.8.2/samples/
    ERROR 6140 [cocoon  ] (ExecuteThread-11): Problem with servlet
    org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is
    not available.
    at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:106)
    at org.apache.cocoon.Cocoon.process(Cocoon.java:218)
    at
    org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:417)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:123)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:761)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:708)
    at
    weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252)
    at
    weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:346)
    at
    weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
    INFO 6187 [cocoon  ] (ExecuteThread-11): '' Processed by Apache
    Cocoon 2.0a4 in 5.75 seconds.
    ================================================================
    Regards,
    Georgi

  • Problem loading modified classes from CLASSPATH using system class loader

    Hi,
    I am facing problem to load the modified classes from CLASSPATH.
    I have set my CLASSPATH to a directory whose classes will be modified frequently. After the server(web/app) is started, the system class loader, using which am trying to load the classes from the directory where the CLASSPATH is set, am not able to load the modified files without the server restart.
    Do I need to have a custom class loader to fix this.
    Please help me.
    Thanks,
    Sureddy

    Do I need to have a custom class loader to fix this.Yes.

  • Help Needed on a similar but not same class loader problem

    Hi,
    Please help...
    There is a ClassLoader called MyLoader that overrides default findClass() method to decrypt already encrypted class files available in a separate jar file.
    MyClass also contains a public static method launchMe() method that starts off with a call similar to loadClass("ApplicationMainClass");
    The MyLoader class is also encrypted
    I modified the default launcher (c) code to:
    First find the encrypted MyLoader file then decrypt it and create a byte array.
    The byte array, along with the system class loader and other required arguments, is passed to DefineClass native method (defined in jvm.dll)
    Note: The system class loader class has been instantiated using static method ClassLoader.getSystemClassLoader() through Java's invocation API.
    The DefineClass succeeds and I'm able to instantiate MyLoader and later call launchMe() to start application.
    Now i come to the problem:
    I'm not able to use any class other that those in rt.jar (i.e.standard classes) in MyLoader class. I end up with a runtime error ClassDefNotFoundError while trying to load any third party jar.
    The classes i need are present in class path and also in the local jre's ext that i use to launch my app.
    Although i can avoid using third party jar in MyLoader but if there is any way...
    Piyush

    make sure that third party jar resides in your library.....
    or else put rt.jar and external jars under same folder
    this is matter of path.... no else than this.......
    cheers
    Rajesh42

  • JVMPI class load event problem

    Hi
    I'm trying to write a simple profiler using JVM Profiler Interface to
    display classes loaded while running my application.
    For this, I have registered callback to notify two events
    JVMPI_EVENT_CLASS_LOAD and JVMPI_EVENT_CLASS_LOAD_HOOK.
    Now the problem is that, for some system classes which are loaded
    initialy(during JVM initialization) I'm not getting
    JVMPI_EVENT_CLASS_LOAD_HOOK event. However JVMPI_EVENT_CLASS_LOAD gets
    called for each of them. ( I want .._LOAD_HOOK for all classes)
    I gone through some documents/links which says that
    JVMPI_EVENT_CLASS_LOAD_HOOK will be sent only after
    JVMPI_EVENT_JVM_INIT_DONE event is sent.
    I want JVMPI_EVENT_CLASS_LOAD_HOOK event for all classes, even they
    are loaded before JVM initialization is complete.
    Is there any way to achieve this? Any work arround?
    I'm using J2SDK 1.4.2.
    Thanks in advance
    Rohan

    I want JVMPI_EVENT_CLASS_LOAD_HOOK event for allThe JVMPI api was always experimantal. It has now been superseded by the JVM TI work done for Tiger as part of JSR-163.
    This article describes the new API and how to make the transition:
    The JVMPI Transition to JVMTI
    http://java.sun.com/developer/technicalArticles/Programming/jvmpitransition/
    Is there any way to achieve this? Any work arround?When your monitoring agent gets control after JVMTI_EVENT_VM_INIT, use the GetLoadedClasses method to return all of the classes loaded up to that point.
    If you also request notification for all subsequently loaded classes (via JVMTI_EVENT_CLASS_FILE_LOAD_HOOK) then after suspending the VM you should have information on all classes loaded since the genesis of the VM.
    The HPROF profiling agent was converted to use the new class loading notification mechanism. Refer to the
    I'm using J2SDK 1.4.2.I suggest you update your project to use the new APIs provided with JSRs 163 and 174.

  • Problem with dynamic class loading

    Hi,
    We have a class file in an external jar(outside ear) and access it in an ear using classloader.loadClass method. But if the class file is changed in jar, it gets hotdeployed in jboss but code which calls this class still refers to the old code.
    Class getClassByName(String className) throws ClassNotFoundException {
    Class theClass = null;
    try {
    theClass = Thread.currentThread().getContextClassLoader().loadClass(className);
    } catch (ClassNotFoundException e) {
    theClass = getClass().getClassLoader().loadClass(className);
    return theClass;
    When I looked into api I came to know that loadClass actually loads the class if it is not already exists. Can any one help me in writing thecustom class loader which loads the class everytime instead of checking previous instance before loading......
    Thanks,
    Kruthika

    You probably have to get rid of the class loader that loads the original version and start with a new class loader.

  • Problem lies some where JVM Class Loader

    I suspect that the jar files are in the JPI cache. During applet initialization, the various classes start loading. Then, because of the page trasition,
    the applet gets shutdown by the Java Plug In. Because it doesn't terminate quickly enough, the JPI starts killing threads (java.lang.ThreadDeath).
    The classloader seems to be ungraceful in handling that situation. This seems to leave the classloader's internal state in an inconsitent state.
    Therefore, until the JVM is restarted, the class loading fails.
    Thanks and Regards
    Manoja

    I suspect that the jar files are in the JPI cache. During applet initialization, the various classes start loading. Then, because of the page trasition,
    the applet gets shutdown by the Java Plug In. Because it doesn't terminate quickly enough, the JPI starts killing threads (java.lang.ThreadDeath).
    The classloader seems to be ungraceful in handling that situation. This seems to leave the classloader's internal state in an inconsitent state.
    Therefore, until the JVM is restarted, the class loading fails.
    Thanks and Regards
    Manoja

  • Dynamic class loading. *Problem*

    Hi.
    This is a strange one:
    I'm compiling a java file dynamically and i try to load it using the current class loader. The usual way to do so is- this.getClass().getClassLoader() etc.
    Now the strange part: the class loader is looking for the class file only in the class-path in which the java application was first run. There is no way to tell it to look in other directories, including the user current directory!
    Changing the System properties of class path and library path do not help. The loader just remembers the initial class path and looks only there. It can't be told to look anywhere else!
    Anyone has any idea how to make it look elsewhere ???? is it possible ???
    Thanks!
    Gil

    2. i need to load the class to the same JVM (i.e. to
    the same environment) of the current running
    aplication, so that when the loaded class is run, it
    would be able to invoke methods on it!!!
    ClassLoader(s) do this. Try the URLClassLoader.
    (I was talking about relatively esoteric "security"
    issues when I mentioned the stuff about Class objects
    "scope".) You might use the URLClassLoader kind of
    like this.
    Pseudo-code follows:
    // setup the class loader
    URL[] urls = new URL[1];
    urls[0] = new URL("/path/to/dynamic/classes");
    URLClassLoader ucl = new URLClassLoader(urls);
    // load a class & use make an object with the default constructor
    Object tmp = ucl.loadClass("dynamic.class.name").newInstance();
    // Cast the object to a know interface so that you can use it.
    // This may be used to further determine which interface to cast
    // the class to. Or it may simply be the interface to which all
    // dynamic classes have to conform in your program.
    InterfaceImplementedByDynamicClass loadedObj =
        (InterfaceImplementedByDynamicClass)tmp;It's really not as hard as it sounds, just write a little test of
    this and you will see how it works.

  • How to load a class dynamically in the current/system class loader

    I need to dynamically load a new jdbc driver jar to the current/system class loader... Please note that creating a new classloader will not help since the DriverManager refers to the systemclassloader itself.
    Restarting the application by appending the jar to its classpath will solve the problem but I want to avoid doing this.

    Did you then create a ClassLoader to load the JDBC
    driver and then install it into the system as
    directed by the JDBC specification (ie
    Class.forName(someClassName))?
    And then try to use it from a class loaded fromsome
    other ClassLoader (i.e. the system class loader)?
    If you did not try this please explain why not.O.K. I just looked at the source to
    java.sql.DriverManager. I did not know what I was
    talking about, as what I suggested above will not
    work.
    This is my new Idea:
    Create a URLClassLoader to load the JDBC driver also
    in this ClassLoader you need to place a helper class
    that does the following:
    public class Helper {
    public Driver getJDBCDriver(String driverClassName,
    String url) {
    try {
    Class.forName(driverClassName);
    Driver d = DriverManager.getDriver(url);
    return d;
    catch(Exception ex) {
    ex.printStackTrace();
    return null;
    }Now create an instance of the Helper class in the new
    ClassLoader, and call its getJDBCDriver method to get
    an instance of the driver (you will probably have to
    create an interface in the root class loader that the
    Helper implements so that you can easily call it).
    Now from the root classloader you can make calls
    directly to the returned Driver and bypass the
    DriverManager and its restrictions on cross
    ClassLoader access.
    The only catch here is that you would have to call to
    the returned Driver directly and not use the Driver
    Manager.This sounds like will work but I did not want to load DriverManager in a new classloader.. I did a hack
    I unzip the jar dynamically in a previously known location (which I included in my classpath when launching the app). The classLoader finds the class now though it did not exist when the app was launched !
    A hack of-course but works eh ..

  • Performance issues with class loader on Windows server

    We are observing some performance issues in our application. We are Using weblogic 11g with Java6 on a windows 2003 server
    The thread dumps indicate many threads are waiting in queue for the native file methods:
    "[ACTIVE] ExecuteThread: '106' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE
         java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
         java.io.File.exists(Unknown Source)
         weblogic.utils.classloaders.ClasspathClassFinder.getFileSource(ClasspathClassFinder.java:398)
         weblogic.utils.classloaders.ClasspathClassFinder.getSourcesInternal(ClasspathClassFinder.java:347)
         weblogic.utils.classloaders.ClasspathClassFinder.getSource(ClasspathClassFinder.java:316)
         weblogic.application.io.ManifestFinder.getSource(ManifestFinder.java:75)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.application.utils.CompositeWebAppFinder.getSource(CompositeWebAppFinder.java:71)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.utils.classloaders.MultiClassFinder.getSource(MultiClassFinder.java:67)
         weblogic.utils.classloaders.CodeGenClassFinder.getSource(CodeGenClassFinder.java:33)
         weblogic.utils.classloaders.GenericClassLoader.findResource(GenericClassLoader.java:210)
         weblogic.utils.classloaders.GenericClassLoader.getResourceInternal(GenericClassLoader.java:160)
         weblogic.utils.classloaders.GenericClassLoader.getResource(GenericClassLoader.java:182)
         java.lang.ClassLoader.getResourceAsStream(Unknown Source)
         javax.xml.parsers.SecuritySupport$4.run(Unknown Source)
         java.security.AccessController.doPrivileged(Native Method)
         javax.xml.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
         javax.xml.parsers.FactoryFinder.findJarServiceProvider(Unknown Source)
         javax.xml.parsers.FactoryFinder.find(Unknown Source)
         javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
         org.ajax4jsf.context.ResponseWriterContentHandler.<init>(ResponseWriterContentHandler.java:48)
         org.ajax4jsf.context.ViewResources$HeadResponseWriter.<init>(ViewResources.java:259)
         org.ajax4jsf.context.ViewResources.processHeadResources(ViewResources.java:445)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:193)
         org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
         org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
    On googling this seems to be an issue with java file handling on windows servers and I couldn't find a solution yet. Any recommendation or pointer is appreciated

    Hi shubhu,
    I just analyzed your partial Thread Dump data, the problem is that the ajax4jsf framework ResponseWriterContentHandler triggers internally a new instance of the DocumentBuilderFactory; every time; triggering heavy IO contention because of Class loader / JAR file search operations.
    Too many of these IO operations under heavy load will create excessive contention and severe performance degradation; regardless of the OS you are running your JVM on.
    Please review the link below and see if this is related to your problem.. This is a known issue in JBOSS JIRA when using RichFaces / ajaxJSF.
    https://issues.jboss.org/browse/JBPAPP-6166
    Regards,
    P-H
    http://javaeesupportpatterns.blogspot.com/

  • How can I make server use single class loader for several applications

    I have several web/ejb applications. These applications use some common libraries and should share instances of classes from those libraries.
    But applications are being deployed independently thus packaging all them to EAR is not acceptable.
    I suppose the problem is that each application uses separate class loader.
    How can I make AS use single class loader for a set of applications?
    Different applications depend on different libraries so I need a way that will not share library for all applications on the domain but only for some exact applications.
    When I placed common jar to *%domain%/lib* - all works. But that jar is shared between all applications on the domain.
    When I tried to place common jar to *%domain%/lib/applibs* and specified --libraries* attribute on deploying I got exception
    java.lang.ClassCastException: a.FirstDao cannot be cast to a.FirstDaoHere http://download.oracle.com/docs/cd/E19879-01/820-4336/6nfqd2b1t/index.html I read:
    If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared.
    This can reduce the memory footprint and allow sharing of static information.Does it mean that classes should be able to be casted ?

    You didn't specify which version of the application server you are using, but the config is similar as long as you know what to look for. Basically, you need to change the classloader delegation. Here's how it is done in 8.2
    http://download.oracle.com/docs/cd/E19830-01/819-4721/beagb/index.html

Maybe you are looking for

  • How do I get a .LIS to work with firefox?

    I use Firefox at work because I simply like it better. Before we upgraded our computers to windows 7 enterprise with service pack 1 I could use Swiftview for viewing our payment processes, it uses a .LIS extension, but now I have to save everything b

  • Error while creating adaptive RFC model

    Dear All, I am trying to create Adaptive RFC model by  which i can fetch data from R/3 trough BAPI and display on the webDynpro UI. I am getting error Exception: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.ExceptionInInitializ

  • App store not registering my new apple ID

    I changed my apple ID and signed out and back in with it in my app store settings on my iphone but it still won't come up correctly when I try to update or buy apps. Heelllppppp.

  • LMS 3.2.1 RCP Failed

    Hi, I am using LMS 3.2.1 and unable to do the Software Repository job via RCP, because of the below error message. Problem: SW1#copy flash1:c2960s-universalk9-mz.150-1.SE.bin rcp://cwuser@CW-IPAddress:/CSCOpx/temp/rep_sw_4972128000394429365 Address o

  • Running 2 separate programs at once w/ RMI

    Hello Java forum. I am coding a stock market simulator with Java. I need the stock prices to be CONSTANTLY dynamic. So what I have is a driverClass that is the front for the market sim. It displays the stock prices and such, and therefor must grab va