Hello.  I have a simple BLB in my STRUTS application that I am using to connect to a 
database.  I have defined my datasource in my struts_config.xml file and I have the 
struts-legacy.jar file in my classpath, however, I keep getting the following error:
java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource 
Please adivse....

Here is the code from my simple BLB:

package net.reumann;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import javax.sql.*;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import org.apache.log4j.*;
import net.reumann.*;
import org.apache.commons.beanutils.BeanUtils;

public class OrgIdService {
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;

        //public OrgIdDataBean insertEmployee( OrgIdDataBean orgid ) {
        //in real life call other business classes to do insert
        //ie:
        //EmployeeDAO.insertEmployee( employee );
        //return orgid;
    //}

    public DataHash execute(DataHash beanHash)  {

                try{
                        Class.forName("oracle.jdbc.driver.OracleDriver");
                        conn = 
DriverManager.getConnection("jdbc:oracle:thin:@xyz:1521:SRCD","Test1234","Test1234");

                        Statement stmt = conn.createStatement();
                        ResultSet rs = stmt.executeQuery("SELECT FACIL_ID, FACIL_NAME, 
ORG_ID FROM FACILITY");
                }
                catch (Exception e) {
                        e.printStackTrace();
                }

                return null;
        }
}

Reply via email to