You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by babu79 <to...@yahoo.co.in> on 2009/05/18 13:06:13 UTC

Failed to build body from bytes

My activeMQ version is 5.2.0 which is embedded inside Jboss4.2.2.Ga. when i
am sending an object message Using Active producer inside a servlet i am
getting the following exception 
 Failed to build body from bytes. Reason: java.io.IOException: No
ClassLoaders found for: com.corpus.biemedia.servlet.MailEx 
Here is my MailEx source code

public class MailEx implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String fromId;
	public String toId;
	public String subject;
	public String body;

	public String getFromId() {
		return fromId;
	}

	public void setFromId(String fromId) {
		this.fromId = fromId;
	}

	public String getToId() {
		return toId;
	}

	public void setToId(String toId) {
		this.toId = toId;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

}

    Here  is my MDB

public class ActiveMDB implements MessageListener {

	public void onMessage(Message arg0) {

		MailEx mail=null;
		ObjectMessage obj=null;
		
		try {

			if (arg0 instanceof ObjectMessage) {
				obj = (ObjectMessage) arg0;
				mail=(MailEx)obj.getObject();
				}
			SendMail.mail(mail);
		} catch (Exception e) {
			out.println(e.getMessage());
		}
	}
}
     
But when i am running stand alone Active Producer.I am not getting this
exception?In both the cases I used same jars.
Please provide links regarding Types of messages we  can use in jms.
Any help?thanks in advance.


-- 
View this message in context: http://www.nabble.com/Failed-to-build-body-from-bytes-tp23595322p23595322.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Failed to build body from bytes

Posted by Mario Siegenthaler <ms...@inventsoft.ch>.
Hi
>  Failed to build body from bytes. Reason: java.io.IOException: No
> ClassLoaders found for: com.corpus.biemedia.servlet.MailEx

I'd say you don't have the MailEx class on the same path as ActiveMQ.
I suspect it's not good enough to have it inside the webapp because
the activemq listener probably runs with only the
jboss-"system"-classpath. Did you try to put the JAR containing MailEx
inside common/lib or server/lib?

--Mario