Overview
Tomcat (java server process, running the pdftron viewer) uses the port 8005 for the shutdown command, and sometime this port is already in use by another Windows service / program. In this case, the Tomcat server for pdftron doesn't start correctly.
The option was to update the server.xml of the tomcat server and change the shutdown port to something else. Problem now being that next Hubshare update (4.1.x.x) will uninstall pdftron and reinstall it from scratch, causing the change in the server.xml file to be deleted.
Now we will create a registry key to store the port value if the key doesn't exist yet (8005 is the default value). We will install Pdftron Viewer, read the set registry key and edit the server.xml with that value.
Solution
If you are doing the installation/update of Hubshare and you face a port conflict issue, you will have two options.
Option 1:
- Edit the port in the Registry configuration of Hubshare (path is Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Hubshare\Default and key is ViewerShutdownPort) and set the port you want the Viewer to use.
- Change the value also in the C:\WebViewer-Server\apache-tomcat\conf\server.xml file to match the registry key you've edited.
- Restart the pdftron viewer service.
Next Hubshare updates should go smoothly after that.
Option 2:
- Edit the port in the Registry configuration of Hubshare (key is ViewerShutdownPort).
- Re-run the EnsureViewerInstalled.ps1 script (Follow this article if you are not sure how to do it: /article/How-to-re-install-PDFTron-Viewer-Hubshare-On-Premise)
Next Hubshare updates should go smoothly after that.
This article will be applicable only after Hubshare 4.1.x.x version deployment.
Before that, the only solution was to change the port manually in the server.xml file, restart the pdftron service and re-do the operation after each Hubshare update.
