Friday, 10 August 2007

Removing the data-sources.xml from deployment archives in JDeveloper

I am constantly asked how to remove the data-sources.xml file from a deployment EAR file. The issue here is JDeveloper is automatically configured to bundle a data-sources.xml file during deployment which is basically all your JDeveloper connections created as a entry for each connection. The easy way to avoid the data-sources.xml being bundled during deployment is as follows BUT there is a catch to doing this.

Steps

  1. Choose Tools > Preferences to display the Preferences dialog.

  2. Select Deployment on the left side.

  3. Deselect Bundle Default data-sources.xml During Deployment.

  4. Click OK.

So that will ensure you don't end up bundling the data-sources.xml during deployment , as most people have their data sources created at the container level so there is no need to deploy data sources in each application.

The problem is once you deselect the option as shown above if your running an application in the embedded OC4J server and it requires the data-sources.xml then you will get runtime issues. The trick is to switch it on while testing in the embedded OC4J server and then switch it off at deployment time.

This issue is documented here:

http://download-west.oracle.com/docs/html/B25947_01/deployment_topics013.htm

2 comments:

AciD said...

This save my life today. Thanks a lot :)

AciD said...

This save my life today. Thanks a lot :)