-
1. Re: Problem with selectItems taglib
pmuir Dec 12, 2006 9:51 AM (in response to dave.rogers)Which versions of Seam and SeamSelectItems are you using?
-
2. Re: Problem with selectItems taglib
dave.rogers Dec 12, 2006 9:58 AM (in response to dave.rogers)Seam: 1.1.0 CR 2
Seam-selectlist: 1.1.1beta3
Very impressed by the speed of the response so far, thanks! -
3. Re: Problem with selectItems taglib
gus888 Dec 12, 2006 10:19 AM (in response to dave.rogers)I am wondering when it is possible to integrate selectItems into Seam. Thanks.
-
4. Re: Problem with selectItems taglib
pmuir Dec 12, 2006 10:44 AM (in response to dave.rogers)The EntityConverter checks to see if the object passed to it is annotated with @Entity. One of the objects being converted isn't marked with @Entity. This is because it has been enhanced by javassist.
Now, I'm no expert on javaassist but I think that it essentially creates a proxy, and passes method invocations to the the object (when the converter checks for @Entity it is scanning the proxy, not the object).
I would guess that the problematic object is #{currentItem.catalogue} - is currentItem a Seam JavaBean?
If so I will see if I can cope with enhanced objects in the converter when I have a moment.
I also obviously need to look at my resourcebundle loading (I think it's now possible to delegate it entirely to Seam). -
5. Re: Problem with selectItems taglib
pmuir Dec 12, 2006 10:46 AM (in response to dave.rogers)gus888, if you mean integrate into a Seam distribution then that's not up to me ;)
-
6. Re: Problem with selectItems taglib
dave.rogers Dec 12, 2006 11:04 AM (in response to dave.rogers)Any ideas about finding a way around this? Can I not use javassist? Can I override something in the SeamSelectList code?
-
7. Re: Problem with selectItems taglib
pmuir Dec 12, 2006 11:10 AM (in response to dave.rogers)The problem is occuring in the generic converter, so you could specify a converter manually (there is an example on the wiki).
If you can work out how to make BasicEntityConverter work with javaassist (the methods which need work are findIdField and findIdMethod) and send me a patch that would be awesome. -
8. Re: Problem with selectItems taglib
dave.rogers Dec 12, 2006 11:28 AM (in response to dave.rogers)Here's my very crude solution:
In BasicEntityConvertor, comment out the entity check in the findIdMethod methodprotected Method findIdMethod(Class clazz) { // Check that the class passed is an entity //if (!(clazz.isAnnotationPresent(Entity.class))) { // throw new ConverterException(getMessage(NOT_AN_ENTITY + " " + clazz.getName())); //}
and the same in the findIdFieldprotected Field findIdField(Class clazz) { // Check that the class passed is an entity //if (!(clazz.isAnnotationPresent(Entity.class))) { // throw new ConverterException(getMessage(NOT_AN_ENTITY + " " + clazz.getName())); //}
Now I don't know what the implications of this are; probably poor error output if the class really isn't an entity. Otherwise it works. Thanks for your help. -
9. Re: Problem with selectItems taglib
pmuir Dec 12, 2006 11:45 AM (in response to dave.rogers)I guess that a log message rather than an exception might be better there.
-
10. Re: Problem with selectItems taglib
dave.rogers Dec 12, 2006 12:11 PM (in response to dave.rogers)I was perhaps a bit hasty. It now causes a silent error (no stack trace, no debug, nothing) which prevents the data from being passed to bean.
-
11. Re: Problem with selectItems taglib
pmuir Dec 12, 2006 12:49 PM (in response to dave.rogers)There is no h:messages output?
-
12. Re: Problem with selectItems taglib
dave.rogers Dec 12, 2006 1:01 PM (in response to dave.rogers)Ah yes, a 'Validation Error'
-
13. Re: Problem with selectItems taglib
dave.rogers Dec 12, 2006 1:13 PM (in response to dave.rogers)I'm also interested to know why I get this error but it works for some people. Why do some people not have javassist proxies?
-
14. Re: Problem with selectItems taglib
pmuir Dec 12, 2006 5:23 PM (in response to dave.rogers)The validation error is probably due to the id/object equality mismatch as discussed on the wiki (and extensively in the forum).
Seam uses javassist when you use a JavaBean as a Seam component I think.
Can you post the code for the bean referred to by #{currentItem} (including any type (class) annotations)?