Configuration Mid Server On ServiceNow Infrastructure

In this blog, we’ll delve into the essential steps to run external java applications in the ServiceNow MID Server infrastructure. The integration of custom Java applications into ServiceNow MID Server infrastructure offers a robust means to enhance the platform’s capabilities significantly such as employ encryption libraries, interface with external frameworks, data exchanges with data sources/services and execute intricate calculations.

1. Creating ServiceNow Application

To create a new application in ServiceNow platform, follow these steps:

  • Sign up for an account using this link.
  • Log into your ServiceNow account through your web browser.
  • Access your instance of ServiceNow.
  • Utilize the search bar and type “App Engine Studio.”
App Engine Studio
Fig: App Engine Studio
  • Open the App Engine Studio from the search results.
  • Within the App Engine Studio interface, navigate to and select the option to create a new application.
App Engine Studio interface
Fig: App Engine Studio interface
  • Provide a simple description, such as “testApplication” and name the application “test description”
Creating ServiceNow Application
Fig: Creating ServiceNow Application
  • Select the “Create” button to initiate the application creation process.
  • Navigate to the “Continue in Studio (Advanced)” link to access the advanced Studio features, opening the “Select Application” dialog.
  • Open the “testApplication” by clicking the corresponding link, facilitating access to the application for further editing.

2. Setup Amazon EC2 Instance

You can run the MID Server on any platform(Windows, Linux, Mac, …). For our example, let’s launch ServiceNow MID server in the Amazon EC2 Windows instance. 

  • Launch a Windows Server EC2 instance on AWS
  • Ensure that the instance
    • Have sufficient resources (CPU, memory) to run the MID Server.
    • You have proper administrative credentials for the Windows Server instance.

3. Installing MID Server on the EC2 Instance

Next step is to install ServiceNow MID server on the AWS EC2 windows instance. It can be achieved by following steps:

  • Following the initial login instructions provided, proceed to select the appropriate ServiceNow instance from the menu. Ensure the instance fully loads, then use the search function to locate “MID Server”. Once you find the MID Server option, select it to access the download section.
  • From there, proceed to download the MID Server package suitable for your system.
Download MID Server
Fig: Download MID Server
  • Install the MID Server on the EC2 Windows Server following the installation instructions.
  • In the ServiceNow MID Server setup menu, enter the following:
    • MID Server Name: Your MID server’s hostname.
    • Service Account Name: The username of the dedicated service account.
    • Service Account Password: The password for the service account.
Installing Mid-Server on the EC2 Windows Server
 Fig: Installing Mid-Server on the EC2 Windows Server
  • After that to establish a connection within the MID Server Configuration Settings panel, input the following essential details:
    • ServiceNow Instance URL: This is the unique address of your ServiceNow environment.
    • ServiceNow MID Server Username: The designated username specifically created for MID Server authentication.
    • ServiceNow MID Server Password: The corresponding secure password for the MID Server user account
ServiceNow developer My instance menu
Fig: ServiceNow developer My instance menu
  • These credentials are retrievable from the ‘Manage instance password’ section located under the ‘My Instance’ tab of the ServiceNow Developer Portal.
Credentials for configuring Mid-Server on the EC2 Windows Server
Fig: Credentials for configuring Mid-Server on the EC2 Windows Server

Review MID-server configuration
Fig: Review MID-server configuration
  • Figure depicts the review stage of the MID Server configuration process.
ServiceNow MID-server view
 Fig: ServiceNow MID-server view
  • Once the configuration is complete and successful, the MID Server should be visible. To access this, navigate to ServiceNow Studio and select the ‘MID Server’ option from the menu. Here, you’ll be able to view and manage your configured MID Server(s).

4. Add a JAR file to the MID Server

In order to run your java application in ServiceNow MID Server, you need to compress your java application class files into a JAR file. This JAR file can be added to MID Server following the steps given below:

  • In the main ServiceNow studio menu, use the search functionality at the top of the interface.
  • Type “MID Server” into the search bar and initiate the search.
  • Once the MID Server option appears in the search results, select it.
  • Look for the section where you can download the JAR file for the MID Server.
  • Choose the appropriate JAR file and follow any additional instructions to download and install it.
Adding JAR file into the MID Server
Fig: Adding JAR file into the MID Server
  • Once the JAR file has been added to ServiceNow and integrated with the MID Server, its presence becomes visible and accessible within the MID Server environment.
MID-server showing the newly added JAR file
Fig: MID-server showing the newly added JAR file

5. Running Java application from MID Server

To run the custom java application, launch the newly added JAR file from the MID Server using the steps mentioned below:

Step 1: Start Command Line Interface:

On Windows: Open Command Prompt.
On Unix/Linux/macOS: Open Terminal.

Step 2: Locate MID Server Directory: Navigate to the directory containing your MID Server using the change directory command.

cd /path/to/MIDServer/agent

Step 3: Run the JAR file by issuing following command

java -jar your-jar-file-name.jar

Note: Replace ‘your-jar-file-name.jar’ with the actual name of the JAR file you wish to run.

Conclusion

This guide provides a step-by-step walkthrough for configuring the MID Server on the ServiceNow infrastructure. It begins with creating a test application, ‘testApplication,’ within ServiceNow’s Studio, followed by the integration of custom Java applications to enhance the platform’s capabilities. The MID Server, operating as either a Windows service or UNIX daemon, becomes a pivotal component for seamless communication and data exchange between ServiceNow and external entities. The guide emphasizes the importance of launching a Windows Server EC2 instance on AWS with sufficient resources for the MID Server. The incorporation of a JAR file into the MID Server, along with the installation of JDK 21, expands functionalities and ensures compatibility with the latest Java features.

17 thoughts on “Configuration Mid Server On ServiceNow Infrastructure

Add yours

  1. Pingback: How to Troubleshoot Thread leak on ServiceNow MID server - yCrash

Share your Thoughts!

Up ↑

Index

Discover more from yCrash

Subscribe now to keep reading and get access to the full archive.

Continue reading