[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1757) @DataModel on a getter broken on Statefull beans.

Sanne Grinovero (JIRA) jira-events at lists.jboss.org
Fri Aug 3 11:10:57 EDT 2007


@DataModel on a getter broken on Statefull beans.
-------------------------------------------------

                 Key: JBSEAM-1757
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1757
             Project: JBoss Seam
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.0.BETA1
            Reporter: Sanne Grinovero
            Priority: Minor


When using "@DataModel" to annotate a getter method of a statefull bean (instead as annotating a field) an exception is thrown.
It used to work as expected in previous releases, as tested on 1.0.1 , 1.1.0, 1.1.6, 1.2.1.

StackTrace quote:
Caused by: java.lang.IllegalArgumentException: Could not invoke method by reflection: BrokenList.getTestData() with parameters: (java.util.ArrayList) on: org.jboss.seam.example.pdf.BrokenList
at org.jboss.seam.util.Reflections.invoke(Reflections.java:31)
at org.jboss.seam.Component.setPropertyValue(Component.java:1656)
... 108 more
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21) 



patch to reproduce, to be applied on the booking example (2.0.0.BETA1):
--- booking/src/org/jboss/seam/example/booking/HotelSearchingAction.java        2007-06-27 08:37:23.
000000000 +0200
+++ booking-broken/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2007-08-03 01:26:12.
000000000 +0200
@@ -30,6 +30,7 @@
    private int page;

    @DataModel
+   public List<Hotel> getHotels(){ return hotels; }
    private List<Hotel> hotels;

    public void find()
diff -ur booking/src/org/jboss/seam/example/booking/HotelSearching.java booking-broken/src/org/jboss
/seam/example/booking/HotelSearching.java
--- booking/src/org/jboss/seam/example/booking/HotelSearching.java      2007-06-27 08:37:19.00000000
0 +0200
+++ booking-broken/src/org/jboss/seam/example/booking/HotelSearching.java       2007-08-03 01:28:01.
000000000 +0200
@@ -1,7 +1,8 @@
 //$Id: HotelSearching.java,v 1.12 2007/06/27 00:06:49 gavin Exp $
 package org.jboss.seam.example.booking;

-import javax.ejb.Local;
+import javax.ejb.Local;
+import java.util.List;

 @Local
 public interface HotelSearching
@@ -19,5 +20,7 @@
    public boolean isNextPageAvailable();

    public void destroy();
+
+   public List<Hotel> getHotels();

 }	

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list