Bug 26433 - JMX problem org.apache.log4j.Level not serializable
Summary: JMX problem org.apache.log4j.Level not serializable
Status: RESOLVED FIXED
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.2
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
: 34758 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-26 11:21 UTC by Lars Wunderlich
Modified: 2005-08-21 16:46 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wunderlich 2004-01-26 11:21:32 UTC
There is a JMX problem in LOG4J 1.2.8, the class org.apache.log4j.Level is not 
serializable. In a simple JMX request 
I got an unserializable exception. Here is a code snippet of an example code.


Content of getContent method:

    import weblogic.management.RemoteMBeanServer;

    import javax.management.Attribute;
    import javax.management.MBeanAttributeInfo;
    import javax.management.MBeanInfo;
    import javax.management.ObjectName;
   
    [...]

    private MBeanAttributeInfo attrInfo = null;
    private RemoteMBeanServer homeServer = null;
     
     [...]

        try {
            value = homeServer.getAttribute(new ObjectName(domain + ":" +
                        mbeanName), attrInfo.getName());
        } catch (Exception e) {
            e.printStackTrace();
        }
        
where homeServer is a reference to a RemoteMBeanServer instance by Weblogic, 
domain is "log4j", mbeanName is 
"appender=MUSYK1" (defined in log4j.properties file) and attrInfo.getName() 
is "encoding".


weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with 
nested exception:
[java.rmi.MarshalException: error marshalling return; nested exception is: 
	java.io.NotSerializableException: org.apache.log4j.Level]
	at 
weblogic.management.internal.RemoteMBeanServerImpl_812_WLStub.getAttribute
(Unknown Source)
	at tui.musyk.weblogic.jmx.gui.model.MBeanAttributeProxy.getContent
(MBeanAttributeProxy.java:61)
[...]
Comment 1 mkopp 2004-10-12 12:07:37 UTC
I have kind of the same problem. This is not a hard fix and would not break
anything. Can somebody confirm if this goes into the next version.
Comment 2 Yoav Shapira 2004-12-13 21:02:00 UTC
It should be easy to make the Level class implement Serializable.  Please ask 
on the log4j-dev list to make sure none of the committers object.
Comment 3 Mark Womack 2005-07-01 19:58:06 UTC
1.2.12 candidate
Comment 4 Curt Arnold 2005-07-18 19:06:07 UTC
Committed on log4j CVS HEAD and 1.2 branch.  Versions appears to be binary
compatible.  Adding LoggingEvent serialization tests, but they are not currently
binary compatible.
Comment 5 Curt Arnold 2005-08-22 00:46:04 UTC
*** Bug 34758 has been marked as a duplicate of this bug. ***