JavaServer Faces web.xml rewritten when build

I am using Netbeans 5.5.1 with the Sun Server 9.0 running on my machine. I have created a connection pool to an IBM iSeries db database. I have added the following code to my web.xml file:

<resource-ref>

<description>jdbc:as400://FRED</description>

<res-ref-name>jdbc/connectionPool</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

<res-sharing-scope>Shareable</res-sharing-scope>

</resource-ref>

But when I try to run the application at build time this above entry is removed from the web.xml file. Can anyone tell me what I am doing wrong?

[738 byte] By [lewkima] at [2007-11-27 9:02:24]
# 1

I'm not familiar with the tools you are using, but my first question would be if you have configured the application specific deploy time parameters. Wow, that was incomprehensible....

What I was getting at, is that you have, acting as the application developer, identified an external resource that your application requires. The application deployer (speaking in terms of JEE roles here) has the responsibility to match that logical resource to an actual resource within the application server. This is frequently done by adding an additional XML file, e.g. with JBoss you might add jboss-web.xml. Other application servers do this via some sort of UI when the application is deployed, e.g. Oracle AS has a web interface for this (as well as config files).

So, did you do this for your app?

RaymondDeCampoa at 2007-7-12 21:33:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Yes. There is sun-web.xml file for the Sun's Server. And I had to put a similar entry in the sun-web.xml. That file is not affected.

With Netbeans there are two ways to create a web application (jsf). One is to create a new project as a web application and manually code the jsf or the second is to use Netbeans' Visual Web plugin. This issue with the web.xml seems to be only happening when I create the project with Netbeans' Visual Web plugin.

lewkima at 2007-7-12 21:33:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...