Remove access to third-party APIs for a Java EE application
By default, Java EE applications do not have access to the third-party APIs available in Liberty. We can also remove access explicitly in server.xml, or an included file. In the following example, an application called Scholar has previously been configured to access third-party APIs. We want to remove this access, and to make it explicit in the configuration that the application now uses the default access setting. The application also uses a common library called Alexandria in...
-
${server.config.dir}/mylib/Alexandria
Steps
- In server.xml, or an included file, remove third-party from the set of values included for the apiTypeVisibility
attribute:
<application id="scholar" name="Scholar" type="ear" location="scholar.ear"> <classloader apiTypeVisibility="spec, ibm-api, stable" commonLibraryRef="Alexandria" /> </application>
- If the application uses any common libraries, set those libraries to use the same API type visibility setting. In server.xml, or an included file, add the following code:
<library id="Alexandria" apiTypeVisibility="spec, ibm-api, stable" > <fileset dir="${server.config.dir}/mylib/Alexandria" includes="*.jar" scanInterval="5s" /> </library>
Parent topic: Configure class loaders and libraries for Java EE applications
Related tasks
- Use a Java library with a Java EE application
- Sharing a library across multiple Java EE applications
- Providing global libraries for all Java EE applications
- Access third-party APIs from a Java EE application
- Overriding a provided API with an alternative version
- Configure the web module class loader for an enterprise application