I'd like my webpage to receive messages via the Ajax plugin, so I'm trying to
use the demo code in my environment. The demo works for me (as long as I use
2 browsers, not 2 tabs with one browser).
On the webpage the javascript call to amq.addPollHandler(portfolioPoll) is
made, invoking AjaxServlet on the server which loads and then throws the
exception.
I have put <Manager pathname="" /> in my content.xml to try and get the
webserver to not serialize AjaxServlet, but it doesn't seem to help.
The error looks like this:
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1293)
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1254)
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:130)
org.apache.activemq.web.MessageListenerServlet.getListener(MessageListenerServlet.java:394)
org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:267)
org.apache.activemq.web.MessageListenerServlet.doGet(MessageListenerServlet.java:241)
org.apache.activemq.web.AjaxServlet.doGet(AjaxServlet.java:46)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
The webpage looks like this:
<html>
<head>
<title>MessageListener Test</title>
<script type="text/javascript" src="amq/amq.js"></script>
<script type="text/javascript">amq.uri='amq';</script>
<script type="text/javascript">
var priceHandler =
{
_price: function(message)
{
alert(message);
}
};
function portfolioPoll(first)
{
if (first)
{
amq.addListener('stocks','topic://STOCKS.*', priceHandler._price);
}
}
amq.addPollHandler(portfolioPoll); // alert(amq);
shows amq is created
okay
</script>
</head>
<body>
<h1>Message Listener</h1>
<hr/>
<div id="result"></div>
</body>
</html>
Any hints as to what might be the problem? Thanks!
--
View this message in context:
http://www.nabble.com/AjaxServlet-IllegalArgumentException%3A-setAttribute%3A-Non-serializable-attribute-tp25070812p25070812.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.