1 Reply Latest reply on Dec 3, 2008 7:34 AM by Martin Burger

    Javassist class loader vs. Apache Commons logging

    diet ice Newbie

      Hi all,

      I want to instrument an application that uses the Apache Commons logging component. I use the Javassist class loader and have added my own translator. However, the logging library seems to rely on the class loader hierarchy; the application crashes with the attached exception.

      Do you have any experience combining Javassist and the Apache Commons logging component?

      Regards,
      Michael



      org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.))
      at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
      at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
      at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
      at org.java.plugin.ObjectFactory.newInstance(ObjectFactory.java:80)
      at org.java.plugin.ObjectFactory.newInstance(ObjectFactory.java:51)
      at net.sf.jabref.plugin.PluginCore.initialize(PluginCore.java:72)
      at net.sf.jabref.plugin.PluginCore.getManager(PluginCore.java:180)
      at net.sf.jabref.imports.ImportFormatReader.resetImportFormats(ImportFormatReader.java:74)
      at net.sf.jabref.JabRef.<init>(JabRef.java:103)
      at net.sf.jabref.JabRef.main(JabRef.java:79)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at net.sf.jabref.JabRefMain.main(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at javassist.Loader.run(Loader.java:290)