You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by ra...@mankin.org.uk on 2004/03/22 21:06:33 UTC

TorqueException fetching all records

I am trying to fetch all the records from a table and am getting a
TorqueException. In fact, there is only one record to fetch. This is code that
has not been looked at for a while; it was working, and I tend to leave
sleeping dogs alone.

Any suggestions?

Here is the code:

92      System.out.println("initAcl: read from DB");
93      // Put in the first level real permissions
94      Criteria crit2 = new Criteria(PermissionPeer.DATABASE_NAME);
95      List l = PermissionPeer.doSelect(crit2); // Get all the perms in the DB


and here is the stack trace

initAcl: read from DB
TorqueException in initAcl: org.apache.torque.TorqueException:
uk.org.mankin.erms.Permission
java.lang.InstantiationException: uk.org.mankin.erms.Permission
        at java.lang.Class.newInstance0(Class.java:291)
        at java.lang.Class.newInstance(Class.java:259)
        at
uk.org.mankin.erms.BasePermissionPeer.row2Object(BasePermissionPeer.java:256)
        at
uk.org.mankin.erms.BasePermissionPeer.populateObjects(BasePermissionPeer.java:39
7)
        at
uk.org.mankin.erms.BasePermissionPeer.doSelect(BasePermissionPeer.java:310)
        at uk.org.mankin.erms.Permission.initAcl(Permission.java:95)



and here is the DB table:

mysql> select * from Permission;
+--------+---------+--------+----------+
| PermID | Subject | Object | PermMask |
+--------+---------+--------+----------+
|      1 |       3 |      0 | 16777215 |
+--------+---------+--------+----------+
1 row in set (0.00 sec)

I have tried it both with and without the database_name argument to the
Criteria constructor.

-- 
                               Unfortunately, most programmers like to
                               program. Some of them would rather
                               program than eat or bathe.
                               - Larry Constantine


Raphael Mankin
E-Mail: raph@panache.demon.co.uk
----------------------------------

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


RE: TorqueException fetching all records

Posted by ra...@mankin.org.uk.
While it is bad form to respond to one's own post, I have managed to clear the
problem though not to solve it.

Removing all the .class files and rebuilding from scratch did not work. I
therefore re-generated all the .java from xxx-schema.xml. This cleared the
problem, though why, I do not know, since I never touch the Base or Peer
classes.


On 22-Mar-2004 raph@mankin.org.uk wrote:
> I am trying to fetch all the records from a table and am getting a
> TorqueException. In fact, there is only one record to fetch. This is code
> that
> has not been looked at for a while; it was working, and I tend to leave
> sleeping dogs alone.
> 
[snip]
-- 
                               Unfortunately, most programmers like to
                               program. Some of them would rather
                               program than eat or bathe.
                               - Larry Constantine


Raphael Mankin
E-Mail: raph@panache.demon.co.uk
----------------------------------

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