Flex, Java Remoting, and JMS [null message body]

So I was pounding out some code this afternoon, ran into a small snag and thought I’d post. Neuro-physiologists tell us that we better remember what we write down so here goes.

Similar to my post a few months ago, I made a simple omission in my coding flurry.

I was working with a backend Java class that published messages to [ActiveMQ] JMS. I wrote up a simple VO class to publish via JMS.

package com.dl.sifagents.vo;

import java.io.Serializable;

public class ZISEventVO implements Serializable
public String eventType = "";
public String payloadPackage = "";
public String payloadElement = "";
public String xml = "";

On the Flex side, I wrote up an AS3 implementation

package com.dl.sifagents.vo
public class ZISEventVO
public var eventType:String;
public var payloadPackage:String;
public var payloadElement:String;
public var xml:String;

I published the VO to JMS…

public void publishObjectToJMS(Serializable o)
try {
ObjectMessage message = _pubSession.createObjectMessage();
_publisher.publish(message, Message.DEFAULT_DELIVERY_MODE, Message.DEFAULT_PRIORITY, 5 * 60 * 1000);
} catch (JMSException e1) {

I received the JMS message in Flex (via BlazeDS) but the message body was null. I checked and doubled checked my Java VO implementation vs AS3 VO implementation and couldn’t find any naming conflicts or errors.

Then it hit me, in my haste I’d forgotten to upload the Java VO class to BlazeDS (i.e. to the WEB-INF/classes folder)!

That’s my piece of humble pie for the week 🙂 Back to work.

3 Replies to “Flex, Java Remoting, and JMS [null message body]”

  1. I was curious if you’ve ever experienced this: If I don’t include any of the java objects in the WEB-INF/classes folder, I can see that the messages from the ActiveMQ topics are at least attempting to make it through BlazeDS to the Flex client (I get the nice unable to convert JMS to Flex errors). If I copy the java object in to the WEB-INF/classes folder, however, BlazeDS no longer shows any recognition of receiving messages from the ActiveMQ topics. Unfortunately, the resources available for using JMS+ObjectMessages is practically non-existent beyond the BlazeDS configuration files 🙁 . I was wondering if you’ve every experienced this or had any thoughts?

  2. Doug,
    I haven’t had a chance to work with the JMS/BlazeDS combo lately so I’m afraid I don’t have much insight off hand…

    I’d look at the logging options available and drill down from there.


  3. I’m getting the same error.
    What I am trying to do is to send an object from the Flex to a Java receiver.
    I have a couple of member variables all of type String and for each variable I have setter and getter.
    I compiled the java class (same name as the flex’s class) and put it in the “BlazeDS Flex java JMS bridgetomcatwebappsblazedsWEB-INFclasses”

    This is what I’m doing in Flex:

    var msg:AsyncMessage = new AsyncMessage();
    var log:LogInfo = new LogInfo();
    log.setMessage(“Something Happened”);
    log.setMethodname(“Test Method Name”);
    msg.body = log;

    I’m getting the msg through however on the java side when I try to retrieve it:
    flexLog = (LogInfo) objectMessage.getObject();
    System.out.println(“getMessage: ” + flexLog.getMessage()); System.out.println(“getMessage: ” + flexLog.getMethodname());

    (Just printing it for now) …ALL is NULL.
    What am I doing wrong?
    Any suggestion?

Leave a Reply

Your email address will not be published. Required fields are marked *