Hi,
I am trying to configure Datasource for my applicaiton.I am using
struts. My
Jboss version is 3.2.5. I am using postgres. I place my postgres
jdbc driver in server/defafult/deploy/lib.
My Struts-config.xml file is as below.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource" key="userDB">
<set-property
property="driverClassName"
value="org.postgresql.Driver" />
<set-property
property="url"
value="jdbc
ostgresql://192.168.1.25:5432/sudhakar" />
<set-property
property="username"
value="postgres" />
<set-property
property="password"
value="postgres" />
<set-property
property="maxActive"
value="10" />
<set-property
property="maxWait"
value="5000" />
<set-property
property="defaultAutoCommit"
value="true" />
<set-property
property="defaultReadOnly"
value="false" />
</data-source>
</data-sources>
<form-beans>
<form-bean
name="loginForm"
type="com.wiley.LoginForm"/>
<form-bean
name="employeeForm"
type="com.wiley.EmployeeForm"/>
</form-beans>
<global-forwards>
<forward name="login" path="/login.jsp"/>
</global-forwards>
<action-mappings type="com.wiley.EmployeesActionMapping">
<action
path="/Login"
type="com.wiley.LoginAction"
name="loginForm"
input="/login.jsp"
validate="true"
scope="request">
<forward name="success" path="/EmployeeList.do"/>
</action>
<action
path="/EmployeeList"
type="com.wiley.EmployeeListAction"
scope="request">
<set-property property="loginRequired" value="true"/>
<forward name="success" path="/employeelist.jsp"/>
</action>
<action
path="/Edit"
type="com.wiley.GetEmployeeAction"
name="employeeForm"
scope="request"
validate="false">
<set-property property="loginRequired" value="true"/>
<forward name="success" path="/editemployee.jsp"/>
<forward name="error" path="/EmployeeList.do"/>
</action>
<action
path="/EditEmployee"
type="com.wiley.EditEmployeeAction"
name="employeeForm"
scope="request"
validate="true">
<set-property property="loginRequired" value="true"/>
<forward name="error" path="/editemployee.jsp"/>
<forward name="success" path="/EmployeeList.do"/>
</action>
<action
path="/Delete"
type="com.wiley.DeleteEmployeeAction"
scope="request"
validate="false">
<set-property property="loginRequired" value="true"/>
<forward name="error" path="/EmployeeList.do"/>
<forward name="success" path="/EmployeeList.do"/>
</action>
<action
path="/EditEmployee"
type="com.wiley.EditEmployeeAction"
name="employeeForm"
scope="request"
validate="true">
<set-property property="loginRequired" value="true"/>
<forward name="error" path="/editemployee.jsp"/>
<forward name="success" path="/EmployeeList.do"/>
</action>
</action-mappings>
<message-resources parameter="application" />
<!--
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
-->
</struts-config>
My postgres-ds.xml is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- $Id: postgres-ds.xml,v 1.1.2.1 2003/09/05 16:38:24 patriot1burke Exp $ -->
<!-- ==================================================================== -->
<!-- Datasource config for Postgres -->
<!-- ==================================================================== -->
<datasources>
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc
ostgresql://192.168.1.25:5432/sudhakar</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password>postgres</password>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
</local-tx-datasource>
</datasources>
I am getting the follwing error.
java.lang.NoClassDefFoundError: org/apache/struts/util/GenericDataSource
Can Any body explain why I am getting this error.
Thanks in Advance