Java Server-Side API Prerequisites
In order to practically utilize the powerful features of Java Server-Side NCache, make sure to implement the prerequisites discussed in this section.
Java Server-Side Prerequisites
To utilize the Java Server-Side features, ensure that following prerequisites are fulfilled.
- Add the following Maven dependencies in your
pom.xml
file:
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<!--for NCache Enterprise-->
<artifactId>ncache-client</artifactId>
<!--for NCache Professional-->
<!--artifactId>ncache-professional-client</artifactId-->
<version>x.x.x</version>
</dependency>
- Import the following namespaces in your application based on the feature you intend to use:
- The cache must be running.
- Make sure that the data being added is serializable.
- To ensure the operation is fail-safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
- To handle any unseen exceptions, refer to the Troubleshooting section.
Feature Specific Namespaces
Aside from the namespaces employed in most features, you should add the following namespaces/packages based on the Java server side feature/API you intend to use and whether or not they require them.
Note
Any feature not mentioned in the list below either does not work with the specified feature or only requires the general namespaces/packages.
- For Cache Loader and Refresher:
- For Data Source Providers:
- For Custom Dependency:
See Also
How to Connect to Cache
Error Handling in Cache
Troubleshooting