From cc13f6eac18c339eb0619019f355f5f699e631bf Mon Sep 17 00:00:00 2001 From: Gaetano Savo Date: Tue, 8 Apr 2025 17:06:22 +0200 Subject: [PATCH] pulizia --- .gitignore | 3 + config.json | 5 +- config/standalone-ADVC-full.xml | 631 ++++++++++++++++++ .../advc360/bes/startup/main/build.xml | 26 - .../bes/startup/CustomLogFormatter.class | Bin 1984 -> 0 bytes .../bes/startup/main/custom-formatter.jar | Bin 2101 -> 0 bytes .../advc360/bes/startup/main/module.xml | 10 - .../bes/startup/CustomLogFormatter.java | 58 -- start-jboss.ps1 | 38 +- 9 files changed, 654 insertions(+), 117 deletions(-) create mode 100644 config/standalone-ADVC-full.xml delete mode 100644 modules/com/armundia/advc360/bes/startup/main/build.xml delete mode 100644 modules/com/armundia/advc360/bes/startup/main/build/classes/com/armundia/adv360/bes/startup/CustomLogFormatter.class delete mode 100644 modules/com/armundia/advc360/bes/startup/main/custom-formatter.jar delete mode 100644 modules/com/armundia/advc360/bes/startup/main/module.xml delete mode 100644 modules/com/armundia/advc360/bes/startup/main/src/com/armundia/adv360/bes/startup/CustomLogFormatter.java diff --git a/.gitignore b/.gitignore index 5d7032f..993ec6b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ # Project directories arm_am*/ asset-gui/ +CustomLogFormatter/build.properties +CustomLogFormatter/custom-formatter.jar +CustomLogFormatter/build diff --git a/config.json b/config.json index 8519d49..fd76153 100644 --- a/config.json +++ b/config.json @@ -3,10 +3,7 @@ "deploymentDir": "C:\\Dev2012\\BUILDERS\\jboss-eap-7.4\\standalone\\deployments", "javaHome": "C:\\Dev2012\\BUILDERS\\java\\jdk1.8.0_291", "jboss": { - "configFile": "standalone\\configuration\\standalone-ADVC-full.xml", - "modules": { - "logmanager": "modules\\system\\layers\\base\\org\\jboss\\logmanager\\main" - } + "configFile": "standalone\\configuration\\standalone-ADVC-full.xml" }, "customFormatter": { "src": "src", diff --git a/config/standalone-ADVC-full.xml b/config/standalone-ADVC-full.xml new file mode 100644 index 0000000..e8add3e --- /dev/null +++ b/config/standalone-ADVC-full.xml @@ -0,0 +1,631 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + h2 + + sa + sa + + + + jdbc:postgresql://localhost:5432/advc?currentSchema=advc_own + postgresql + + bes2 + Armu4010 + + + select 1 + true + 300000 + + + 5 + + + + + org.h2.jdbcx.JdbcDataSource + + + org.postgresql.Driver + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${jboss.bind.address:127.0.0.1} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/com/armundia/advc360/bes/startup/main/build.xml b/modules/com/armundia/advc360/bes/startup/main/build.xml deleted file mode 100644 index 16656d2..0000000 --- a/modules/com/armundia/advc360/bes/startup/main/build.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/com/armundia/advc360/bes/startup/main/build/classes/com/armundia/adv360/bes/startup/CustomLogFormatter.class b/modules/com/armundia/advc360/bes/startup/main/build/classes/com/armundia/adv360/bes/startup/CustomLogFormatter.class deleted file mode 100644 index c94c3a2ca707b09af1c61119e28a0cac5caa369b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1984 zcmaJ?O?MMj7=CW^aVNu6AyBZO7_ea4CJYp*kk%@cV%4S~i9lOhy-jXI%1kECOj_&r z!nJ$1Zrq}tllJJ5g$ow`1^M0={;r1i zG|cJ9V_prnHQdn&;e9pSRTc#eMI9gDo`(B69$-en64HW>MJ#cA$g#}OUlzW+<+!%+ zed#g`&8>?KVfs~DnrngByh#>C+V5ITFvKUTwW>eG5J?Z;V~9>WWyxT8zFVz7$j=o; z#bY?14#6x@tC$5+)hZLi`$ZH)!55`Rc~LKlRf}-q;mHh_S_lolYMGW(sSt!Y=Tz>> zlH-Vf;`o?Bn=DyDtOj01nxqB-OrpEcwc>PA*FZ zK2dgk%PHDXJgxx`q;3S#;go?5Tre<#Q3IR!l#FzaEd!t7b3#uDpAP+kg59EDHlNRy z%c=3)T)R;#SA{9c8<)o~nyb7}lAQB9SeMuoi$SiI=eWVy{@I;ZArQl9A+5%-%=RPBQgz6Cw092fPvtPz{C zJ%Zow(V`fgsa2#uCpRSJy&GIt9|9#AhN*3OWkenyF&@36bdJ}5Tif5?Rn{WqC%Jn z(vX?6S)*jT@(85ri6H-@dpB%XOoyu=)ngLyj3JdC?#ypbwMW5_@~t|xJzHvqv%xV3 z5`iLi*6sxFCq>-mPG{jexfUkd<59&Kdbx+_Yr$|*y)?9n(wZJE8i#3jgl2lJ5F6PB z`-v7npL!=+>I@>Z2abBEp9 z%^$xZzOW6R&+I_^8HpzJCJrSH8txNde-qEmXOhoHf5+j4NVc$pBTAD=CTSx5QDuBA z6b;a{gX2w{P{J3KaD+?-bJ5JmV00TNm4pPRo?<$ae6hW2;-y?{F!p3T9vSB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Id8^|OMAXH;wVED-j;sF5NTj)pt diff --git a/modules/com/armundia/advc360/bes/startup/main/module.xml b/modules/com/armundia/advc360/bes/startup/main/module.xml deleted file mode 100644 index 6b2693f..0000000 --- a/modules/com/armundia/advc360/bes/startup/main/module.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/modules/com/armundia/advc360/bes/startup/main/src/com/armundia/adv360/bes/startup/CustomLogFormatter.java b/modules/com/armundia/advc360/bes/startup/main/src/com/armundia/adv360/bes/startup/CustomLogFormatter.java deleted file mode 100644 index 9c476ef..0000000 --- a/modules/com/armundia/advc360/bes/startup/main/src/com/armundia/adv360/bes/startup/CustomLogFormatter.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.armundia.adv360.bes.startup; - -import java.util.logging.Formatter; -import java.util.logging.LogRecord; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; - -public class CustomLogFormatter extends Formatter { - - private static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss,SSS"); - - private String stripXMLTags(String input) { - if (input == null || input.isEmpty()) { - return input; - } - return input.replaceAll("<[^>]*>", ""); - } - - @Override - public String format(LogRecord record) { - StringBuilder sb = new StringBuilder(); - - // Data e ora - sb.append(ZonedDateTime.now().format(dateFormatter)) - .append(" "); - - // Livello log padded a 5 caratteri - String level = record.getLevel().toString(); - sb.append(String.format("%-5s", level)); - - // Nome classe - sb.append("[") - .append(record.getSourceClassName()) - .append("] "); - - // Thread - sb.append("(") - .append(Thread.currentThread().getName()) - .append(") "); - - // Messaggio - String message = formatMessage(record); - sb.append(stripXMLTags(message)); - - // Stack trace se presente - if (record.getThrown() != null) { - sb.append("\n"); - for (StackTraceElement element : record.getThrown().getStackTrace()) { - sb.append("\tat ") - .append(element.toString()) - .append("\n"); - } - } - - sb.append("\n"); - return sb.toString(); - } -} diff --git a/start-jboss.ps1 b/start-jboss.ps1 index fae6756..a8f11d7 100644 --- a/start-jboss.ps1 +++ b/start-jboss.ps1 @@ -26,13 +26,6 @@ if (-not (Test-Path $JBOSS_HOME)) { exit 1 } -# Check if configuration file exists -$configFile = Join-Path $JBOSS_HOME $config.jboss.configFile -if (-not (Test-Path $configFile)) { - Write-Host "Error: Configuration file not found at $configFile" -ForegroundColor Red - exit 1 -} - # Set environment variables $env:JAVA_HOME = $JAVA_HOME $env:JBOSS_HOME = $JBOSS_HOME @@ -41,6 +34,17 @@ $env:NOPAUSE = "true" # Remove this as it might affect logging # $env:LAUNCH_JBOSS_IN_BACKGROUND = "true" +# Set configuration file +$configFile = "standalone-ADVC-full.xml" + +# Copy configuration file from local config directory +$sourceConfig = "$PSScriptRoot\config\$configFile" +$targetConfig = "$JBOSS_HOME\standalone\configuration\$configFile" +if (Test-Path $sourceConfig) { + Write-Host "Copying configuration file from $sourceConfig to $targetConfig" -ForegroundColor Yellow + Copy-Item -Path $sourceConfig -Destination $targetConfig -Force +} + # Check if JBoss is already running if (Test-JBossRunning) { Write-Host "JBoss is already running!" -ForegroundColor Yellow @@ -50,11 +54,10 @@ if (Test-JBossRunning) { Write-Host "Starting JBoss EAP 7.4..." -ForegroundColor Green Write-Host "Using Java from: $JAVA_HOME" -ForegroundColor Yellow Write-Host "JBoss Home: $JBOSS_HOME" -ForegroundColor Yellow -Write-Host "Using configuration: $($config.jboss.configFile)" -ForegroundColor Yellow +Write-Host "Using configuration: $configFile" -ForegroundColor Yellow -# Start JBoss in standalone mode -$startScript = Join-Path $JBOSS_HOME "bin\standalone.bat" -$jvmOptions = @( +# Set JVM options +$jvmOpts = @( "-DIDServer=GS", "-Dbtf.PathToParse=C:\Dev2012\advc0\in", "-Djava.awt.headless=true", @@ -66,20 +69,16 @@ $jvmOptions = @( "-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n" ) -# Add JVM options to JAVA_OPTS -$env:JAVA_OPTS = "$($jvmOptions -join ' ')" - -Write-Host "Starting JBoss with custom JVM options..." -ForegroundColor Green -Write-Host "JVM Options: $env:JAVA_OPTS" -ForegroundColor Yellow -Write-Host "Remote debugging enabled on port 8787" -ForegroundColor Cyan +Write-Host "Starting JBoss with custom JVM options..." -ForegroundColor Yellow +Write-Host "JVM Options: $($jvmOpts -join ' ')" -ForegroundColor Gray # Create the command line arguments -$cmdArgs = "-c $($config.jboss.configFile) --debug -b 0.0.0.0 -bmanagement 0.0.0.0" +$cmdArgs = "-c $configFile --debug -b 0.0.0.0 -bmanagement 0.0.0.0" # Start JBoss - Modified to use Start-Process with RedirectStandardOutput $logFile = Join-Path $JBOSS_HOME "standalone\log\server.log" $processStartInfo = @{ - FilePath = $startScript + FilePath = Join-Path $JBOSS_HOME "bin\standalone.bat" ArgumentList = $cmdArgs RedirectStandardOutput = $logFile RedirectStandardError = Join-Path $JBOSS_HOME "standalone\log\server_error.log" @@ -88,6 +87,7 @@ $processStartInfo = @{ PassThru = $true } +Write-Host "Remote debugging enabled on port 8787" -ForegroundColor Yellow Write-Host "Starting JBoss and redirecting output to $logFile" -ForegroundColor Yellow $jbossProcess = Start-Process @processStartInfo