[logback-user] Class not found exception for LoggingEventVO

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


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) 

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

                                // Create a new logger using the logging 
event name
                                CSGStandardLogger logLocal = new 

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

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.


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 
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?



Logback-user mailing list
Logback-user at qos.ch

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

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