Bugs item #470463, was opened at 2001-10-11 20:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=470463&group_id=22866
Category: JBossServer Group: v2.4 (stable) >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Scott M Stark (starksm) Summary: Conflict of categories when using log4j Initial Comment: We are in the process of migrating from Jboss 2.2.2 with Tomcat 3.2.2 (where log4j was not officially integrated). We have some MBeans (that extend org.jboss.util.ServiceMBeanSupport) containing static log4j categories (E.g. private static Category cat = Category.getInstance( UserSessionManager.class.getName () ) ; ) When using the packagename + class name for log4j category names, the system throws a ClassCastException. We believe we have tracked the problem down to the JbossCategoryFactory where it creates category instances irrespective of whether log4j has already created the same category. Our short term solution has been to change the names of our categories (for MBeans) to not conflict with the JbossCategory's, though a more long term solution might be to confirm the absence of a category before creating one. Info and Stack Trace Jboss version 2.4.1a with Tomcat 3.2.3 JDK Sun 1.3.1, also reproducable on 1.3 [Configuration] Could not create MBean ProsperPlan:service=UserSessionManager (somepackagehierarchy.UserSessionManager) [Configuration] java.lang.ClassCastException: org.apache.log4j.Category [Configuration] at org.jboss.util.ServiceMBeanSupport.<init> (ServiceMBeanSupport.java:52) [Configuration] at somepackagehierarchy.UserSessionManager.<init> (UserSessionManager.java:62) [Configuration] at java.lang.reflect.Constructor.newInstance(Native Method) [Configuration] at com.sun.management.jmx.MBeanServerImpl.internal_instant iate(MBeanServerImpl.java:2210) [Configuration] at com.sun.management.jmx.MBeanServerImpl.createMBean (MBeanServerImpl.java:761) [Configuration] at org.jboss.configuration.ConfigurationService.create (ConfigurationService.java:579) [Configuration] at org.jboss.configuration.ConfigurationService.loadConfig uration(ConfigurationService.java:381) [Configuration] at java.lang.reflect.Method.invoke(Native Method) [Configuration] at com.sun.management.jmx.MBeanServerImpl.invoke (MBeanServerImpl.java:1628) [Configuration] at com.sun.management.jmx.MBeanServerImpl.invoke (MBeanServerImpl.java:1523) [Configuration] at org.jboss.Main.<init> (Main.java:202) [Configuration] at org.jboss.Main$1.run (Main.java:116) [Configuration] at java.security.AccessController.doPrivileged(Native Method) [Configuration] at org.jboss.Main.main (Main.java:112) ---------------------------------------------------------------------- >Comment By: Scott M Stark (starksm) Date: 2001-11-26 15:49 Message: Logged In: YES user_id=175228 As of 2.4.4 we no longer use a custom Category subclass. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=470463&group_id=22866 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
