db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Donald Rosengartner" <DROSENGART...@kc.rr.com>
Subject DatasourceFactory
Date Thu, 12 Dec 2002 17:39:20 GMT
I've read the other postings of this subject, and have a slightly different angle. Instead
of null pointer exception, I'm getting: 
org.apache.jasper.JasperException: There was no DataSourceFactory configured for the connection

I'm using the database name 'fishing' in my torque.properties. Where it's coming up with caps
'FISHING' I do not know. I reviewed the jdbc-howto on apache.org and found a few lines missing
from my torque.properties file.. those pertaining to datasource:
(modified to my specs, of course)torque.dsfactory.bookstore.pool.defaultMaxConnections=10
torque.dsfactory.bookstore.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.bookstore.connection.url = jdbc:mysql://localhost:3306/bookstore
torque.dsfactory.bookstore.connection.user = root
torque.dsfactory.bookstore.connection.password = 1234after making this modification, do I
need to rebuild torque? I did anyway, and it's throwing the same exception. ## Using torque's
old pooltorque.dsfactory.fishing.factory=org.apache.torque.dsfactory.TorqueDataSourceFactorytorque.dsfactory.fishing.pool.defaultMaxConnections=10torque.dsfactory.fishing.pool.maxExpiryTime=3600torque.dsfactory.fishing.pool.connectionWaitTimeout=10torque.dsfactory.fishing.connection.driver
= org.gjt.mm.mysql.Drivertorque.dsfactory.fishing.connection.url = jdbc:mysql://localhost:3306/fishingtorque.dsfactory.fishing.connection.user
= usertorque.dsfactory.fishing.connection.password = passOther items of importance: I'm using
jakarta-tomcat-4.1.12, j2sdk1.4.1_01, torque-3.0-rc2, mysql with mysql-connector-java-3.0.2-beta-bin.jar.
The tutorial worked with this setup, (tutorial classes tutorial tables, etc).  I'm building
into a directory /projects/torque3.0~/src but jaring and manually moving these classes into
web-inf\lib. Is there a better way to do this?I've added lines in my server.xml and web.xml
as suggested in the jdbc-howtoIt's mentioned in the howto, "Remember that jdbc2 pools expect
a ConnectionPoolDataSource available via jndi under the name given in the dataSourceName,
so you will need entries in server.xml and web.xml for this object as well. " I'm initializing
torque from a tomcat servlet and trying to call the torque classes directly from a JSP. In
all the postings I've drudged through, none have example JSP code for these calls. Here's
mine:<%@ page language="java" %> <%@ page contentType="text/html"%> <%@ page
import="org.apache.torque.Clubs" %>  <%  try { Clubs addison = new Clubs(); addison.setClubName("Addison
Club Professional"); addison.setClubRegion("Southern USA"); addison.setContact("Mrs. Cal Me
Anytime"); addison.setAddressLine1("8684 NE Testdata St"); addison.setAddressLine2("Suite
200"); addison.setAddressLine3("attention: order procurment"); addison.setCity("Kansas City");
addison.setState("MO"); addison.setCountry("USA"); addison.setZip("64157-9885"); addison.save();
out.println("Save attempt was successful"); } catch ( Exception e ) { out.println("An error
occurred while attempting to save:"); out.println(e.getMessage()); }  %>*****************************As
a quick Q, is there a problem with the packaging of my class Clubs? I believe torque is doing
exactly what I told it to do, but is there a standards conflict here?Finally, the torque build
goes smoothly. I am excited about the prospects and simplicity when I do finally get the kinks
out. I just need to figure out this datasource thing. Thanks in advance for assistance
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message