struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DwarfInLeopardSkin" <>
Subject Problems with database connectivity: DATA_SOURCE is not bound in this Context
Date Tue, 24 Jun 2003 16:54:55 GMT
I'm building an application for a University project. I've created a plugin:

public class ConnectionAdaptorPlugin implements PlugIn {

private ModuleConfig config = null;
private ActionServlet servlet = null;

private static Log log = LogFactory.getLog(ConnectionAdaptorPlugin.class);

public static final String INITIALISATION_ERROR = "Connection pool not

private static ConnectionAdaptor adaptor = null;

private static String
    adaptorClass = "org.apache.commons.scaffold.sql.ConnectionAdaptor";

public ConnectionAdaptorPlugin() {

public void init(ActionServlet servlet, ModuleConfig config)
  throws ServletException {

  try {
       adaptor =

      catch (Throwable t) {
       throw new ServletException(t);
 }"ConnectionAdaptor plug-in initialised");


public void destroy() {
 adaptor = null;"ConnectionAdaptor plug-in destroyed");


It _should_ instantiate a Scaffold ConnectionAdaptor, making it available
for other Scaffold classes such as StatementUtils. I have another class
representing the database that calls methods in Scaffold's StatementUtils
class to retrieve data from, and update data in the database. I consistently
get this error message, which I don't understand:

DATA_SOURCE is not bound in this Context

DATA_SOURCE should be available?

As a test/experiment I tried using the database connection example given in
the Struts documentation - where the Action retrieves a connection object
and passes it on to the next layer. This gave an error along the lines of
"user SNEEZY not found". Sneezy is my nickname but I haven't used it in any
configuration file and I haven't been able to find it in any configuration

I have this data source setup in struts-config:

<data-source type="org.apache.commons.dbcp.BasicDataSource">
     <set-property property="defaultAutoCommit" value="false"/>
     <set-property property="description" value="Pointbase Connection"/>
     <set-property property="driverClassName"
     <set-property property="password" value="xxxxx"/>
     <set-property property="url"
     <set-property property="user" value="xxxxx"/>

I'm developing on my home PC (Windows 98SE) using the Sun One/Forte IDE and
the freebie Pointbase database (I don't have access to any other).

Any help would be appreciated.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message