URL Resources in WSAD 5.0's WAS 5.0 Test Environment
This note addresses the installation of a J2EE URL resource in
the WAS 5.0 test environment of WebSphere Studio Application
Developer 5.0. This task is easy using the admin web interface
of WAS 5. A facility for adding a URL resource directly into a
WSAD server configuration
has yet to materialize as of WSAD 5.0.2. The following steps
demonstrate how to achieve this using the WAS 5 admin web
interface. This can also be performed by direct modification
of the appropriate resources.xml.
If you want to manually edit your
resources.xml, you have to find the right one.
First you need to determine which WSAD project holds your
WTE server configuration information. You provide this
project name when you create a server configuration. But
I don't know of a way to determine this from the server
configuration itself. If you can't remember which folder
you use for storing WTE configurations, switch to the
server prospective and browse the folders in the Navigator
view. Server projects will be denoted by a special server
folder icon. This should considerably narrow downt the
number of potential projects in which to find your configuration.
Your server project will have a folder named after your server
configuration with the .wsc extension. This folder
should contain the following directory hierarchy:
cells
localhost
resources.xml
Note that we have chosen the resources.xml at the
node scope (localhost) rather than the one at server scope.
If you're not up for direct modification of your server
configuration's resources.xml file, you can opt
for using the admin web application do this for you.
Open the server configuration editor for your configuration
to the Configuration tab. Check the Enable
administration console checkbox and save the change.
Start the server.
Point a browser to the admin application using the
following URL:
http://localhost:9090/admin
9090 is the default admin port. If yours is different,
it will be listed in the configuration editor under the
Ports tab.
Log in.
In the righthand navigation panel, expand
the Resources node and select URL Providers.
Ensure that Node is selected for the scope. Then
click on the Default URL Provider.
At the bottom of the page, under Addition Properties,
click URLs.
Click the New button.
In the Name field, enter a name. This is simply an
administrative name, not a JNDI name.
In the JNDI Name field, enter the JNDI name. This will
be a global JNDI name. When referred to, the
java:comp/env
should not be prepended to the name. This is a global
name accessible to all web applications and EJBs.
In the Spec field, enter the URL string. If you wanted
to refer to a file on your file system that resided at
c:\temp\my.properties
you would enter
file:///c:/temp/my.properties
Click the OK button.
Save the configuration.
Click the Logout menu item in the browser window.
The URL is now configured for your WTE. You can restart the WTE
without the admin application running if you like. In any case,
your server code should be able to acquire a reference to the
URL resource using the globel JNDI name you specified above.
The admin web application can be time consuming. A quicker way
is to manually edit the resources.xml file. Generally
it is not as safe as using the admin web application.
The first step is to locate the relevant
resources.xml file. Open this file in a text editor.
Look for the resources.url:URLProvider tag with the name
attribute of "Default URL Provider." If there are no URLs defined,
the tag should occupy a single line. It should look something like