RE: Object Messages

"Ben Farr" <[email protected]>
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
Hi,

I am developing a logging application which is sending ObjectMessages to
a Jms queue. I am targeting JBOSS 4 where the application seems to run
fine within JBOSS JMS server. However I also have to support Tomcat /
openjms configuration.

 

At the moment I am getting a Class not found exception on the queue
listener class. The class not found it refers to is within the war file
deployed. Connection to JMS is being done through tcp connector.

The object sent is serialised ok. Does anyone have any experience with
something like this ?

 

Thanks

 

Ben 

 

DEBUG 2005-08-04 20:31:54 QueueListener.java errorLog - Recieved Object
Message : org.exolab.jms.message.ObjectMessageImpl@1cc5af0

ERROR 2005-08-04 20:31:54 QueueListener.java errorLog - Problem with
Message:
com.surfkitchen.proxy.logging.LogBeanjavax.jms.MessageFormatException:
com.surfkitchen.proxy.logging.LogBean            at
org.exolab.jms.message.ObjectMessageImpl.getObject(ObjectMessageImpl.jav
a:223)

            at
com.surfkitchen.proxy.jms.QueueListener.onMessage(QueueListener.java:92)

            at
org.exolab.jms.client.JmsMessageConsumer.onMessage(JmsMessageConsumer.ja
va:292)

            at
org.exolab.jms.client.JmsSession.execute(JmsSession.java:669)

            at
org.exolab.jms.client.JmsSession.onMessage(JmsSession.java:607)

            at
org.exolab.jms.client.mipc.IpcJmsMessageListener.onMessage(IpcJmsMessage
Listener.java:154)

            at
org.exolab.jms.client.mipc.IpcJmsMessageListener.run(IpcJmsMessageListen
er.java:225)

            at java.lang.Thread.run(Thread.java:534)

ERROR 2005-08-04 20:31:54 QueueListener.java errorLog - Problem with
Message:  Linked Exception: java.lang.ClassNotFoundException:
com.surfkitchen.proxy.logging.LogBean

 

-----------------------------------------------------------

public class LogBean implements DriverBeanIF, Serializable

{

            private Download download;

            private transient HttpServletResponse response;

            private transient HttpServletRequest request;

            private int exceptionCount = 0;

            private int logCount = 0;

            // Do not want to send accross JMS serialized

            private transient Properties defaultProperties;

            private transient Properties deviceProperties;

            private String qrMethod;

            private String qrClass;

            private Map qrMap = new HashMap();

......

}

------------------------------------------------------------------------
------------

 

QueueListener ------------------------------------------------------

                        public void onMessage(Message message) {

                        String id = "unset";

                        int priority = -1;

                        long expiration = -1;

                        LogBean logBean = null;

                        String object = "";

                        try

                        {

                                    ObjectMessage objectMessage =
(ObjectMessage) message;

                                    object = objectMessage.toString();

                                    logger.debug("Recieved Object
Message : " + objectMessage.toString());

                                    logger.debug("Object.toString() : "
+ objectMessage.getObject().toString());

                                    logBean = (LogBean)
(objectMessage.getObject());

                                    logger.debug("Converted to LogBean:"
+logBean);

                    id = message.getJMSMessageID();

                    logBean.setMessageReceived(new
Date(message.getJMSTimestamp()));

                    logBean.setMessageId(id);

                        }

                        catch (JMSException e)

                        {

                                    StringWriter sw = new
StringWriter();

                                    PrintWriter pw = new
PrintWriter(sw);

                                    e.printStackTrace(pw);

                                    logger.error("Problem with Message:
" + e.getMessage() + sw.getBuffer().toString());

                                    logger.error("Problem with Message:
" + " Linked Exception: " +  e.getLinkedException());

                        }

------------------------------------------------------------------------
--------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.