User Tools

Site Tools


transmission_of_audio_and_video:audio_and_video

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
transmission_of_audio_and_video:audio_and_video [2025/12/25 20:12] apereztransmission_of_audio_and_video:audio_and_video [2025/12/25 20:42] (current) aperez
Line 15: Line 15:
  
  
-====== Arranque Automático de Aplicación Java (VisionLite) como Servicio en Windows ====== 
  
-===== Objetivo ===== 
-Configurar la aplicación Java **VisionLite** para que se ejecute automáticamente cada vez que el servidor Windows inicia, sin depender del inicio de sesión de un usuario, utilizando **NSSM (Non-Sucking Service Manager)**. 
  
-La aplicación se ejecuta originalmente con el comando:+ 
 +====== Automatic Startup of Java Application (VisionLite) as a Windows Service ====== 
 + 
 +===== Purpose ===== 
 +Establish a standard, reproducible, and best-practice-aligned procedure to run a Java (.jar) 
 +application as a **Windows Service**, ensuring: 
 + 
 +  * Automatic startup when the server boots 
 +  * Independence from user login 
 +  * Automatic restart on failures 
 +  * Use of standard production paths 
 + 
 +--- 
 + 
 +===== Scenario ===== 
 +Java application manually executed with:
  
 <code> <code>
 java -jar VLite_2_3_169.jar java -jar VLite_2_3_169.jar
 </code> </code>
 +
 +Requirement:
 +The application must start automatically after every operating system reboot.
  
 --- ---
  
