transmission_of_audio_and_video:audio_and_video
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| transmission_of_audio_and_video:audio_and_video [2025/12/25 20:19] – aperez | transmission_of_audio_and_video:audio_and_video [2025/12/25 20:42] (current) – aperez | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| - | ====== Arranque Automático de Aplicaciones Java como Servicio en Windows (Guía Técnica Estándar) ====== | ||
| - | ===== Propósito | + | ====== |
| - | Esta guía describe el **procedimiento estándar y reutilizable** para configurar una aplicación | + | |
| - | El método utiliza | + | ===== Purpose ===== |
| + | Establish a standard, reproducible, | ||
| + | application as a **Windows | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| --- | --- | ||
| - | ===== Escenario de Uso ===== | + | ===== Scenario |
| - | Aplicaciones | + | Java application manually executed with: |
| < | < | ||
| - | java -jar application.jar | + | java -jar VLite_2_3_169.jar |
| </ | </ | ||
| - | Que deben: | + | Requirement: |
| - | * Iniciar automáticamente al arrancar Windows | + | The application must start automatically after every operating system reboot. |
| - | * Ejecutarse sin sesión iniciada | + | |
| - | * Reiniciarse si fallan | + | |
| - | * Permanecer operativas en segundo plano | + | |
| --- | --- | ||
| - | ===== Requisitos del Sistema | + | ===== Requirements |
| * Windows Server 2016+ / Windows 10+ | * Windows Server 2016+ / Windows 10+ | ||
| - | * Acceso administrativo | + | * PowerShell with administrative privileges |
| - | * Conectividad a Internet (para instalación inicial) | + | * Internet |
| - | * PowerShell 5+ (recomendado PowerShell 7) | + | * Java Runtime Environment |
| + | * NSSM (Non-Sucking Service Manager) | ||
| --- | --- | ||
| - | ===== Paso 1 — Instalación de Chocolatey ===== | + | ===== Step 1 — Chocolatey |
| - | Chocolatey | + | Chocolatey |
| - | ==== Verificación previa | + | ==== Verification |
| <code powershell> | <code powershell> | ||
| choco -v | choco -v | ||
| </ | </ | ||
| - | Si no existe, instalarlo: | + | ==== Installation (if not present) ==== |
| <code powershell> | <code powershell> | ||
| Set-ExecutionPolicy Bypass -Scope Process -Force | Set-ExecutionPolicy Bypass -Scope Process -Force | ||
| Line 65: | Line 67: | ||
| </ | </ | ||
| - | Cerrar y abrir PowerShell | + | Close and reopen |
| --- | --- | ||
| - | ===== Paso 2 — Instalación de Java ===== | + | ===== Step 2 — Java Installation and Verification |
| - | Se recomienda **Java LTS (Java 8 o 11)** para aplicaciones legacy. | + | Java LTS is recommended |
| - | ==== Instalación | + | ==== Java 8 Installation |
| <code powershell> | <code powershell> | ||
| choco install jre8 -y | choco install jre8 -y | ||
| </ | </ | ||
| - | ==== Verificación | + | ==== Verification |
| <code powershell> | <code powershell> | ||
| java -version | java -version | ||
| </ | </ | ||
| - | Ejemplo esperado: | + | Validated output in this environment: |
| < | < | ||
| java version " | java version " | ||
| Line 89: | Line 91: | ||
| --- | --- | ||
| - | ===== Paso 3 — Identificación de la Ruta REAL de Java ===== | + | ===== Step 3 — Identifying the REAL Java Path ===== |
| - | ⚠️ | + | ⚠️ |
| < | < | ||
| C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe | C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe | ||
| </ | </ | ||
| - | ==== Validar binario | + | ==== Validate the real binary |
| <code powershell> | <code powershell> | ||
| Test-Path " | Test-Path " | ||
| </ | </ | ||
| - | Resultado esperado: | + | Result: |
| < | < | ||
| True | True | ||
| </ | </ | ||
| - | Ruta estándar utilizada: | + | Confirmed path: |
| < | < | ||
| C:\Program Files\Java\jre1.8.0_261\bin\java.exe | C:\Program Files\Java\jre1.8.0_261\bin\java.exe | ||
| Line 112: | Line 114: | ||
| --- | --- | ||
| - | ===== Paso 4 — Instalación de NSSM ===== | + | ===== Step 4 — NSSM Installation |
| - | NSSM permite ejecutar aplicaciones como servicios | + | NSSM allows applications to run as controlled |
| - | ==== Instalación | + | ==== Installation |
| <code powershell> | <code powershell> | ||
| choco install nssm -y | choco install nssm -y | ||
| </ | </ | ||
| - | ==== Verificación | + | ==== Verification |
| <code powershell> | <code powershell> | ||
| nssm version | nssm version | ||
| Line 127: | Line 129: | ||
| --- | --- | ||
| - | ===== Paso 5 — Preparación de la Aplicación | + | ===== Step 5 — Service Verification |
| - | Buenas prácticas recomendadas: | + | Check whether the service already exists: |
| - | + | ||
| - | * Ubicar la aplicación fuera del Desktop (producción) | + | |
| - | * Ejemplo recomendado: | + | |
| - | < | + | |
| - | C: | + | |
| - | </ | + | |
| - | + | ||
| - | Contenido típico: | + | |
| - | * VLite_2_3_169.jar | + | |
| - | * Carpetas de configuración (Presets, logs, etc.) | + | |
| - | + | ||
| - | --- | + | |
| - | + | ||
| - | ===== Paso 6 — Creación / Verificación del Servicio ===== | + | |
| - | Comprobar si el servicio ya existe: | + | |
| <code powershell> | <code powershell> | ||
| Get-Service *vision* | Format-Table Name, | Get-Service *vision* | Format-Table Name, | ||
| + | </ | ||
| + | |||
| + | Validated result: | ||
| + | < | ||
| + | Name DisplayName | ||
| + | VisionLite VisionLite | ||
| </ | </ | ||
| --- | --- | ||
| - | ===== Paso 7 — Configuración del Servicio con NSSM ===== | + | ===== Step 6 — VisionLite Service Configuration |
| - | Ejecutar | + | All commands must be executed in **PowerShell |
| - | ==== Definición del ejecutable | + | ==== Java executable definition |
| <code powershell> | <code powershell> | ||
| nssm set VisionLite Application " | nssm set VisionLite Application " | ||
| </ | </ | ||
| - | ==== Parámetros | + | ==== 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" | ||
| </ | </ | ||
| - | ==== Directorio de trabajo (CRÍTICO) | + | ==== Initial working directory |
| <code powershell> | <code powershell> | ||
| nssm set VisionLite AppDirectory " | nssm set VisionLite AppDirectory " | ||
| </ | </ | ||
| - | ==== Arranque automático | + | ==== Automatic startup |
| <code powershell> | <code powershell> | ||
| nssm set VisionLite Start SERVICE_AUTO_START | nssm set VisionLite Start SERVICE_AUTO_START | ||
| </ | </ | ||
| - | ==== Reinicio automático | + | ==== Automatic restart on failure |
| <code powershell> | <code powershell> | ||
| nssm set VisionLite AppExit Default Restart | nssm set VisionLite AppExit Default Restart | ||
| Line 182: | Line 175: | ||
| --- | --- | ||
| - | ===== Paso 8 — Inicio y Validación | + | ===== Step 7 — Service Start and Validation |
| <code powershell> | <code powershell> | ||
| nssm start VisionLite | nssm start VisionLite | ||
| Line 188: | Line 181: | ||
| </ | </ | ||
| - | Estado esperado: | + | Validated state: |
| < | < | ||
| STATE : 4 RUNNING | STATE : 4 RUNNING | ||
| </ | </ | ||
| - | ==== Confirmar | + | ==== Auto-start confirmation |
| <code powershell> | <code powershell> | ||
| sc qc VisionLite | sc qc VisionLite | ||
| + | </ | ||
| + | |||
| + | Result: | ||
| + | < | ||
| + | START_TYPE : 2 AUTO_START | ||
| </ | </ | ||
| --- | --- | ||
| - | ===== Paso 9 — Validación Completa (Dump) | + | ===== Step 8 — Best Practice Correction ===== |
| + | A user Desktop–based path is **NOT recommended** for production. | ||
| + | |||
| + | ==== Standard path defined ==== | ||
| + | < | ||
| + | C: | ||
| + | </ | ||
| + | |||
| + | --- | ||
| + | |||
| + | ===== Step 9 — Service Migration to Standard Path ===== | ||
| + | |||
| + | ==== Stop the service ==== | ||
| + | <code powershell> | ||
| + | nssm stop VisionLite | ||
| + | </ | ||
| + | |||
| + | ==== Create production directory ==== | ||
| + | <code powershell> | ||
| + | mkdir C: | ||
| + | </ | ||
| + | |||
| + | ==== Migrate application files ==== | ||
| + | <code powershell> | ||
| + | Move-Item " | ||
| + | </ | ||
| + | |||
| + | ==== Update service working directory ==== | ||
| + | <code powershell> | ||
| + | nssm set VisionLite AppDirectory " | ||
| + | </ | ||
| + | |||
| + | ==== Restart the service ==== | ||
| + | <code powershell> | ||
| + | nssm start VisionLite | ||
| + | sc query VisionLite | ||
| + | </ | ||
| + | |||
| + | --- | ||
| + | |||
| + | ===== Step 10 — Final Validation ===== | ||
| + | ==== NSSM configuration dump ==== | ||
| <code powershell> | <code powershell> | ||
| nssm dump VisionLite | nssm dump VisionLite | ||
| </ | </ | ||
| + | |||
| + | Confirm: | ||
| + | < | ||
| + | AppDirectory C: | ||
| + | </ | ||
| + | |||
| + | ==== Recommended test ==== | ||
| + | Reboot the server and verify the service is in RUNNING state. | ||
| --- | --- | ||
| - | ===== Operación Diaria | + | ===== Daily Operations |
| <code powershell> | <code powershell> | ||
| nssm start VisionLite | nssm start VisionLite | ||
| Line 218: | Line 265: | ||
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| - | ^ Síntoma | + | ^ Symptom |
| - | | El servicio se detiene | + | | Service stops | Incorrect directory |
| - | | El JAR no encuentra archivos | + | | JAR does not start | Incorrect Java path | Validate real java.exe |
| - | | No arranca tras reboot | No AUTO_START | Verificar | + | | Does not start after reboot | Not AUTO_START | Verify |
| - | | Java no inicia | + | | Files not found | Relative paths | Use standard path | |
| --- | --- | ||
| - | ===== Buenas Prácticas | + | ===== Best Practices |
| - | * Usar carpetas dedicadas (`C: | + | * Use `C: |
| - | * Configurar logs stdout/ | + | * Avoid user-profile-dependent paths |
| - | * Usar usuario de servicio dedicado si es crítico | + | * Document changes in Wiki |
| - | * Documentar cambios en Wiki | + | * Centralize management with NSSM |
| + | * Consider a dedicated service account for critical services | ||
| --- | --- | ||
| - | ===== Nota Final ===== | + | ===== Final Note ===== |
| - | Una vez configurado el servicio: | + | Once configured as a service: |
| - | ❌ **NO ejecutar manualmente** | + | |
| + | ❌ DO NOT manually execute: | ||
| < | < | ||
| - | java -jar application.jar | + | java -jar VLite_2_3_169.jar |
| </ | </ | ||
| - | ✅ Gestionar únicamente mediante NSSM / Services.msc | + | ✅ Manage exclusively as a Windows service. |
| --- | --- | ||
| - | **Autor:** Antonio Pérez | + | <code powershell> |
| - | **Rol:** Network Engineer | + | nssm stop VisionLite |
| - | **Uso:** Manual Operativo | + | 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.1766693942.txt.gz · Last modified: by aperez
