This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have some web-application(build in Struts), this application good working with MySQL database, but our customers want to use this application with MSSQL database. And i change only datasource in struts-config.xml! My struts-config.xml: <data-sources> <data-source key="t3" type="org.apache.commons.dbcp.BasicDataSource"> <set-property property="minCount" value="" /> <set-property property="password" value="" /> <set-property property="maxCount" value="" /> <set-property property="user" value="sa" /> <set-property property="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver" /> <set-property property="description" value="t3" /> <set-property property="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=t3" /> <set-property property="autoCommit" value="false" /> <set-property property="readOnly" value="false" /> <set-property property="loginTimeout" value="" /> </data-source> </data-sources>
i starting application and try to login (logins and passwords saved in database), but Tomcat writing this error: type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available.
I know this may sound like an un-helpful response, but my advice is to stop using the Struts datasource utility altogether. It works sometimes, but not for all databases, and not for all platforms. There have been posts on this forum indicating that it worked fine in development on a Windows platform, but didn't work when deployed to a Unix platform. If you search this forum you will find many instances of problems with this interface, many of which have gone unsolved.
Your best bet is to define the DataSource as a JNDI resource in your application server and then do a JNDI lookup in your application to retrieve it.
I'm not saying there isn't a way to solve this problem and continue using the Struts datasource utility, but I'm just making you aware that using it has been problematic for others.