Troubleshooting a JavaServer Faces Web Page Run on Tomcat

Problem: It appears that a page with a DataWindow object using a JNDI datasource property cannot be run.

The problem occurs if you do the following:

  1. Create a Web Application project.

  2. Create a JavaServer Faces ( JSF) page in the Web application.

  3. Add a DataWindow object to the Web page.

  4. In Tomcat administration, create a JNDI datasource under the Web application and assign it to the DataWindow object.

  5. Run the page from WorkSpace Navigator context menu.

No expected output is returned in the page. If you look at the JNDI in Tomcat admin, the page does not appear.

To run a Web page with a DataWindow object using a JNDI datasource property:

Add the default jndi/jsfdw name in the server.xml file; however if you add a new name, you must add all to the server.xml file.

Enter the following to the server.xml file under the Context of each application to map the JNDI datasource to a specific database connection.

<Context docBase="D:\Sybase\WorkSpace\Eclipse\demo3\demo\webroot" path="/demo"

reloadable="true" source="com.ibm.wtp.web.server:demo">

<ResourceParams name="jndi/jsfdw">

<parameter>

<name>url</name>

<value>jdbc:sybase:Tds:localhost:2638</value>

</parameter>

<parameter>

<name>password</name>

<value>sql</value>

</parameter>

<parameter>

<name>maxActive</name>

<value>10</value>

</parameter>

<parameter>

<name>maxWait</name>

<value>5000</value>

</parameter>

<parameter>

<name>driverClassName</name>

<value>com.sybase.jdbc2.jdbc.SybDriver</value>

</parameter>

</parameter>

<name>username</name>

<value>dba</value>

</parameter>

</parameter>

<name>maxIdle</name>

<value>2</value>

</parameter>

</ResourceParams>

</Context>

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com