I'm not sure if returning Hibernate objects is a good idea. Probably
it would be better to return DTO objects, which gives you more control
over transfered data.

On 4/8/07, mxc <[EMAIL PROTECTED]> wrote:

Hi there,

I have been looking in vain for an answer as to how to overcome an issue
with hibernate proxies. I have a simple pojo class with no collections that
maps to a simple table. eg. create table TestTbl (id int, name
varchar(20),value varchar(25)) A primary key is defined on the id field. I
want to return the entire table. ie dao.findAll(); I explicitly initialize
the list to ensure that there are no proxies --- not a good solution but I
wanted to eliminate any lazy loading issues.

When I run the service through a jsp and output the results all is fine.
When I run it through the webservice class that wraps the service class I
get.


org.codehaus.xfire.XFireRuntimeException: Couldn't create type for property
collectionKeys on interface org.hibernate.stat.SessionStatistics: Cannot
create mapping for java.util.Set, unspecified component type for interface
java.util.Set

org.codehaus.xfire.aegis.type.DefaultTypeCreator.createCollectionType(DefaultTypeCreator.java:43)

org.codehaus.xfire.aegis.type.java5.Java5TypeCreator.createCollectionType(Java5TypeCreator.java:138)

org.codehaus.xfire.aegis.type.XMLTypeCreator.createCollectionType(XMLTypeCreator.java:141)

org.codehaus.xfire.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:91)

org.codehaus.xfire.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:374)

org.codehaus.xfire.aegis.type.XMLTypeCreator.createTypeFromGeneric(XMLTypeCreator.java:358)

org.codehaus.xfire.aegis.type.XMLTypeCreator.getOrCreateGenericType(XMLTypeCreator.java:345)

org.codehaus.xfire.aegis.type.AbstractTypeCreator.createCollectionTypeFromGeneric(AbstractTypeCreator.java:205)

org.codehaus.xfire.aegis.type.XMLTypeCreator.createCollectionType(XMLTypeCreator.java:138)

org.codehaus.xfire.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:91)

org.codehaus.xfire.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:354)



All the reports I read say to exclude the property using mapping files if
you are using aegis. But

1) I am not using aegis,
2) It is not a property of the class that is causing the problem but some
custom override of the set class by hibernate. At least thats my best quess.

How can I fix this? I know I can use value objects but was hoping to avoid
all that extra coding :(

--
View this message in context: 
http://www.nabble.com/Problem-using-XFire-with-Hibernate-and-Java5-JaxB-tf3544908.html#a9896005
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email




--
-----
When one of our products stops working, we'll blame another vendor
within 24 hours.

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to