File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes struts with datasource problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts with datasource problem" Watch "struts with datasource problem" New topic

struts with datasource problem

sudhakar ananth
Ranch Hand

Joined: Feb 02, 2007
Posts: 68
Dear Friends

I have installed Oracle 9i
and made the changes at .xml as this can any one tell why my project it does
" Servlet action is not available" error and i am not getting any page.
and at bundled Tomcat at netbeans IDE i am getting the error mentioned as "2" below

also i have gave the path for .jar files and in my netbeans IDE but again it also gives the error which i mentioned as "1" below


<data-source type="org.apache.commons.dbcp.BasicDataSource" >
<set-property property="username" value="scott"/>
<set-property property="password" value="tiger"/>
<set-property property="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<set-property property="url" value="jdbc racle:thin://"/>
<set-property property="minCount" value="50" />
<set-property property="maxCount" value="100" />
<set-property property="defaultAutoCommit" value="true"/>
<set-property property="defaultReadOnly" value="false"/>


1)java.lang.IllegalArgumentException: Document base C:\Documents and Settings\Sudhakar\Desktop\sesion4\build\web does not exist or is not a readable directory

2)org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown server host name 'BSRFNT05'

please help me out friends

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
There is one simple way to fix any Struts DBCP interface DataSource problem: Stop using it.

It's deprecated in the latest release Struts 1(1.3.5), so if you plan on upgrading, you'll have to get rid of it anyway. Even when it wasn't deprecated, there were loads of problems with it, and it's just plain not worth the effort to try and get it working.

The best practice for DataSources in a J2EE Web application is to set up the DataSource so that it is available in the Java Naming and Directory Interface (JNDI) and then do a JNDI lookup to retrieve it. Consult your Application server's documentation for how to set up a DataSource in JNDI for your specific application server.

Consultant, Sima Solutions
sudhakar ananth
Ranch Hand

Joined: Feb 02, 2007
Posts: 68
can you pls tell me how to configure the JNDI

or any procedure

or pls give me suggestions

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The procedure varies according to the Application server you're using. The first thing to do is consult the documentation for your app server. If you can't find the information, Tell us which app server you're using, and perhaps we can point you in the right direction.
I agree. Here's the link:
subject: struts with datasource problem
It's not a secret anymore!