You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by phillip rhodes <rh...@yahoo.com> on 2004/10/01 18:52:52 UTC

"Could not find adapter" for my java object problem

I am using the contrib:Table to display a list of my
java objects returned from a hibernate query.

For each row, I am displaying an Edit link.  When I
try to render the table, I am getting a "Could not
find an adapter for com.rhoderunner.store.Category"

I think that I need to make the Category class
serializable, but I wonder if I should custom
serialize just the prime key and refetch it from the
Database, or is there another way to solve this?  Or
can I just accept the default java serialization?

Pointers are much appreciated!



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: "Could not find adapter" for my java object problem

Posted by Mind Bridge <mi...@yahoo.com>.
Hi Phillip,

Please include some of the code in order for us to be able to determine the
problem for sure. Right now we have to guess :)

My guess is that the problem is in your Edit link. It is probably a
DirectLink that contains a com.rhoderunner.store.Category object in its
parameters (probably  'components.table.tableRow.category'). DirectLink
tries to add this object to its URL and automatically tries to convert it to
a String.

If the object is not one of the standard types (String, int, etc), or one of
the custom registered types, it will try to serialize the object and get the
String representation of the serialized object. Hence the need for
Serializable that you see.

The issue could be resolved in two ways.

The simpler one is simply to place the category's primary key (rather than
the full category) in the DirectLink's parameters and adjust its listener
accordingly. This can happen by making the parameters contain something like
'components.table.tableRow.category.name' instead (where 'name' is the
primary key of the category as a String) or something similar to that. I
would recommend this approach, since it is simpler.

The second way is the 'register' the Category class with the application so
that it knows how to convert Category into a String and back. Please seach
the list/documentation for more information on  'ISqueezeAdaptor' if you
want to go that route.

Best regards,
-mb

----- Original Message ----- 
From: "phillip rhodes" <rh...@yahoo.com>
To: <ta...@jakarta.apache.org>
Sent: Friday, October 01, 2004 7:52 PM
Subject: "Could not find adapter" for my java object problem


> I am using the contrib:Table to display a list of my
> java objects returned from a hibernate query.
>
> For each row, I am displaying an Edit link.  When I
> try to render the table, I am getting a "Could not
> find an adapter for com.rhoderunner.store.Category"
>
> I think that I need to make the Category class
> serializable, but I wonder if I should custom
> serialize just the prime key and refetch it from the
> Database, or is there another way to solve this?  Or
> can I just accept the default java serialization?
>
> Pointers are much appreciated!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 9/28/2004


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org