[logback-user] Class not found exception for LoggingEventVO

Merritt H Derr MDerr at nycm.com
Fri Jan 13 14:54:37 CET 2012


Jim:

This was so long ago I'd forgotten about it. I was having this problem in 
the EJB that was receiving the logged message from the SIB. The final code 
that handled the message wound up being the following:

        private void handleMessage(Message msg) {
                try {
                        TextMessage text = (TextMessage) msg;
                        System.out.println("ServiceUtilityMDB: Input 
Message = "
                                        + text.getText());
                        System.out.println("End of handling message, no 
real work done");
                } catch (ClassCastException ce) {
                        ILoggingEvent logEvent;
                        try {
                                // Since an exception was thrown trying to 
treat the arriving
                                // message as text, now try to treat it as 
an object message.

                                ObjectMessage objMsg = (ObjectMessage) 
msg;

                                // Grab the LogBack logging event...
                                logEvent = (ILoggingEvent) 
objMsg.getObject();

                                // Create a new logger using the logging 
event name
                                CSGStandardLogger logLocal = new 
CSGStandardLogger(logEvent
                                                .getLoggerName());

                                // Use the logger callAppenders method to 
complete the logging tasks 
 logLocal.getLogger().callAppenders(logEvent);
                        } catch (NoClassDefFoundError ncd) {
                                ncd.printStackTrace();
                        } catch (MessageFormatException mfe) {
                                System.out
                                                .println("Message format 
exception occurred handling message.");
                                mfe.printStackTrace();
                        } catch (ClassCastException cce) {
                                System.out
                                                .println("object msg is 
not a JmsObjectMessageImpl instance");
                        } catch (Exception e) {
                                System.out
                                                .println("An exception 
occurred while retrieving the log event message from the queue.");
                                e.printStackTrace();
                        }
                } catch (Exception e) {
                        System.out.println("Exception " + e.getMessage());
                        e.printStackTrace();
                }

This code is called from the onMessage event in the EJB. The 
CSGStandardLogger is a Logback logger wrapped by us for specific purposes, 
but has no magic in it as far as the problem is concerned. Current version 
of Logback being used is 0.9.28. SLF4J is still at 1.6.1. I've lost the 
details of all the steps I took, but this code is the result of many 
searches, iterations of code etc. It works correctly in my environment.

Merritt



From:   Jim <james.rogers at tdameritrade.com>
To:     logback-user at qos.ch
Date:   01/11/2012 02:20 PM
Subject:        Re: [logback-user] Class not found exception for 
LoggingEventVO
Sent by:        logback-user-bounces at qos.ch



 <MDerr at ...> writes:

> 
> I have an application client set up to
> send a logging message over  a bus using a logback JMSQueueAppender.
>  Logback version is 0.9.24 and slf4j version is 1.6.1.
I am getting the same error.  Did you resolve this issue, and if so how?

Thanks,

Jim


_______________________________________________
Logback-user mailing list
Logback-user at qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user

Join us on Facebook at www.facebook.com/NYCMInsurance.


***CONFIDENTIALITY NOTICE***
This email and any attachments to it are confidential and intended solely 
for the individual or entity to whom it is addressed. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you have 
received this email in error, please contact the sender by reply email and 
destroy all copies of the original message. 




More information about the Logback-user mailing list