Now I have built a test class because my JSP stuff wasn't retrieving DB information. So in my test class I call this retrieve() method I have built into state. The call is simple:
List li = State.retrieve(null);
Which calls my State.retrieve() method....
public static List retrieve (Map m)
{
// if map is null or empty then return a select statement
// based on a new (empty) criteria if ( (m == null) || (m.isEmpty()) )
{
try
{return StatePeer.doSelect( new Criteria() );}
catch (Exception e)
{
e.printStackTrace();
return new ArrayList();
}
} // otherwise add the fields to a criteria and doSelect on a
// populated criteria....My code errors out on the StatePeer.doSelect() call. It returns an exception instead of giving me the list of the states that are in the DB. Here is the stack trace that's printing out:
org.apache.torque.TorqueException: org.apache.commons.dbcp.SQLNestedException: Could not retrieve connection info from pool
at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:717)
at org.apache.torque.Torque.getConnection(Torque.java:268)
at org.apache.torque.util.Transaction.beginOptional(Transaction.java:80)
at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1195)
at asdf.BaseStatePeer.doSelectVillageRecords(BaseStatePeer.java:352)
at asdf.BaseStatePeer.doSelectVillageRecords(BaseStatePeer.java:325)
at asdf.BaseStatePeer.doSelect(BaseStatePeer.java:293)
at asdf.State.retrieve(State.java:63)
at a.Testing.main(Testing.java:29)
Caused by: org.apache.commons.dbcp.SQLNestedException: Could not retrieve connection info from pool
at org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectionAndInfo(SharedPoolDataSource.java:169)
at org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:631)
at org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:615)
at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:705)
... 8 more
Caused by: java.util.NoSuchElementException: Could not create a validated object
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:783)
at org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectionAndInfo(SharedPoolDataSource.java:165)
... 11 more
All of this code works flawlessly with a MySQL database. I would say that perhaps my code was wrong except I know it's good in MySQL. Anyone seen this before?
-Brandon
_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
