-
1. Re: Serializable problem, object makes a vanishing act.
arutha Aug 31, 2007 8:11 AM (in response to arutha)
This issue is really locking me down.
Isn't there any suggestion at all ? -
2. Re: Serializable problem, object makes a vanishing act.
marklittle Aug 31, 2007 8:44 AM (in response to arutha)Have you looked at the jBPM quickstarts and tried modifying them?
-
3. Re: Serializable problem, object makes a vanishing act.
marklittle Aug 31, 2007 8:50 AM (in response to arutha)Also, have you tried printing out the message? toString() on the Message should show you everything that is within your Message, no matter where it occurs.
-
4. Re: Serializable problem, object makes a vanishing act.
kconner Aug 31, 2007 8:59 AM (in response to arutha)"Arutha" wrote:
My problem is this: I tied in the jBPM orchestration with this very same application, and as soon as I send the Serializable over the bus through the process definition now, it comes out the other end in the message.getBody().getContents(), but the get() method, returning an object, is empty this time.
If you are using BODY_CONTENT then this is how the ObjectMapper currently works.
The only way to pass in an object and have it retrieved intact is to add it into the message body as a named object and then use this name in the mapping.message.getBody().add("MyObjectName", obj) ; and <variable esb-name="MyObjectName" jbpm-name="theBody" />
-
5. Re: Serializable problem, object makes a vanishing act.
arutha Sep 1, 2007 12:57 PM (in response to arutha)Yes, I walked through all the related quickstart samples.
And I printed the message body, so far I've called just about every Message getter to see what's where.
I'm not adding the Pojo in the way specified by Kevin, as in the tutorial, creating an ObjectMessage stores the object in the default 'first' location, calling message.getBody().get() retrieves this default object, which is in my case NULL. -
6. Re: Serializable problem, object makes a vanishing act.
marklittle Sep 1, 2007 4:24 PM (in response to arutha)So what did you see when you printed out the message? Can you cut-and-paste it here?
-
7. Re: Serializable problem, object makes a vanishing act.
arutha Sep 5, 2007 9:49 AM (in response to arutha)
Right, bare in mind that the code-parts of this post are context-sensitive, but it's a clear before-after shot.
The first service, listening on the gateway and picking up the Serializable object picks it up with a smile and can deserialize it in proper fashion using:MailObject mail = (MailObject)message.getBody().get();
(That's my Serializable, MailObject)
A printout of the message body(message.getBody()
) at this point is as follows:body: [ byte[]: smtpserver.MailObject@1d9f748, objects: {defaultEntry=smtpserver.MailObject@1e22acc, org.jboss.soa.esb.message .transport.jms.messageID=ID:9-11889995042461} ]
Callingget()
on the body gives the actual object, named "defaultEntry", thus the 'mail' variable is the instance I serialized. So far, so good.
The next node calling a different service, lost this object.MailObject mail = (MailObject)message.getBody().get();
results in null.
A printout of the body:body: [ byte[]: smtpserver.MailObject@1d9f748, objects: {jbpmTokenId=40, jbpmCurrentNodeName=ForwardResult1, jbpmProcessDefVersion=1, jbpmProcessDefName=ZorgRingConnectServicesDefinition, jbpmProcessDefId=1, jbpmProcessInstId=39} ]
And this is done using in the process definition:
<mapping jbpm-name="theBody" esb-name="BODY_CONTENT" />
<mapping jbpm-name="theBody" esb-name="BODY_CONTENT" />
And using in the jboss-esb.xml:
<variable esb-name="eVar1" jbpm-name="counter" value="45" />
<variable esb-name="BODY_CONTENT" jbpm-name="theBody" />
So, I'm 100% certain the handing of the Message to jBPM and back to ESB tramples, chews up and otherwise rm -f's my Serializable object. So, I'm clearly not passing the message between the ESB and BPM right ? -
8. Re: Serializable problem, object makes a vanishing act.
arutha Sep 5, 2007 10:20 AM (in response to arutha)
... and it seems the line<variable esb-name="defaultEntry" jbpm-name="mailObject" />
on the right place in both process orchestration and ESB services definition file fixed the problem.
You were right, I had to call it by name, namely defaultEntry. It comes out the other end as specified now.
-
9. Re: Serializable problem, object makes a vanishing act.
kconner Sep 5, 2007 10:28 AM (in response to arutha)Please be aware that this name has changed in the GA release, it has been qualified.
Have a look at the messagefilter quickstart for the correct syntax.