What happens if you leave everything out of struts-config except the
datasources section and then try to use the datasource for a simple query?
You can get the datasource from the ServletContext like this to try it out
without any struts actions:
// from any servlet do this
DataSource ds = (DataSource) this.getServletContext().getAttribute(
"org.apache.struts.action.DATA_SOURCE");
You might also try explicitly putting the key and type attributes in the
datasource like this:
<datasource
key="org.apache.struts.action.DATA_SOURCE"
type="org.apache.struts.util.GenericDataSource">
Dave
>From: "Silva, Alejandro" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
>Subject: RE: DataSource
>Date: Wed, 18 Sep 2002 07:25:37 -0700
>
>Hi David, all:
>
>When I leave the Datasource section out of the config file, my page loads
>with no problem. It is the page in which the
>user will type his/her username and password.
>
>Also, Balaji Thirugnanam asked about the App Server: I'm using Tomcat 3.2.4
>and Struts 1.0.2
>
>Thanks!
>
>Alex
>
>-----Original Message-----
>From: David Graham [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, September 17, 2002 10:58 PM
>To: [EMAIL PROTECTED]
>Subject: Re: DataSource
>
>
>The error message doesn't indicate anything wrong with the datasource.
>what
>happens when you leave that part out of the config file?
>
>Dave
>
>
> >From: "Silva, Alejandro" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> >Subject: DataSource
> >Date: Tue, 17 Sep 2002 16:50:13 -0700
> >
> >Hi!
> >
> >Introduction
> >-----------------
> >I'm trying to use the DataSource implementation in Struts so that I can
> >have database Connection pooling. However, every
> >time I try and load the logon.jsp page I get an error :(
> >
> >Any thoughts?
> >
> >Details
> >-----------------
> >Here's my struts-config.xml so far:
> >
> ><?xml version="1.0" encoding="ISO-8859-1"?>
> >
> ><!DOCTYPE struts-config PUBLIC
> > "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
> > "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
> >
> ><struts-config>
> >
> ><!-- ========== Data Source Configuration ===============================
> >-->
> ><data-sources>
> > <data-source>
> > <set-property property="autoCommit"
> > value="false"/>
> > <set-property property="description"
> > value="Fixed Assets Development Database"/>
> > <set-property property="driverClass"
> > value="sun.jdbc.odbc.JdbcOdbcDriver"/>
> > <set-property property="maxCount"
> > value="4"/>
> > <set-property property="minCount"
> > value="2"/>
> > <set-property property="password"
> > value="webuser"/>
> > <set-property property="url"
> > value="jdbc:odbc:FADDDataSource"/>
> > <set-property property="user"
> > value="webuser"/>
> > </data-source>
> ></data-sources>
> >
> >
> ><!-- ========== Form Bean Definitions ===================================
> >-->
> ><form-beans>
> > <!-- Logon form bean -->
> > <form-bean name="logonForm"
> >type="com.honeywell.fixedasset.LogonForm"/>
> >
> > <!-- SBU List form bean -->
> > <form-bean name="getSBUListForm"
> >type="com.honeywell.fixedasset.util.GetSBUListForm"/>
> >
> > <!-- New Asset form bean -->
> > <form-bean name="addAssetForm"
> >type="com.honeywell.fixedasset.add.AddAssetForm"/>
> ></form-beans>
> >
> >
> ><!-- ========== Global Forward Definitions ==============================
> >-->
> ><global-forwards>
> > <forward name="logoff" path="/logoff.do"/>
> > <forward name="logon" path="/logon.jsp"/>
> > <forward name="success" path="/main_page.jsp"/>
> ></global-forwards>
> >
> >
> ><!-- ========== Action Mapping Definitions ==============================
> >-->
> ><action-mappings>
> > <!-- Process a user logoff -->
> > <action path="/logoff" type="com.honeywell.LogoffAction">
> > <forward name="success" path="/index.jsp"/>
> > </action>
> >
> > <!-- Process a user logon -->
> > <action path="/logon" type="com.honeywell.fixedasset.LogonAction"
> >name="logonForm" scope="request"
> >input="/logon.jsp">
> > </action>
> >
> > <!-- Get an SBU list -->
> > <action path="/getSBUList"
> >type="com.honeywell.fixedasset.util.GetSBUListAction"
>name="getSBUListForm"
> >scope="request" validate="false">
> > <forward name="newAsset" path="/add_asset_sbu.jsp"/>
> > <forward name="reviewAssets" path="review_assets.jsp"/>
> > <forward name="changeSBU" path="change_sbu.jsp"/>
> > <forward name="addLocationSBU" path="add_location_sbu.jsp"/>
> > <forward name="changeLocationSBU"
>path="change_location_sbu.jsp"/>
> > <forward name="addLocation" path="add_location.jsp"/>
> > <forward name="changeLocation" path="change_location.jsp"/>
> > </action>
> >
> > <!-- Add an Asset to the system -->
> > <action path="/addAsset"
> >type="com.honeywell.fixedasset.add.AddAssetAction" name="addAssetForm"
> >scope="request"
> >input="/add_asset_sbu.jsp">
> > <forward name="success" path="/index.jsp"/>
> > </action>
> ></action-mappings>
> >
> ></struts-config>
> >
> >The error message I get is:
> >
> >Error: 500
> >Location: /fadd/logon.jsp
> >Internal Servlet Error:
> >javax.servlet.ServletException: Cannot find ActionMappings or
> >ActionFormBeans collection
> > at
>
>>org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:461)
> > at
>
>>_0002flogon_0002ejsplogon_jsp_0._jspService(_0002flogon_0002ejsplogon_jsp_0.java:503)
> > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >(and more)
> >
> >
> >Alejandro Silva
> >Honeywell - GBS Mexico
> >[EMAIL PROTECTED]
> >+52 (444) 826-2577
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
>
>
>
>
>_________________________________________________________________
>MSN Photos is the easiest way to share and print your photos:
>http://photos.msn.com/support/worldwide.aspx
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>