dcsimg
Problem in passing a Custom Created Exception class through JMS
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Duke_Junior
Posted On:   Tuesday, January 15, 2002 03:28 AM

I am usin Swift MQ for the JMS Queue. I have a requirement where i have to pass a exception object to the client and this is a TJException class that is being created by me. the class is accessible by the various other classes in the same application and the object is getting created at different levels in the application. the exception object is contained in a Hashtable But when I try to stream the object to client there is a ClassNotFoundException raised by the swiftMQ implementation class. I have tried all possible things by the book to understand y the class is not avaiable to the implementation class but am not able to detect if can anyone give me solution to this i will be happy. folowing is the code and the error message that was disp   More>>

I am usin Swift MQ for the JMS Queue. I have a requirement where i have to pass a exception object to the client and this is a TJException class that is being created by me. the class is accessible by the various other classes in the same application and the object is getting created at different levels in the application. the exception object is contained in a Hashtable But when I try to stream the object to client there is a ClassNotFoundException raised by the swiftMQ implementation class. I have tried all possible things by the book to understand y the class is not avaiable to the implementation class but am not able to detect if can anyone give me solution to this i will be happy. folowing is the code and the error message that was displayed. If the DJException is replaced by the lava.lang.Exception object the Fuctionlity is working fine.

The place where the Object is put in the Hashtable

			
try
{
response = evaluator.evaluate(ruleSetDescriptor, object);
}
catch(DJException rhbe)
{
responseTable.put("exception",rhbe);
}


The place where the object is set to the ObjectMessage class

			
ObjectMessage senderMessage = queueSession.createObjectMessage();
senderMessage.setObject(senderResponse);


The Exception Class

			
public class TJException extends Exception
{
public TJException()
{
this("Internal Error contact System Admin if this error persist");
}

public TJException(String exceptionMessage)
{
super(exceptionMessage);
}
}


The error Message that was displayed

			
javax.jms.JMSException: java.lang.ClassNotFoundException: DJException
at com.swiftmq.jms.ObjectMessageImpl.setObject(ObjectMessageImpl.java:86)
at JMSResponseHandler.sendResponse(JMSResponseHandler.java:131)
at RequestHandler.run(RequestHandler.java:84)

   <<Less
About | Sitemap | Contact