I'm trying to run an existing WebSphere application in Liberty Profile but have run into a problem. The application has a resource environment entry configured in the server which I need to translate into a Liberty Profile resource. How can I configure a JNDI resource in the server.xml, that isn't a datasource (dataSource) or a constant (jndiEntry)?
Many thanks
You can configure this using the element in the server.xml. This is documented in the infocenter. Essentially you enable the jndi feature in the server.xml using this:
Then you can configure the JNDI entries. You can only do simple types using this, so no complex objects. To configure your entry you then do this:
The Liberty profile does type inference, so if you expressed this:
you get an Number from JNDI. If you express this:
You get a Double.
If you want a number as a string literal you would express it using quotes:
To get this from your application you can do a global lookup such as:
You can also map this to a resource environment entry in the ibm-web-bnd.xml file:
and then use this code to look it up:
In 8.5.5.x there are several new entries:
For example: To configure an URL you can use the jndiURLEntry
Currently this is not possible with Liberty Profile. This question was answered in the IBM WasDev forum here https://developer.ibm.com/answers/questions/6221/resource-environment-entries-in-liberty-profile/?community=wasdev A RFE process (31525) has been created for it to support it in a future release.