Hi,
 
I am now using tdk1.7a. 
 
I want to write a server which will listen for messages and write the message to database. Since torque has already create the OM for database access. I want use the Peers for database access. I write these codes:
 
 
    ConnectionPool dbpool = new ConnectionPool(driver, url, username, password, 1, 10000);
   
dbcon = dbpool.getConnection();
    Criteria criteria = new Criteria();
    customs = TestPeer.doSelect(criteria, dbcon);
 
 
When I run the server, I got the following error:
 
exception in thread "main" java.lang.ExceptionInInitializerError: java.lang.NullPointerException
 at org.apache.turbine.services.resources.TurbineResources.getVector(TurbineResources.java:514)
 at org.apache.turbine.util.db.adapter.DBFactory.<clinit>(DBFactory.java:94)
 at org.apache.turbine.util.db.pool.ConnectionPool.getDB(ConnectionPool.java:329)
 at org.apache.turbine.util.db.pool.ConnectionPool.getNewConnection(ConnectionPool.java:348)
 at org.apache.turbine.util.db.pool.ConnectionPool.getConnection(ConnectionPool.java:273)
 at com.vtradex.server.Vserver.main(Vserver.java:52)
 
It seems that the ConnectionPool.getDB() function need Turbine service support. Is it possible that I can use ConnnectionPool and Peer seperatorly without Turbine service involved?  Or is there any other way I can do the work?
 
 
Regards& Thanks
 
 
fanyun
 
 

Reply via email to