-----Original Message-----
From: Martin Welch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 8:12 AM
Subject: Passing classes to ejb methods as parametersHi,
I'm slighly baffled by the do's and don'ts of passing classes to ejb methods as parameters.
I've got a simple class:
public class Task implements Serializable
{
public String Description = "";
public String Project = "";
public int ProjectId = -1;
public int TaskId = -1;
public boolean Dirty = true;public Vector Hours = new Vector();
public Task()
{
// A task always contains seven Time objects - one for each
// day of the week where [0] - Monday, [1] - Tuesday, etc.
for ( int i = 0; i < 7; i++ )
Hours.add(new Time());
}
}I want to pass this to a method on an bmp ejb. If this class is in the same package and jar as the ejb it all works on JBoss-2.4.0_Tomcat-3.2.2.
When I try to relocate this object to another package and jar the call fails in the client with a UndeclaredThrowableException. The jar containing the class is in my jboss's deploy and deploy\lib directory.
A colleague of mine hit the same problem but this time with Weblogic 5.1 although the error he got was different.
I'm trying to establish if what I'm trying to do is just wrong or some deployment / configuration problem.
Could someone enlighten me?
Thanks,
Martin
Title: Passing classes to ejb methods as parameters
Hi,
Perhaps you should try adding your implementation for Serializable,
readObject() and writeObject(). The arguments and return values for your
ejb methods do need to serializable or externalizable when you are calling
methods across jvms.
-Chris
- Passing classes to ejb methods as parameters Martin Welch
- Thompson, Chris
