DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6060>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6060 Only Single Data Source is initialized [EMAIL PROTECTED] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW everconfirmed|0 |1 ------- Additional Comments From [EMAIL PROTECTED] 2002-01-30 02:00 ------- Here is my attempt to fix bugzilla #6060 (that I opened): Only a single dataSource is registered with the ActionServlet. The main problem is that they "key" property is not set. Also, the BeanUtils.populate() method is not matching the correct property names for the DataSource, from what I can tell. I also removed the throw UnavailableException because if one dataSource fails to register, it'd be nice if the ActionServlet would move on to the next one. Anthony Index: src/share/org/apache/struts/action/ActionServlet.java =================================================================== RCS file: /home/cvspublic/jakarta- struts/src/share/org/apache/struts/action/ActionServlet.java,v retrieving revision 1.91 diff -u -r1.91 ActionServlet.java --- src/share/org/apache/struts/action/ActionServlet.java 23 Jan 2002 18:59:12 -0000 1.91 +++ src/share/org/apache/struts/action/ActionServlet.java 30 Jan 2002 01:34:07 -0000 @@ -809,13 +809,16 @@ BeanUtils.populate(ds, dscs[i].getProperties()); ds.setLogWriter(scw); if (ds instanceof GenericDataSource) { - ((GenericDataSource) ds).open(); + GenericDataSource gds = (GenericDataSource) ds ; + gds.setDriverClass((String) dscs[i].getProperties().get ("driverClass")) ; + gds.setUrl((String) dscs[i].getProperties().get("url")) ; + gds.setUser((String) dscs[i].getProperties().get("user")) ; + gds.setPassword((String) dscs[i].getProperties().get ("password")) ; + gds.open() ; } } catch (Throwable t) { log(internal.getMessage ("dataSource.init", dscs[i].getKey()), t); - throw new UnavailableException - (internal.getMessage("dataSource.init", dscs[i].getKey ())); } getServletContext().setAttribute (dscs[i].getKey() + config.getPrefix(), ds); Index: src/share/org/apache/struts/config/DataSourceConfig.java =================================================================== RCS file: /home/cvspublic/jakarta- struts/src/share/org/apache/struts/config/DataSourceConfig.java,v retrieving revision 1.3 diff -u -r1.3 DataSourceConfig.java --- src/share/org/apache/struts/config/DataSourceConfig.java 16 Jan 2002 17:42:40 -0000 1.3 +++ src/share/org/apache/struts/config/DataSourceConfig.java 30 Jan 2002 01:38:19 -0000 @@ -142,6 +142,9 @@ */ public void addProperty(String name, String value) { + if ( name.equals("key") ) + setKey(value) ; + else properties.put(name, value); } -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>