commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Problems passing DynaBean and DynaClass instances as arguments
Date Tue, 16 Apr 2002 18:07:14 GMT


On Tue, 16 Apr 2002, James Strachan wrote:

> Date: Tue, 16 Apr 2002 04:22:22 +0100
> From: James Strachan <james_strachan@yahoo.co.uk>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> Subject: Re: Problems passing DynaBean and DynaClass instances as
>     arguments
>
> ----- Original Message -----
> From: "Wellie W. Chao" <wchao@caraveltech.com>
> > I'm having problems passing DynaBean and DynaClass objects as arguments,
> > whether to static class methods within another class or to EJB objects. I
> > get the following error:
> >
> > java.lang.LinkageError: Class org/apache/commons/beanutils/DynaClass
> > violates loader constraints
>
> This usually signifies a ClassLoader problem. Maybe commons-beanutils.jar is
> on the System classpath and also inside a WEB-INF/lib or something like
> that?
>

That's been my experience as well.

> > Is it possible to pass DynaBean and DynaClass objects as arguments, either
> > to normal methods
>
> Sure, they are regular java objects.
>

Of course, the methods you call must be aware that the things really are
DynaBeans and not regular beans, and use the DynaBean APIs to get and set
properties.

> > or (potentially) across the network to EJB objects?
>
> Right now I don't think DynaBean / DynaClass are Serializable so they can't
> be used as arguments to EJBs - that should probably be fixed I guess.
>

DynaBean and DynaClass are interfaces -- it's really the implementation
classes that you care about.  Currently, BasicDynaBean isn't Serializable,
but could be made so (the properties you set would also need to be
Serializable for this to work).

Making BasicDynaClass able to be serialized would require a custom
readObject method, but should not be all that hard to do.

> James

Craig McClanahan


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message