Я пытаюсь получить мыло сообщение и отправить его в очередь JMS, но возвращать сообщение об ошибке:Отправка мыло сообщение в очереди JMS
Severe: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl cannot be cast to java.io.Serializable
at kics.green.acs.tr069.web.servlet.TR069ACSFrontController.createJMSMessageForjmsACSMessageQueue(TR069ACSFrontController.java:409)
at kics.green.acs.tr069.web.servlet.TR069ACSFrontController.sendJMSMessageToACSMessageQueue(TR069ACSFrontController.java:421)
at kics.green.acs.tr069.web.servlet.TR069ACSFrontController.processRequest(TR069ACSFrontController.java:165)
at kics.green.acs.tr069.web.servlet.TR069ACSFrontController.doPost(TR069ACSFrontController.java:297)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at net.balusc.http.multipart.MultipartFilter.doFilter(MultipartFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:232)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)
Severe: в kics.green.acs.tr069.web.servlet .TR069ACSFrontController.createJMSMessageForjmsACSMessageQueue (TR069ACSFrontController.java:409) Тяжелое: в kics.green.acs.tr069.web.servlet.TR069ACSFrontController.sendJMSMessageToACSMessageQueue (TR069ACSFrontController.java:421) Тяжелый: в kics.green.acs.tr069.web .servlet.TR069ACSFrontController.processRequest (TR069ACSFrontController.java:165) Сильный: at kics.green.acs.tr069.web.servlet.TR069ACSFrontController.doPost (TR069 ACSFrontController.java:297) Суровый: при javax.servlet.http.HttpServlet.service (HttpServlet.java:754) Тяжелый: при javax.servlet.http.HttpServlet.service (HttpServlet.java:847) Суровый: при org.apache.catalina.core.StandardWrapper.service (StandardWrapper.java:1539) Суровый: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:343) Сильный: at org.apache.catalina. core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:217) Суровый: at net.balusc.http.multipart.MultipartFilter.doFilter (MultipartFilter.java:73) Сильный: на org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:256) Суровый: на org.apache.catalina.core.ApplicationFilterChain.doFilter (Ap plicationFilterChain.java:217) Суровый: на org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:279) Суровый: на org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175) Суровый: на org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:655) Суровый: на org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:595) Суровый: у ком. sun.enterprise.web.WebPipeline.invoke (WebPipeline.java:98) Суровый: на com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke (PESessionLockingStandardPipeline.java:91) Сильный: на org.apache.catalina.core. StandardHostValve.invoke (StandardHostValve.java:162) Суровый: на org.apache.catalina.connector.CoyoteAdapter.doSer Vice (CoyoteAdapter.java:330) Суровый: на org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:231) Суровый: на com.sun.enterprise.v3.services.impl.ContainerMapper.service (ContainerMapper.java:232) Суровый: at com.sun.grizzly.http.ProcessorTask.invokeAdapter (ProcessorTask.java:828) Суровый: в com.sun.grizzly.http.ProcessorTask.doProcess (ProcessorTask.java:725) Суровый: на com.sun.grizzly.http.ProcessorTask.process (ProcessorTask.java:1019) Суровый: at com.sun.grizzly.http.DefaultProtocolFilter.execute (DefaultProtocolFilter.java:225) Суровый: at com. sun.grizzly.DefaultProtocolChain.executeProtocolFilter (DefaultProtocolChain.java:137) Суровый: at com.sun.grizzly.DefaultProtocolChain.execute (DefaultProtocolChain.java:104) Суровый: at com.sun.grizzly.DefaultProtocolChain.execute (DefaultProtocolChain.java:90) Сильный: на com.sun.grizzly.http.HttpProtocolChain.execute (HttpProtocolChain.java:79) Суровый: на com.sun .grizzly.ProtocolChainContextTask.doCall (ProtocolChainContextTask.java:54) Суровый: at com.sun.grizzly.SelectionKeyContextTask.call (SelectionKeyContextTask.java:59) Сильный: at com.sun.grizzly.ContextTask.run (ContextTask.java : 71) Суровый: at com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork (AbstractThreadPool.java:532) Суровый: at com.sun.grizzly.util.AbstractThreadPool $ Worker.run (AbstractThreadPool.java:513)) Тяжелый: на java.lang.Thread.run (Thread.java: 745)
Я использую ракушку 3.1.1.
Вот код:
private Message createJMSMessageForjmsACSMessageQueue(Session session, Object messageData) throws JMSException {
// TODO create and populate message to send
ObjectMessage om = session.createObjectMessage();
om.setObject((Serializable) messageData);
return om;
}
private void sendJMSMessageToACSMessageQueue(Object messageData) throws JMSException {
Connection connection = null;
Session session = null;
try {
connection = aCSMessageQueueFactory.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer messageProducer = session.createProducer(aCSMessageQueue);
messageProducer.send(createJMSMessageForjmsACSMessageQueue(session, messageData));
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (session != null) {
try {
session.close();
} catch (JMSException e) {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Cannot close session", e);
}
}
if (connection != null) {
connection.close();
}
}
Ошибка на этой линии:
om.setObject((Serializable) messageData);