Bob, 
 As CP_Lim mentioned, the "connection is null" is caused by your
Torque.properties not being in the right place.    How are you
specifying the filename for Torque.properties?  Are you specifying
an absolute path?

I had a lot of trouble with finding the properties file - it turns out I
was using a relative path, and with Tomcat 4.0, the "current directory"
is simply whichever directory you're in when you start up the server.

So my recommendation is to put Torque.properties in a well-known
location (in our case, /etc/Torque/Torque.properties).  

Or you can do the following:

1)  Remove your InitServlet from the project temporarily.
2)  Create a simple jsp page.
3)  In that JSP page, use scriptlets to
    a) run Torque.init()
    b)  print out the value of Torque.isInit()
4) Move the torque.properties file around until you get a "True" from
the jsp page.
5)  Put the InitServlet back into the project.
6)  Alter the JSP page so it no longer calls Torque.init(), just calls
Torque.isInit().
7)  Make sure that works as well.


I'm afraid I can't help you with the class not found problem, though. 
It does sound like your classpath is incorrect.

-Peter


On Wed, 2002-10-16 at 14:07, Bob wrote:
> OK, so I changed InitServlet to extend
> org.apache.struts.action.ActionServlet, and still no dice. 
> All the classes are correctly in the WEB-INF folder too. 
> Here's some additional info on what environment I'm using:
> 
> JBuilder 5 Enterprise
> JDK 1.3.02
> Tomcat 3.2
> Struts 1.0.2
> Torque 3.0 b4
> 
> Just to test Tomcat, I threw it on a Tomcat 4.1.12 server
> and I do NOT get the ClassNotFoundException.  It still
> explodes when I try to use Torque and a Connection is null
> error (that was the same as before).  The torque log stops
> with this warning message (However I am using "native" as
> the idMethod):
> 
> WARN - IDBroker is being used with db 'biztracker', which
> does not support transactions.  IDBroker attempts to use
> transactions to limit the possibility of duplicate key
> generation.  Without transactions, duplicate key generation
> is possible if multiple JVMs are used or other means are
> used to write to the database.
> 
> 
> 
> I get the nagging feeling I'm missing something blatantly
> obvious.
> 
> Thanks again,
> 
> Bob
> 
> 
> Here's my web.xml:
> 
> <web-app>
>   <servlet>
>     <servlet-name>action</servlet-name>
>    
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>     <init-param>
>       <param-name>debug</param-name>
>       <param-value>2</param-value>
>     </init-param>
>     <init-param>
>       <param-name>config</param-name>
>       <param-value>/WEB-INF/struts-config.xml</param-value>
>     </init-param>
>     <init-param>
>       <param-name>application</param-name>
>       <param-value>ApplicationResources</param-value>
>     </init-param>
>     <init-param>
>       <param-name>detail</param-name>
>       <param-value>2</param-value>
>     </init-param>
>     <init-param>
>       <param-name>validate</param-name>
>       <param-value>true</param-value>
>     </init-param>
>     <load-on-startup>2</load-on-startup>
>   </servlet>
>   <servlet>
>     <servlet-name>initServlet</servlet-name>
>    
> <servlet-class>com.lawson.is.biztracker.utils.InitServlet</servlet-class>
>     <init-param>
>       <param-name>debug</param-name>
>       <param-value>2</param-value>
>     </init-param>
>     <init-param>
>       <param-name>config</param-name>
>       <param-value>/WEB-INF/Torque.properties</param-value>
>     </init-param>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>*.do</url-pattern>
>   </servlet-mapping>
>   <welcome-file-list>
>     <welcome-file>index.jsp</welcome-file>
>   </welcome-file-list>
>   <taglib>
>     <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
>   </taglib>
>   <taglib>
>     <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
>   </taglib>
>   <taglib>
>     <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
>   </taglib>
> </web-app>
> 
> And here's my Torque.properties file:
> 
> log4j.rootCategory = DEBUG, default
> log4j.appender.default = org.apache.log4j.FileAppender
> log4j.appender.default.file =
> c:/data/java/projects/Torque/torque.log
> log4j.appender.default.layout =
> org.apache.log4j.SimpleLayout
> 
> 
> torque.applicationRoot = c:/data/java/projects/Torque
> 
> 
> torque.database.default=biztracker
> torque.database.default.adapter=mssql
> 
> 
> ## Using Jdbc2Pool
> torque.dsfactory.biztracker.factory=\
>   org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory
> torque.dsfactory.biztracker.pool.defaultMaxActive=10
> torque.dsfactory.biztracker.pool.testOnBorrow=true
> torque.dsfactory.biztracker.pool.validationQuery=SELECT 1
> torque.dsfactory.biztracker.connection.driver =
> com.microsoft.jdbc.sqlserver.SQLServerDriver
> torque.dsfactory.biztracker.connection.url =
> jdbc:microsoft:sqlserver://####
> torque.dsfactory.biztracker.connection.user = ####
> torque.dsfactory.biztracker.connection.password = ####
> 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-torque-user-help@;jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-torque-user-help@;jakarta.apache.org>

Reply via email to