- This topic has 1 reply, 1 voice, and was last updated 17 years, 11 months ago by Kamlesh Nanda.
-
AuthorPosts
-
Kamlesh NandaMemberStruts config editor does not create <data-source> with proper keys and attributes. It is missing the following:
1. Attribute type is mandatory for <data-source> element. Struts config editor shows the value of type as org.apache.struts.util.GenericDataSource however, when it creates the configuration in the .xml file it eats it up so there is no type.
2. Nested property for driver class in <data-source> element is misspelled. It is not driverClass rather driverClassName.Both of this causes the datasource to fail.
Kam
Kamlesh NandaMemberHere is a sample that it creates
<data-source key=”org.apache.struts.action.DATA_SOURCE”>
<set-property property=”minCount” value=”3″ />
<set-property property=”password” value=”xxxxxx” />
<set-property property=”maxCount” value=”10″ />
<set-property property=”user” value=”myusr” />
<set-property property=”driverClass” value=”org.postgresql.Driver” />
<set-property property=”description” value=”PostgreSQL Driver” />
<set-property property=”url” value=”jdbc:postgresql://localhost:5432/mydb” />
<set-property property=”autoCommit” value=”false” />
<set-property property=”readOnly” value=”false” />
<set-property property=”loginTimeout” value=”100″ />
</data-source>Additionally I noticed that the property user is also incorrect, it should be user. Here is the corrected version of the above that your tool should create:
<data-source key=”org.apache.struts.action.DATA_SOURCE”
type=”org.apache.tomcat.dbcp.dbcp.BasicDataSource”>
<set-property property=”password” value=”xxxx” />
<set-property property=”minCount” value=”3″ />
<set-property property=”maxCount” value=”10″ />
<set-property property=”username” value=”myusr” />
<set-property property=”driverClassName”
value=”org.postgresql.Driver” />
<set-property property=”description”
value=”PostgreSQL Driver” />
<set-property property=”url”
value=”jdbc:postgresql://localhost:5432/mydb” />
<set-property property=”readOnly” value=”false” />
<set-property property=”autoCommit” value=”false” />
<set-property property=”loginTimeout” value=”1000″ />
</data-source> -
AuthorPosts