-===== Requisitos Previos ===== +===== Requirements ===== 
-  * Sistema operativo: Windows Server / Windows 10+ +  * Windows Server 2016+ / Windows 10+ 
-  * Java instalado (Java 8 en este caso+  * PowerShell with administrative privileges 
-  * NSSM instalado (vía Chocolatey+  * Internet connectivity (initial installation
-  * Acceso administrativo al servidor+  * Java Runtime Environment (JRE
 +  * NSSM (Non-Sucking Service Manager)
  
 --- ---
  
-===== Verificación de Java ===== +===== Step 1 — Chocolatey Installation ===== 
-Confirmar que Java está instalado y funcional:+Chocolatey is the standard Windows package manager.
  
 +==== Verification ====
 <code powershell> <code powershell>
-java -version+choco -v
 </code> </code>
  
-Salida esperada (ejemplo):+==== Installation (if not present==== 
 +<code powershell> 
 +Set-ExecutionPolicy Bypass -Scope Process -Force 
 +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 
 +iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 
 +</code> 
 + 
 +Close and reopen PowerShell. 
 + 
 +--- 
 + 
 +===== Step 2 — Java Installation and Verification ===== 
 +Java LTS is recommended (Java 8 or 11). 
 + 
 +==== Java 8 Installation ==== 
 +<code powershell> 
 +choco install jre8 -y 
 +</code> 
 + 
 +==== Verification ==== 
 +<code powershell> 
 +java -version 
 +</code>
  
 +Validated output in this environment:
 <code> <code>
 java version "1.8.0_261" java version "1.8.0_261"
-Java(TM) SE Runtime Environment 
 </code> </code>
  
 --- ---
  
-===== Identificación de la Ruta REAL de Java ===== +===== Step 3 — Identifying the REAL Java Path ===== 
-Es importante usar el binario real de Java y no el wrapper `javapath`.+⚠️ Do NOT use the wrapper
 +<code> 
 +C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe 
 +</code>
  
 +==== Validate the real binary ====
 <code powershell> <code powershell>
 Test-Path "C:\Program Files\Java\jre1.8.0_261\bin\java.exe" Test-Path "C:\Program Files\Java\jre1.8.0_261\bin\java.exe"
 </code> </code>
  
-Resultado esperado:+Result:
 <code> <code>
 True True
 </code> </code>
  
-Ruta confirmada de Java:+Confirmed path:
 <code> <code>
 C:\Program Files\Java\jre1.8.0_261\bin\java.exe C:\Program Files\Java\jre1.8.0_261\bin\java.exe
Line 71: Line 114:
 --- ---
  
-===== Instalación de NSSM ===== +===== Step 4 — NSSM Installation ===== 
-(Usando Chocolatey)+NSSM allows applications to run as controlled Windows services.
  
 +==== Installation ====
 <code powershell> <code powershell>
 choco install nssm -y choco install nssm -y
 </code> </code>
  
-Verificación: +==== Verification ====
 <code powershell> <code powershell>
 nssm version nssm version
Line 86: Line 129:
 --- ---
  
-===== Verificación del Servicio ===== +===== Step 5 — Service Verification ===== 
-Comprobar si el servicio ya existe:+Check whether the service already exists:
  
 <code powershell> <code powershell>
Line 93: Line 136:
 </code> </code>
  
-Resultado esperado:+Validated result:
 <code> <code>
 Name        DisplayName   Status Name        DisplayName   Status
Line 101: Line 144:
 --- ---
  
-===== Configuración del Servicio VisionLite ===== +===== Step 6 — VisionLite Service Configuration ===== 
-Ejecutar todos los comandos en **PowerShell como Administrador**.+All commands must be executed in **PowerShell as Administrator**.
  
-==== Definición del ejecutable Java ====+==== Java executable definition ====
 <code powershell> <code powershell>
 nssm set VisionLite Application "C:\Program Files\Java\jre1.8.0_261\bin\java.exe" nssm set VisionLite Application "C:\Program Files\Java\jre1.8.0_261\bin\java.exe"
 </code> </code>
  
-==== Parámetros del JAR ====+==== Execution parameters ====
 <code powershell> <code powershell>
 nssm set VisionLite AppParameters "-jar VLite_2_3_169.jar" nssm set VisionLite AppParameters "-jar VLite_2_3_169.jar"
 </code> </code>
  
-==== Directorio de trabajo (CRÍTICO) ==== +==== Initial working directory ====
-Este directorio debe contener el JAR y sus carpetas asociadas. +
 <code powershell> <code powershell>
 nssm set VisionLite AppDirectory "C:\Users\Administrator\Desktop\Software" nssm set VisionLite AppDirectory "C:\Users\Administrator\Desktop\Software"
 </code> </code>
  
-==== Arranque automático ====+==== Automatic startup ====
 <code powershell> <code powershell>
 nssm set VisionLite Start SERVICE_AUTO_START nssm set VisionLite Start SERVICE_AUTO_START
 </code> </code>
  
-==== Reinicio automático si falla ====+==== Automatic restart on failure ====
 <code powershell> <code powershell>
 nssm set VisionLite AppExit Default Restart nssm set VisionLite AppExit Default Restart
Line 134: Line 175:
 --- ---
  
-===== Inicio del Servicio =====+===== Step 7 — Service Start and Validation =====
 <code powershell> <code powershell>
 nssm start VisionLite nssm start VisionLite
-</code> 
- 
-Verificación: 
- 
-<code powershell> 
 sc query VisionLite sc query VisionLite
 </code> </code>
  
-Estado esperado:+Validated state:
 <code> <code>
 STATE : 4  RUNNING STATE : 4  RUNNING
 </code> </code>
  
---- +==== Auto-start confirmation ====
- +
-===== Confirmación de Arranque Automático =====+
 <code powershell> <code powershell>
 sc qc VisionLite sc qc VisionLite
 </code> </code>
  
-Resultado esperado:+Result:
 <code> <code>
 START_TYPE : 2  AUTO_START START_TYPE : 2  AUTO_START
Line 164: Line 198:
 --- ---
  
-===== Validación de Configuración (Dump NSSM) ===== +===== Step 8 — Best Practice Correction ===== 
-Permite revisar toda la configuración efectiva del servicio:+A user Desktop–based path is **NOT recommended** for production.
  
-<code powershell+==== Standard path defined ==== 
-nssm dump VisionLite+<code> 
 +C:\Services\VisionLite
 </code> </code>
  
 --- ---
  
-===== Resultado Final ===== +===== Step 9 — Service Migration to Standard Path ===== 
-  VisionLite se ejecuta como **Servicio de Windows** + 
-  * Arranca automáticamente en cada reinicio del servidor +==== Stop the service ==== 
-  * No depende de login de usuario +<code powershell> 
-  Se reinicia automáticamente si el proceso Java falla+nssm stop VisionLite 
 +</code> 
 + 
 +==== Create production directory ==== 
 +<code powershell> 
 +mkdir C:\Services\VisionLite 
 +</code> 
 + 
 +==== Migrate application files ==== 
 +<code powershell> 
 +Move-Item "C:\Users\Administrator\Desktop\Software\*" "C:\Services\VisionLite\" -Force 
 +</code> 
 + 
 +==== Update service working directory ==== 
 +<code powershell> 
 +nssm set VisionLite AppDirectory "C:\Services\VisionLite" 
 +</code> 
 + 
 +==== Restart the service ==== 
 +<code powershell> 
 +nssm start VisionLite 
 +sc query VisionLite 
 +</code>
  
 --- ---
  
-===== Operación Diaria ===== +===== Step 10 — Final Validation ===== 
-Comandos útiles:+==== NSSM configuration dump ==== 
 +<code powershell> 
 +nssm dump VisionLite 
 +</code> 
 + 
 +Confirm: 
 +<code> 
 +AppDirectory C:\Services\VisionLite 
 +</code> 
 + 
 +==== Recommended test ==== 
 +Reboot the server and verify the service is in RUNNING state. 
 + 
 +---
  
 +===== Daily Operations =====
 <code powershell> <code powershell>
 nssm start VisionLite nssm start VisionLite
Line 193: Line 264:
 --- ---
  
-===== Nota Técnica ===== +===== Troubleshooting ===== 
-A partir de esta configuración, **NO se debe ejecutar manualmente** el comando:+^ Symptom ^ Probable cause ^ Corrective action ^ 
 +| Service stops | Incorrect directory | Verify AppDirectory | 
 +| JAR does not start | Incorrect Java path | Validate real java.exe | 
 +| Does not start after reboot | Not AUTO_START | Verify sc qc | 
 +| Files not found | Relative paths | Use standard path |
  
 +---
 +
 +===== Best Practices =====
 +  * Use `C:\Services` or `C:\ProgramData`
 +  * Avoid user-profile-dependent paths
 +  * Document changes in Wiki
 +  * Centralize management with NSSM
 +  * Consider a dedicated service account for critical services
 +
 +---
 +
 +===== Final Note =====
 +Once configured as a service:
 +
 +❌ DO NOT manually execute:
 <code> <code>
 java -jar VLite_2_3_169.jar java -jar VLite_2_3_169.jar
 </code> </code>
  
-Toda la gestión debe realizarse través del servicio **VisionLite**.+✅ Manage exclusively as Windows service.
  
 --- ---
-**Autor:** Antonio Pérez   + 
-**Rol:** Network Engineer  +<code powershell> 
 +nssm stop VisionLite 
 +sc query VisionLite 
 + 
 +nssm set VisionLite Application "C:\Program Files\Java\jre1.8.0_261\bin\java.exe" 
 +nssm set VisionLite AppParameters "-jar VLite_2_3_169.jar" 
 +nssm set VisionLite AppDirectory "C:\Services\VisionLite" 
 +nssm set VisionLite Start SERVICE_AUTO_START 
 +nssm set VisionLite AppExit Default Restart 
 +nssm set VisionLite AppRestartDelay 60000 
 + 
 +nssm start VisionLite 
 +sc query VisionLite 
 + 
 +sc qc VisionLite 
 + 
 +nssm dump VisionLite 
 + 
 +nssm start VisionLite 
 +nssm stop VisionLite 
 +nssm restart VisionLite 
 +sc query VisionLite 
 +</code> 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
  
  
transmission_of_audio_and_video/audio_and_video.1766693544.txt.gz · Last modified: by aperez

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki