From 8856beee45b25e3a6b5f6b1cf1c188c510219766 Mon Sep 17 00:00:00 2001 From: Mustapha Bouddahr Date: Thu, 29 Jan 2026 15:41:17 +0100 Subject: [PATCH 1/3] add become a landlord endpoint --- docker-compose.yml | 36 +- hs_err_pid13264.log | 244 ++++++ hs_err_pid14756.log | 803 +++++++++++++++++ hs_err_pid16588.log | 814 ++++++++++++++++++ hs_err_pid3656.log | 244 ++++++ hs_err_pid4644.log | 328 +++++++ init.sql | 1 + .../user/application/Auth0Service.java | 34 +- .../user/presentation/AuthResource.java | 32 +- src/main/resources/application.yml | 18 +- .../db/changelog/00000000000002_listing.xml | 2 +- src/main/resources/liquibase.properties | 6 - 12 files changed, 2520 insertions(+), 42 deletions(-) create mode 100644 hs_err_pid13264.log create mode 100644 hs_err_pid14756.log create mode 100644 hs_err_pid16588.log create mode 100644 hs_err_pid3656.log create mode 100644 hs_err_pid4644.log create mode 100644 init.sql delete mode 100644 src/main/resources/liquibase.properties diff --git a/docker-compose.yml b/docker-compose.yml index 1b75a4f..2c2490a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,27 @@ -version: '3.8' +#version: '3.8' +# +#services: +# backend: +# build: . +# container_name: nbat-backend +# ports: +# - "8080:8080" +# environment: +# SPRING_DATASOURCE_URL: jdbc:postgresql://host.docker.internal:5432/nbat_db +# SPRING_DATASOURCE_USERNAME: postgres +# SPRING_DATASOURCE_PASSWORD: "0000" +# SPRING_JPA_HIBERNATE_DDL_AUTO: update +# extra_hosts: +# - "host.docker.internal:host-gateway" services: - backend: - build: . - container_name: nbat-backend - ports: - - "8080:8080" + postgres: + image: 'postgres:latest' environment: - SPRING_DATASOURCE_URL: jdbc:postgresql://host.docker.internal:5432/nbat_db - SPRING_DATASOURCE_USERNAME: postgres - SPRING_DATASOURCE_PASSWORD: "0000" - SPRING_JPA_HIBERNATE_DDL_AUTO: update - extra_hosts: - - "host.docker.internal:host-gateway" \ No newline at end of file + - POSTGRES_PASSWORD=0000 + - POSTGRES_USER=postgres + - POSTGRES_DB=nbat_db + ports: + - 5432:5432 # ← Back to original port! + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql \ No newline at end of file diff --git a/hs_err_pid13264.log b/hs_err_pid13264.log new file mode 100644 index 0000000..e105d9a --- /dev/null +++ b/hs_err_pid13264.log @@ -0,0 +1,244 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (mmap) failed to map 257949696 bytes. Error detail: G1 virtual space +# Possible reasons: +# The system is out of physical RAM or swap space +# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Zero Based Compressed Oops mode in which the Java heap is +# placed in the first 32GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 32GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (os_windows.cpp:3716), pid=13264, tid=4644 +# +# JRE version: (21.0.9+10) (build ) +# Java VM: OpenJDK 64-Bit Server VM (21.0.9+10-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: -Dmaven.multiModuleProjectDirectory=C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend org.apache.maven.wrapper.MavenWrapperMain spring-boot:run + +Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +Time: Tue Jan 27 23:16:57 2026 Morocco Daylight Time elapsed time: 2.046895 seconds (0d 0h 0m 2s) + +--------------- T H R E A D --------------- + +Current thread (0x00000217e6545930): JavaThread "Unknown thread" [_thread_in_vm, id=4644, stack(0x000000b4db400000,0x000000b4db500000) (1024K)] + +Stack: [0x000000b4db400000,0x000000b4db500000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6df259] (no source info available) +V [jvm.dll+0x8bfe4b] (no source info available) +V [jvm.dll+0x8c23da] (no source info available) +V [jvm.dll+0x8c2ab3] (no source info available) +V [jvm.dll+0x28a416] (no source info available) +V [jvm.dll+0x6de705] (no source info available) +V [jvm.dll+0x6d264a] (no source info available) +V [jvm.dll+0x36742e] (no source info available) +V [jvm.dll+0x36f2fb] (no source info available) +V [jvm.dll+0x3c0c99] (no source info available) +V [jvm.dll+0x3c0f3b] (no source info available) +V [jvm.dll+0x33ace7] (no source info available) +V [jvm.dll+0x33b82b] (no source info available) +V [jvm.dll+0x88976e] (no source info available) +V [jvm.dll+0x3cdbf1] (no source info available) +V [jvm.dll+0x87267c] (no source info available) +V [jvm.dll+0x461751] (no source info available) +V [jvm.dll+0x463391] (no source info available) +C [jli.dll+0x52f0] (no source info available) +C [ucrtbase.dll+0x37b0] (no source info available) +C [KERNEL32.DLL+0x2e8d7] (no source info available) +C [ntdll.dll+0x8c53c] (no source info available) + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00007ffc58617288, length=0, elements={ +} + +Java Threads: ( => current thread ) +Total: 0 + +Other Threads: + 0x00000217e897b600 WorkerThread "GC Thread#0" [id=19296, stack(0x000000b4db500000,0x000000b4db600000) (1024K)] + 0x00000217e898c970 ConcurrentGCThread "G1 Main Marker" [id=17688, stack(0x000000b4db600000,0x000000b4db700000) (1024K)] + 0x00000217e898d470 WorkerThread "G1 Conc#0" [id=7828, stack(0x000000b4db700000,0x000000b4db800000) (1024K)] + +[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc57d0d7a7] +VM state: not at safepoint (not fully initialized) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00007ffc5868b9b0] Heap_lock - owner thread: 0x00000217e6545930 + +Heap address: 0x000000070ae00000, size: 3922 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. +Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + +Heap: + garbage-first heap total 0K, used 0K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 0 young (0K), 0 survivors (0K) + +[error occurred during error reporting (printing heap information), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc580fc219] +GC Heap History (0 events): +No events + +Dll operation events (1 events): +Event: 0.013 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll + +Deoptimization events (0 events): +No events + +Classes loaded (0 events): +No events + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (0 events): +No events + +ZGC Phase Switch (0 events): +No events + +VM Operations (0 events): +No events + +Memory protections (0 events): +No events + +Nmethod flushes (0 events): +No events + +Events (0 events): +No events + + +Dynamic libraries: +0x00007ff7dd740000 - 0x00007ff7dd74e000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.exe +0x00007ffd14000000 - 0x00007ffd14267000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ffd13130000 - 0x00007ffd131f9000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ffd11820000 - 0x00007ffd11c0f000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ffd11c50000 - 0x00007ffd11d9b000 C:\WINDOWS\System32\ucrtbase.dll +0x00007ffd072e0000 - 0x00007ffd072f8000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jli.dll +0x00007ffd07300000 - 0x00007ffd0731e000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\VCRUNTIME140.dll +0x00007ffd12500000 - 0x00007ffd126c5000 C:\WINDOWS\System32\USER32.dll +0x00007ffcebfd0000 - 0x00007ffcec263000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll +0x00007ffd11c20000 - 0x00007ffd11c47000 C:\WINDOWS\System32\win32u.dll +0x00007ffd13b20000 - 0x00007ffd13bc9000 C:\WINDOWS\System32\msvcrt.dll +0x00007ffd13be0000 - 0x00007ffd13c0b000 C:\WINDOWS\System32\GDI32.dll +0x00007ffd11200000 - 0x00007ffd1132c000 C:\WINDOWS\System32\gdi32full.dll +0x00007ffd11480000 - 0x00007ffd11523000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ffd13ae0000 - 0x00007ffd13b11000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffd085d0000 - 0x00007ffd085dc000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\vcruntime140_1.dll +0x00007ffd07250000 - 0x00007ffd072d9000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\msvcp140.dll +0x00007ffc579c0000 - 0x00007ffc5876d000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server\jvm.dll +0x00007ffd12bc0000 - 0x00007ffd12c74000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ffd12a10000 - 0x00007ffd12ab6000 C:\WINDOWS\System32\sechost.dll +0x00007ffd139c0000 - 0x00007ffd13ad8000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffd13c90000 - 0x00007ffd13d04000 C:\WINDOWS\System32\WS2_32.dll +0x00007ffd10fb0000 - 0x00007ffd1100e000 C:\WINDOWS\SYSTEM32\POWRPROF.dll +0x00007ffd0aa10000 - 0x00007ffd0aa45000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ffd0aa50000 - 0x00007ffd0aa5b000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007ffd10f90000 - 0x00007ffd10fa4000 C:\WINDOWS\SYSTEM32\UMPDC.dll +0x00007ffd0fec0000 - 0x00007ffd0fedb000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffd07240000 - 0x00007ffd0724a000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jimage.dll +0x00007ffd04120000 - 0x00007ffd04362000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ffd13600000 - 0x00007ffd13986000 C:\WINDOWS\System32\combase.dll +0x00007ffd126d0000 - 0x00007ffd127a6000 C:\WINDOWS\System32\OLEAUT32.dll +0x00007ffcf6ec0000 - 0x00007ffcf6efc000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ffd11150000 - 0x00007ffd111f5000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007ffd07210000 - 0x00007ffd07231000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll + +JVMTI agents: none + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server + +VM Arguments: +jvm_args: -Dmaven.multiModuleProjectDirectory=C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend +java_command: org.apache.maven.wrapper.MavenWrapperMain spring-boot:run +java_class_path (initial): C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend\.mvn\wrapper\maven-wrapper.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 3 {product} {ergonomic} + uint G1ConcRefinementThreads = 10 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 257949696 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4112515072 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839372 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 4112515072 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Release file: + +Environment Variables: +JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 +PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm;c:\Users\Mustapha\.vscode\extensions\vscjava.vscode-java-debug-0.58.5\bundled\scripts\noConfigScripts +USERNAME=Mustapha +LANG=en_US.UTF-8 +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD +TMP=C:\Users\Mustapha\AppData\Local\Temp +TEMP=C:\Users\Mustapha\AppData\Local\Temp + + + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +OS uptime: 0 days 1:07 hours +Hyper-V role detected + +CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss +Processor Information for the first 12 processors : + Max Mhz: 2301, Current Mhz: 1990, Mhz Limit: 2301 + +Memory: 4k page, system-wide physical 15681M (5720M free) +TotalPageFile size 23873M (AvailPageFile size 46M) +current process WorkingSet (physical memory assigned to process): 12M, peak: 12M +current process commit charge ("private bytes"): 64M, peak: 310M + +vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-13T22:04:36Z by "MicrosoftCorporation" with unknown MS VC++:1944 + +END. diff --git a/hs_err_pid14756.log b/hs_err_pid14756.log new file mode 100644 index 0000000..cbe807e --- /dev/null +++ b/hs_err_pid14756.log @@ -0,0 +1,803 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (malloc) failed to allocate 1048576 bytes. Error detail: AllocateHeap +# Possible reasons: +# The system is out of physical RAM or swap space +# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Unscaled Compressed Oops mode in which the Java heap is +# placed in the first 4GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 4GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (allocation.cpp:44), pid=14756, tid=19796 +# +# JRE version: OpenJDK Runtime Environment Temurin-21.0.9+10 (21.0.9+10) (build 21.0.9+10-LTS) +# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.9+10 (21.0.9+10-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, parallel gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: --add-modules=ALL-SYSTEM --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -javaagent:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java -Daether.dependencyCollector.impl=bf c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -configuration c:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win -data c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java\jdt_ws --pipe=\\.\pipe\lsp-3417bb743ec522de09de7b6008ec2ba1-sock + +Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +Time: Wed Jan 28 10:00:45 2026 Morocco Daylight Time elapsed time: 3030.961313 seconds (0d 0h 50m 30s) + +--------------- T H R E A D --------------- + +Current thread (0x00000222e5ec4ff0): JavaThread "Attach Listener" daemon [_thread_in_vm, id=19796, stack(0x0000008c44d00000,0x0000008c44e00000) (1024K)] + +Stack: [0x0000008c44d00000,0x0000008c44e00000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6d6e29] +V [jvm.dll+0x8b4b76] +V [jvm.dll+0x8b712e] +V [jvm.dll+0x8b7813] +V [jvm.dll+0x283d86] +V [jvm.dll+0xc1277] +V [jvm.dll+0x6d76d9] +V [jvm.dll+0x133466] +V [jvm.dll+0x3f7ea6] +V [jvm.dll+0x85e9ad] +V [jvm.dll+0x6d565d] +C [ucrtbase.dll+0x37b0] +C [KERNEL32.DLL+0x2e8d7] +C [ntdll.dll+0x8c53c] + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00000222d51299d0, length=42, elements={ +0x00000222e5e24970, 0x00000222fe7cc380, 0x00000222e5ec1c80, 0x00000222e5ec3ff0, +0x00000222e5ec4ff0, 0x00000222e5ec7b50, 0x00000222e5ec85a0, 0x00000222e5ecb7e0, +0x00000222e5edbaf0, 0x00000222ffec9f50, 0x00000222c607aea0, 0x00000222c6517d30, +0x00000222c69a03d0, 0x00000222c6925be0, 0x00000222c6926660, 0x00000222c6935fe0, +0x00000222c6308ed0, 0x00000222c69e9f00, 0x00000222c6f69c30, 0x00000222c6ae6940, +0x00000222c6ae5590, 0x00000222c6ae4f00, 0x00000222c6ae5c20, 0x00000222c9a7b390, +0x00000222c9a7ad00, 0x00000222c9a79fe0, 0x00000222c9a7c0b0, 0x00000222c9a7ba20, +0x00000222c9a792c0, 0x00000222c9a7c740, 0x00000222c9a7cdd0, 0x00000222c9a7a670, +0x00000222c9a79950, 0x00000222c9a7f530, 0x00000222c9a7e180, 0x00000222c9a7e810, +0x00000222c9a808e0, 0x00000222c9a63b90, 0x00000222c6ae34c0, 0x00000222c6ae3b50, +0x00000222c9cbcbd0, 0x00000222c9cbe610 +} + +Java Threads: ( => current thread ) + 0x00000222e5e24970 JavaThread "main" [_thread_blocked, id=16156, stack(0x0000008c44600000,0x0000008c44700000) (1024K)] + 0x00000222fe7cc380 JavaThread "Reference Handler" daemon [_thread_blocked, id=15968, stack(0x0000008c44a00000,0x0000008c44b00000) (1024K)] + 0x00000222e5ec1c80 JavaThread "Finalizer" daemon [_thread_blocked, id=19760, stack(0x0000008c44b00000,0x0000008c44c00000) (1024K)] + 0x00000222e5ec3ff0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=19800, stack(0x0000008c44c00000,0x0000008c44d00000) (1024K)] +=>0x00000222e5ec4ff0 JavaThread "Attach Listener" daemon [_thread_in_vm, id=19796, stack(0x0000008c44d00000,0x0000008c44e00000) (1024K)] + 0x00000222e5ec7b50 JavaThread "Service Thread" daemon [_thread_blocked, id=19792, stack(0x0000008c44e00000,0x0000008c44f00000) (1024K)] + 0x00000222e5ec85a0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=19804, stack(0x0000008c44f00000,0x0000008c45000000) (1024K)] + 0x00000222e5ecb7e0 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=19812, stack(0x0000008c45000000,0x0000008c45100000) (1024K)] + 0x00000222e5edbaf0 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=19816, stack(0x0000008c45100000,0x0000008c45200000) (1024K)] + 0x00000222ffec9f50 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=19920, stack(0x0000008c45300000,0x0000008c45400000) (1024K)] + 0x00000222c607aea0 JavaThread "Notification Thread" daemon [_thread_blocked, id=20072, stack(0x0000008c45400000,0x0000008c45500000) (1024K)] + 0x00000222c6517d30 JavaThread "Active Thread: Equinox Container: 44a83074-a7dc-4b2b-a73e-bd9a031892d8" [_thread_blocked, id=20120, stack(0x0000008c45b00000,0x0000008c45c00000) (1024K)] + 0x00000222c69a03d0 JavaThread "Refresh Thread: Equinox Container: 44a83074-a7dc-4b2b-a73e-bd9a031892d8" daemon [_thread_blocked, id=11144, stack(0x0000008c45c00000,0x0000008c45d00000) (1024K)] + 0x00000222c6925be0 JavaThread "Framework Event Dispatcher: Equinox Container: 44a83074-a7dc-4b2b-a73e-bd9a031892d8" daemon [_thread_blocked, id=3608, stack(0x0000008c45d00000,0x0000008c45e00000) (1024K)] + 0x00000222c6926660 JavaThread "Start Level: Equinox Container: 44a83074-a7dc-4b2b-a73e-bd9a031892d8" daemon [_thread_blocked, id=20452, stack(0x0000008c45e00000,0x0000008c45f00000) (1024K)] + 0x00000222c6935fe0 JavaThread "Bundle File Closer" daemon [_thread_blocked, id=20320, stack(0x0000008c46200000,0x0000008c46300000) (1024K)] + 0x00000222c6308ed0 JavaThread "SCR Component Actor" daemon [_thread_blocked, id=7620, stack(0x0000008c45f00000,0x0000008c46000000) (1024K)] + 0x00000222c69e9f00 JavaThread "Worker-JM" [_thread_blocked, id=11672, stack(0x0000008c46500000,0x0000008c46600000) (1024K)] + 0x00000222c6f69c30 JavaThread "JNA Cleaner" daemon [_thread_blocked, id=14656, stack(0x0000008c46300000,0x0000008c46400000) (1024K)] + 0x00000222c6ae6940 JavaThread "Worker-1" [_thread_blocked, id=14728, stack(0x0000008c46600000,0x0000008c46700000) (1024K)] + 0x00000222c6ae5590 JavaThread "Java indexing" daemon [_thread_blocked, id=10080, stack(0x0000008c46a00000,0x0000008c46b00000) (1024K)] + 0x00000222c6ae4f00 JavaThread "Thread-1" daemon [_thread_in_native, id=16092, stack(0x0000008c47100000,0x0000008c47200000) (1024K)] + 0x00000222c6ae5c20 JavaThread "Thread-2" daemon [_thread_in_native, id=16084, stack(0x0000008c47200000,0x0000008c47300000) (1024K)] + 0x00000222c9a7b390 JavaThread "Thread-3" daemon [_thread_in_native, id=16096, stack(0x0000008c47300000,0x0000008c47400000) (1024K)] + 0x00000222c9a7ad00 JavaThread "Thread-4" daemon [_thread_in_native, id=14492, stack(0x0000008c47400000,0x0000008c47500000) (1024K)] + 0x00000222c9a79fe0 JavaThread "Thread-5" daemon [_thread_in_native, id=20156, stack(0x0000008c47500000,0x0000008c47600000) (1024K)] + 0x00000222c9a7c0b0 JavaThread "Thread-6" daemon [_thread_in_native, id=19384, stack(0x0000008c47600000,0x0000008c47700000) (1024K)] + 0x00000222c9a7ba20 JavaThread "Thread-7" daemon [_thread_in_native, id=2892, stack(0x0000008c47700000,0x0000008c47800000) (1024K)] + 0x00000222c9a792c0 JavaThread "Thread-8" daemon [_thread_in_native, id=9892, stack(0x0000008c47800000,0x0000008c47900000) (1024K)] + 0x00000222c9a7c740 JavaThread "Thread-9" daemon [_thread_in_native, id=15064, stack(0x0000008c47900000,0x0000008c47a00000) (1024K)] + 0x00000222c9a7cdd0 JavaThread "Thread-10" daemon [_thread_in_native, id=14496, stack(0x0000008c47a00000,0x0000008c47b00000) (1024K)] + 0x00000222c9a7a670 JavaThread "Thread-11" daemon [_thread_in_native, id=15156, stack(0x0000008c47b00000,0x0000008c47c00000) (1024K)] + 0x00000222c9a79950 JavaThread "Thread-12" daemon [_thread_in_native, id=15152, stack(0x0000008c47c00000,0x0000008c47d00000) (1024K)] + 0x00000222c9a7f530 JavaThread "Thread-13" daemon [_thread_in_native, id=15076, stack(0x0000008c47d00000,0x0000008c47e00000) (1024K)] + 0x00000222c9a7e180 JavaThread "pool-2-thread-1" [_thread_blocked, id=20140, stack(0x0000008c47e00000,0x0000008c47f00000) (1024K)] + 0x00000222c9a7e810 JavaThread "WorkspaceEventsHandler" [_thread_blocked, id=19888, stack(0x0000008c47f00000,0x0000008c48000000) (1024K)] + 0x00000222c9a808e0 JavaThread "pool-1-thread-1" [_thread_blocked, id=3248, stack(0x0000008c48000000,0x0000008c48100000) (1024K)] + 0x00000222c9a63b90 JavaThread "Cleaner-0" daemon [_thread_blocked, id=12984, stack(0x0000008c4ac00000,0x0000008c4ad00000) (1024K)] + 0x00000222c6ae34c0 JavaThread "Java Debug Server" daemon [_thread_in_native, id=16376, stack(0x0000008c44500000,0x0000008c44600000) (1024K)] + 0x00000222c6ae3b50 JavaThread "RxSchedulerPurge-1" daemon [_thread_blocked, id=1324, stack(0x0000008c46800000,0x0000008c46900000) (1024K)] + 0x00000222c9cbcbd0 JavaThread "RxCachedWorkerPoolEvictor-1" daemon [_thread_blocked, id=16296, stack(0x0000008c46900000,0x0000008c46a00000) (1024K)] + 0x00000222c9cbe610 JavaThread "Worker-8" [_thread_blocked, id=4644, stack(0x0000008c44400000,0x0000008c44500000) (1024K)] +Total: 42 + +Other Threads: + 0x00000222e5bb1360 VMThread "VM Thread" [id=2920, stack(0x0000008c44900000,0x0000008c44a00000) (1024K)] + 0x00000222fe6aca00 WatcherThread "VM Periodic Task Thread" [id=9232, stack(0x0000008c44800000,0x0000008c44900000) (1024K)] + 0x00000222e5bb2920 WorkerThread "GC Thread#0" [id=12240, stack(0x0000008c44700000,0x0000008c44800000) (1024K)] + 0x00000222e5bb1aa0 WorkerThread "GC Thread#1" [id=19900, stack(0x0000008c45500000,0x0000008c45600000) (1024K)] + 0x00000222e5bb1e40 WorkerThread "GC Thread#2" [id=19916, stack(0x0000008c45600000,0x0000008c45700000) (1024K)] + 0x00000222e5bb21e0 WorkerThread "GC Thread#3" [id=20052, stack(0x0000008c45700000,0x0000008c45800000) (1024K)] + 0x00000222c64d8580 WorkerThread "GC Thread#4" [id=20176, stack(0x0000008c45800000,0x0000008c45900000) (1024K)] + 0x00000222c64d8cc0 WorkerThread "GC Thread#5" [id=19884, stack(0x0000008c45900000,0x0000008c45a00000) (1024K)] + 0x00000222c64da620 WorkerThread "GC Thread#6" [id=20228, stack(0x0000008c45a00000,0x0000008c45b00000) (1024K)] + 0x00000222c64d9060 WorkerThread "GC Thread#7" [id=20308, stack(0x0000008c45200000,0x0000008c45300000) (1024K)] + 0x00000222c64d7aa0 WorkerThread "GC Thread#8" [id=4608, stack(0x0000008c46000000,0x0000008c46100000) (1024K)] + 0x00000222c64d7700 WorkerThread "GC Thread#9" [id=5752, stack(0x0000008c46100000,0x0000008c46200000) (1024K)] +Total: 12 + +Threads with active compile tasks: +Total: 0 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: None + +Heap address: 0x0000000080000000, size: 2048 MB, Compressed Oops mode: 32-bit + +CDS archive(s) mapped at: [0x0000022280000000-0x0000022280ba0000-0x0000022280ba0000), size 12189696, SharedBaseAddress: 0x0000022280000000, ArchiveRelocationMode: 1. +Compressed class space mapped at: 0x0000022281000000-0x00000222c1000000, reserved size: 1073741824 +Narrow klass base: 0x0000022280000000, Narrow klass shift: 0, Narrow klass range: 0x100000000 + +GC Precious Log: + CardTable entry size: 512 + CPUs: 12 total, 12 available + Memory: 15681M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (32-bit) + Alignments: Space 512K, Generation 512K, Heap 2M + Heap Min Capacity: 100M + Heap Initial Capacity: 100M + Heap Max Capacity: 2G + Pre-touch: Disabled + Parallel Workers: 10 + +Heap: + PSYoungGen total 6656K, used 2752K [0x00000000d5580000, 0x00000000d5d80000, 0x0000000100000000) + eden space 5632K, 36% used [0x00000000d5580000,0x00000000d5780248,0x00000000d5b00000) + from space 1024K, 68% used [0x00000000d5c80000,0x00000000d5d30000,0x00000000d5d80000) + to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) + ParOldGen total 391680K, used 391660K [0x0000000080000000, 0x0000000097e80000, 0x00000000d5580000) + object space 391680K, 99% used [0x0000000080000000,0x0000000097e7b048,0x0000000097e80000) + Metaspace used 90985K, committed 92864K, reserved 1179648K + class space used 9789K, committed 10688K, reserved 1048576K + +Card table byte_map: [0x00000222f9ae0000,0x00000222f9ef0000] _byte_map_base: 0x00000222f96e0000 + +Marking Bits: (ParMarkBitMap*) 0x00007ffb44052460 + Begin Bits: [0x00000222fa1a0000, 0x00000222fc1a0000) + End Bits: [0x00000222fc1a0000, 0x00000222fe1a0000) + +Polling page: 0x00000222e5b70000 + +Metaspace: + +Usage: + Non-class: 79.29 MB used. + Class: 9.56 MB used. + Both: 88.85 MB used. + +Virtual space: + Non-class space: 128.00 MB reserved, 80.25 MB ( 63%) committed, 2 nodes. + Class space: 1.00 GB reserved, 10.44 MB ( 1%) committed, 1 nodes. + Both: 1.12 GB reserved, 90.69 MB ( 8%) committed. + +Chunk freelists: + Non-Class: 15.69 MB + Class: 5.39 MB + Both: 21.08 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 142.44 MB +CDS: on + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 9. +num_arena_births: 1770. +num_arena_deaths: 22. +num_vsnodes_births: 3. +num_vsnodes_deaths: 0. +num_space_committed: 1450. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 34. +num_chunks_taken_from_freelist: 6356. +num_chunk_merges: 18. +num_chunk_splits: 3842. +num_chunks_enlarged: 2063. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120000Kb used=16506Kb max_used=16506Kb free=103493Kb + bounds [0x00000222f23c0000, 0x00000222f33e0000, 0x00000222f98f0000] +CodeHeap 'profiled nmethods': size=120000Kb used=44178Kb max_used=44178Kb free=75822Kb + bounds [0x00000222ea8f0000, 0x00000222ed420000, 0x00000222f1e20000] +CodeHeap 'non-nmethods': size=5760Kb used=1527Kb max_used=1597Kb free=4232Kb + bounds [0x00000222f1e20000, 0x00000222f2090000, 0x00000222f23c0000] +CodeCache: size=245760Kb, used=62211Kb, max_used=62281Kb, free=183547Kb + total_blobs=18491, nmethods=17631, adapters=763, full_count=0 +Compilation: enabled, stopped_count=0, restarted_count=0 + +Compilation events (20 events): +Event: 2812.929 Thread 0x00000222e5edbaf0 nmethod 19394 0x00000222ed412210 code [0x00000222ed4123c0, 0x00000222ed412508] +Event: 2812.938 Thread 0x00000222e5edbaf0 19395 2 org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope::findImport (394 bytes) +Event: 2812.940 Thread 0x00000222e5edbaf0 nmethod 19395 0x00000222ed412590 code [0x00000222ed412900, 0x00000222ed413960] +Event: 2812.961 Thread 0x00000222e5edbaf0 19397 3 java.util.concurrent.CompletableFuture::thenApply (7 bytes) +Event: 2812.961 Thread 0x00000222e5edbaf0 nmethod 19397 0x00000222ed414110 code [0x00000222ed4142c0, 0x00000222ed414408] +Event: 2812.965 Thread 0x00000222e5ecb7e0 nmethod 19387 0x00000222f33d2990 code [0x00000222f33d2ce0, 0x00000222f33d54b0] +Event: 2812.966 Thread 0x00000222e5ecb7e0 19396 4 sun.nio.fs.WindowsPath::getFileSystem (5 bytes) +Event: 2812.966 Thread 0x00000222e5ecb7e0 nmethod 19396 0x00000222f33d6790 code [0x00000222f33d6920, 0x00000222f33d69b0] +Event: 2812.966 Thread 0x00000222e5ecb7e0 19385 4 org.eclipse.jdt.internal.core.JavaProject::getElementName (10 bytes) +Event: 2812.968 Thread 0x00000222e5ecb7e0 nmethod 19385 0x00000222f33d6a90 code [0x00000222f33d6c40, 0x00000222f33d6d90] +Event: 2812.968 Thread 0x00000222e5ecb7e0 19398 ! 4 jdk.internal.reflect.MethodHandleAccessorFactory::newFieldAccessor (240 bytes) +Event: 2813.091 Thread 0x00000222e5ecb7e0 nmethod 19398 0x00000222f33d6f10 code [0x00000222f33d76c0, 0x00000222f33db058] +Event: 2813.091 Thread 0x00000222e5ecb7e0 19399 4 jdk.internal.reflect.ReflectionFactory::newFieldAccessor (93 bytes) +Event: 2813.094 Thread 0x00000222e5ecb7e0 nmethod 19399 0x00000222f33ddd90 code [0x00000222f33ddf40, 0x00000222f33de0d8] +Event: 2813.100 Thread 0x00000222e5edbaf0 19400 1 org.eclipse.lsp4j.ClientCapabilities::getWindow (5 bytes) +Event: 2813.101 Thread 0x00000222e5edbaf0 nmethod 19400 0x00000222f33de290 code [0x00000222f33de420, 0x00000222f33de4e8] +Event: 2813.103 Thread 0x00000222e5edbaf0 19401 3 org.eclipse.core.internal.resources.WorkManager::rebalanceNestedOperations (9 bytes) +Event: 2813.103 Thread 0x00000222e5edbaf0 nmethod 19401 0x00000222ed414490 code [0x00000222ed414620, 0x00000222ed414730] +Event: 2996.348 Thread 0x00000222e5ecb7e0 19402 ! 4 java.util.concurrent.locks.AbstractQueuedSynchronizer::tryInitializeHead (66 bytes) +Event: 2996.352 Thread 0x00000222e5ecb7e0 nmethod 19402 0x00000222f33de590 code [0x00000222f33de720, 0x00000222f33de910] + +GC Heap History (20 events): +Event: 2812.653 GC heap before +{Heap before GC invocations=713 (full 4): + PSYoungGen total 6656K, used 6260K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) + eden space 5632K, 99% used [0x00000000d5580000,0x00000000d5afffa8,0x00000000d5b00000) + from space 1024K, 61% used [0x00000000d5c00000,0x00000000d5c9d200,0x00000000d5d00000) + to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) + ParOldGen total 388608K, used 388305K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) + object space 388608K, 99% used [0x0000000080000000,0x0000000097b347e0,0x0000000097b80000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.655 GC heap after +{Heap after GC invocations=713 (full 4): + PSYoungGen total 6656K, used 404K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 1024K, 39% used [0x00000000d5b00000,0x00000000d5b65200,0x00000000d5c00000) + to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) + ParOldGen total 388608K, used 388409K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) + object space 388608K, 99% used [0x0000000080000000,0x0000000097b4e7e0,0x0000000097b80000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.676 GC heap before +{Heap before GC invocations=714 (full 4): + PSYoungGen total 6656K, used 6036K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 1024K, 39% used [0x00000000d5b00000,0x00000000d5b65200,0x00000000d5c00000) + to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) + ParOldGen total 388608K, used 388409K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) + object space 388608K, 99% used [0x0000000080000000,0x0000000097b4e7e0,0x0000000097b80000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.678 GC heap after +{Heap after GC invocations=714 (full 4): + PSYoungGen total 6144K, used 390K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 512K, 76% used [0x00000000d5c00000,0x00000000d5c61828,0x00000000d5c80000) + to space 512K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000d5c00000) + ParOldGen total 388608K, used 388505K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) + object space 388608K, 99% used [0x0000000080000000,0x0000000097b667e0,0x0000000097b80000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.692 GC heap before +{Heap before GC invocations=715 (full 4): + PSYoungGen total 6144K, used 6022K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 512K, 76% used [0x00000000d5c00000,0x00000000d5c61828,0x00000000d5c80000) + to space 512K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000d5c00000) + ParOldGen total 388608K, used 388505K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) + object space 388608K, 99% used [0x0000000080000000,0x0000000097b667e0,0x0000000097b80000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.693 GC heap after +{Heap after GC invocations=715 (full 4): + PSYoungGen total 6144K, used 378K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 512K, 73% used [0x00000000d5b80000,0x00000000d5bde900,0x00000000d5c00000) + to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) + ParOldGen total 389120K, used 388693K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) + object space 389120K, 99% used [0x0000000080000000,0x0000000097b95430,0x0000000097c00000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.703 GC heap before +{Heap before GC invocations=716 (full 4): + PSYoungGen total 6144K, used 6010K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 512K, 73% used [0x00000000d5b80000,0x00000000d5bde900,0x00000000d5c00000) + to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) + ParOldGen total 389120K, used 388693K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) + object space 389120K, 99% used [0x0000000080000000,0x0000000097b95430,0x0000000097c00000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.705 GC heap after +{Heap after GC invocations=716 (full 4): + PSYoungGen total 6144K, used 448K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 512K, 87% used [0x00000000d5c00000,0x00000000d5c70000,0x00000000d5c80000) + to space 512K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000d5c00000) + ParOldGen total 389120K, used 388757K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) + object space 389120K, 99% used [0x0000000080000000,0x0000000097ba5570,0x0000000097c00000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.887 GC heap before +{Heap before GC invocations=717 (full 4): + PSYoungGen total 6144K, used 6080K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 512K, 87% used [0x00000000d5c00000,0x00000000d5c70000,0x00000000d5c80000) + to space 512K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000d5c00000) + ParOldGen total 389120K, used 388757K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) + object space 389120K, 99% used [0x0000000080000000,0x0000000097ba5570,0x0000000097c00000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.888 GC heap after +{Heap after GC invocations=717 (full 4): + PSYoungGen total 6144K, used 512K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 512K, 100% used [0x00000000d5b80000,0x00000000d5c00000,0x00000000d5c00000) + to space 1024K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5d00000) + ParOldGen total 389120K, used 388957K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) + object space 389120K, 99% used [0x0000000080000000,0x0000000097bd7570,0x0000000097c00000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.903 GC heap before +{Heap before GC invocations=718 (full 4): + PSYoungGen total 6144K, used 6144K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 512K, 100% used [0x00000000d5b80000,0x00000000d5c00000,0x00000000d5c00000) + to space 1024K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5d00000) + ParOldGen total 389120K, used 388957K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) + object space 389120K, 99% used [0x0000000080000000,0x0000000097bd7570,0x0000000097c00000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.905 GC heap after +{Heap after GC invocations=718 (full 4): + PSYoungGen total 6656K, used 692K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 1024K, 67% used [0x00000000d5c00000,0x00000000d5cad200,0x00000000d5d00000) + to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) + ParOldGen total 389632K, used 389493K [0x0000000080000000, 0x0000000097c80000, 0x00000000d5580000) + object space 389632K, 99% used [0x0000000080000000,0x0000000097c5d570,0x0000000097c80000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.911 GC heap before +{Heap before GC invocations=719 (full 4): + PSYoungGen total 6656K, used 6324K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 1024K, 67% used [0x00000000d5c00000,0x00000000d5cad200,0x00000000d5d00000) + to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) + ParOldGen total 389632K, used 389493K [0x0000000080000000, 0x0000000097c80000, 0x00000000d5580000) + object space 389632K, 99% used [0x0000000080000000,0x0000000097c5d570,0x0000000097c80000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.912 GC heap after +{Heap after GC invocations=719 (full 4): + PSYoungGen total 6656K, used 160K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 1024K, 15% used [0x00000000d5b00000,0x00000000d5b28000,0x00000000d5c00000) + to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) + ParOldGen total 390144K, used 389869K [0x0000000080000000, 0x0000000097d00000, 0x00000000d5580000) + object space 390144K, 99% used [0x0000000080000000,0x0000000097cbb570,0x0000000097d00000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.920 GC heap before +{Heap before GC invocations=720 (full 4): + PSYoungGen total 6656K, used 5792K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 1024K, 15% used [0x00000000d5b00000,0x00000000d5b28000,0x00000000d5c00000) + to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) + ParOldGen total 390144K, used 389869K [0x0000000080000000, 0x0000000097d00000, 0x00000000d5580000) + object space 390144K, 99% used [0x0000000080000000,0x0000000097cbb570,0x0000000097d00000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.922 GC heap after +{Heap after GC invocations=720 (full 4): + PSYoungGen total 6144K, used 500K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 512K, 97% used [0x00000000d5c00000,0x00000000d5c7d200,0x00000000d5c80000) + to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) + ParOldGen total 390656K, used 390218K [0x0000000080000000, 0x0000000097d80000, 0x00000000d5580000) + object space 390656K, 99% used [0x0000000080000000,0x0000000097d12848,0x0000000097d80000) + Metaspace used 90973K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.932 GC heap before +{Heap before GC invocations=721 (full 4): + PSYoungGen total 6144K, used 6132K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 512K, 97% used [0x00000000d5c00000,0x00000000d5c7d200,0x00000000d5c80000) + to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) + ParOldGen total 390656K, used 390218K [0x0000000080000000, 0x0000000097d80000, 0x00000000d5580000) + object space 390656K, 99% used [0x0000000080000000,0x0000000097d12848,0x0000000097d80000) + Metaspace used 90975K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.934 GC heap after +{Heap after GC invocations=721 (full 4): + PSYoungGen total 6656K, used 1012K [0x00000000d5580000, 0x00000000d5e00000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 1024K, 98% used [0x00000000d5b00000,0x00000000d5bfd200,0x00000000d5c00000) + to space 1536K, 0% used [0x00000000d5c80000,0x00000000d5c80000,0x00000000d5e00000) + ParOldGen total 391168K, used 390747K [0x0000000080000000, 0x0000000097e00000, 0x00000000d5580000) + object space 391168K, 99% used [0x0000000080000000,0x0000000097d96c48,0x0000000097e00000) + Metaspace used 90975K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.942 GC heap before +{Heap before GC invocations=722 (full 4): + PSYoungGen total 6656K, used 6644K [0x00000000d5580000, 0x00000000d5e00000, 0x0000000100000000) + eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) + from space 1024K, 98% used [0x00000000d5b00000,0x00000000d5bfd200,0x00000000d5c00000) + to space 1536K, 0% used [0x00000000d5c80000,0x00000000d5c80000,0x00000000d5e00000) + ParOldGen total 391168K, used 390747K [0x0000000080000000, 0x0000000097e00000, 0x00000000d5580000) + object space 391168K, 99% used [0x0000000080000000,0x0000000097d96c48,0x0000000097e00000) + Metaspace used 90975K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} +Event: 2812.944 GC heap after +{Heap after GC invocations=722 (full 4): + PSYoungGen total 6656K, used 704K [0x00000000d5580000, 0x00000000d5d80000, 0x0000000100000000) + eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) + from space 1024K, 68% used [0x00000000d5c80000,0x00000000d5d30000,0x00000000d5d80000) + to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) + ParOldGen total 391680K, used 391660K [0x0000000080000000, 0x0000000097e80000, 0x00000000d5580000) + object space 391680K, 99% used [0x0000000080000000,0x0000000097e7b048,0x0000000097e80000) + Metaspace used 90975K, committed 92864K, reserved 1179648K + class space used 9788K, committed 10688K, reserved 1048576K +} + +Dll operation events (11 events): +Event: 0.040 Loaded shared library c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.dll +Event: 0.264 Loaded shared library c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\zip.dll +Event: 0.314 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\instrument.dll +Event: 0.325 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\net.dll +Event: 0.331 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\nio.dll +Event: 0.340 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\zip.dll +Event: 0.382 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jimage.dll +Event: 0.622 Loaded shared library c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\verify.dll +Event: 21.186 Loaded shared library C:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win\org.eclipse.equinox.launcher\org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.1400.v20250801-0854\eclipse_11916.dll +Event: 46.251 Loaded shared library C:\Users\Mustapha\AppData\Local\Temp\jna-918639377\jna14061272421266381748.dll +Event: 488.147 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\extnet.dll + +Deoptimization events (20 events): +Event: 2812.897 Thread 0x00000222c9cbbeb0 DEOPT PACKING pc=0x00000222f33b24b0 sp=0x0000008c443fe1d0 +Event: 2812.897 Thread 0x00000222c9cbbeb0 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c443fe1b8 mode 2 +Event: 2812.897 Thread 0x00000222c9cbab00 DEOPT PACKING pc=0x00000222f33b24b0 sp=0x0000008c46bfe310 +Event: 2812.897 Thread 0x00000222c9cbab00 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c46bfe2f8 mode 2 +Event: 2812.902 Thread 0x00000222c9cbab00 Uncommon trap: trap_request=0xffffffc6 fr.pc=0x00000222f336439c relative=0x0000000000002c3c +Event: 2812.902 Thread 0x00000222c9cbab00 Uncommon trap: reason=bimorphic_or_optimized_type_check action=maybe_recompile pc=0x00000222f336439c method=org.eclipse.jdt.internal.core.BinaryMethod.isConstructor()Z @ 28 c2 +Event: 2812.902 Thread 0x00000222c9cbab00 DEOPT PACKING pc=0x00000222f336439c sp=0x0000008c46bfe380 +Event: 2812.903 Thread 0x00000222c9cbab00 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c46bfe298 mode 2 +Event: 2812.909 Thread 0x00000222c9cbab00 Uncommon trap: trap_request=0xffffffc6 fr.pc=0x00000222f33b24b0 relative=0x0000000000001e90 +Event: 2812.909 Thread 0x00000222c9cbbeb0 Uncommon trap: trap_request=0xffffffc6 fr.pc=0x00000222f33b24b0 relative=0x0000000000001e90 +Event: 2812.909 Thread 0x00000222c9cbab00 Uncommon trap: reason=bimorphic_or_optimized_type_check action=maybe_recompile pc=0x00000222f33b24b0 method=org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport([[CI)Lorg/eclipse/jdt/internal/compiler/lookup/Binding; @ 297 c2 +Event: 2812.909 Thread 0x00000222c9cbbeb0 Uncommon trap: reason=bimorphic_or_optimized_type_check action=maybe_recompile pc=0x00000222f33b24b0 method=org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport([[CI)Lorg/eclipse/jdt/internal/compiler/lookup/Binding; @ 297 c2 +Event: 2812.909 Thread 0x00000222c9cbab00 DEOPT PACKING pc=0x00000222f33b24b0 sp=0x0000008c46bfe270 +Event: 2812.909 Thread 0x00000222c9cbbeb0 DEOPT PACKING pc=0x00000222f33b24b0 sp=0x0000008c443fe130 +Event: 2812.909 Thread 0x00000222c9cbbeb0 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c443fe118 mode 2 +Event: 2812.909 Thread 0x00000222c9cbab00 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c46bfe258 mode 2 +Event: 2812.965 Thread 0x00000222c9cbbeb0 Uncommon trap: trap_request=0xffffffde fr.pc=0x00000222f25778cc relative=0x00000000000000ac +Event: 2812.965 Thread 0x00000222c9cbbeb0 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000222f25778cc method=jdk.internal.util.StrongReferenceKey.equals(Ljava/lang/Object;)Z @ 1 c2 +Event: 2812.965 Thread 0x00000222c9cbbeb0 DEOPT PACKING pc=0x00000222f25778cc sp=0x0000008c443fd370 +Event: 2812.965 Thread 0x00000222c9cbbeb0 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c443fd2f8 mode 2 + +Classes loaded (20 events): +Event: 567.036 Loading class java/util/stream/ReferencePipeline$15 +Event: 567.036 Loading class java/util/stream/ReferencePipeline$15 done +Event: 567.037 Loading class java/util/stream/ReferencePipeline$15$1 +Event: 567.037 Loading class java/util/stream/ReferencePipeline$15$1 done +Event: 571.969 Loading class java/util/function/IntBinaryOperator +Event: 571.970 Loading class java/util/function/IntBinaryOperator done +Event: 571.970 Loading class java/util/stream/ReduceOps$6 +Event: 571.970 Loading class java/util/stream/ReduceOps$6 done +Event: 571.970 Loading class java/util/stream/ReduceOps$5ReducingSink +Event: 571.971 Loading class java/util/stream/ReduceOps$5ReducingSink done +Event: 581.850 Loading class java/util/concurrent/CompletableFuture$AsyncSupply +Event: 581.850 Loading class java/util/concurrent/CompletableFuture$AsyncSupply done +Event: 2204.255 Loading class java/lang/StringLatin1$CharsSpliterator +Event: 2204.255 Loading class java/lang/StringLatin1$CharsSpliterator done +Event: 2205.415 Loading class java/util/function/IntPredicate +Event: 2205.415 Loading class java/util/function/IntPredicate done +Event: 2205.469 Loading class java/util/regex/Pattern$Bound +Event: 2205.469 Loading class java/util/regex/Pattern$Bound done +Event: 2812.503 Loading class java/net/HttpURLConnection +Event: 2812.504 Loading class java/net/HttpURLConnection done + +Classes unloaded (11 events): +Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811ab400 'java/lang/invoke/LambdaForm$MH+0x00000222811ab400' +Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811ab000 'java/lang/invoke/LambdaForm$MH+0x00000222811ab000' +Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811aac00 'java/lang/invoke/LambdaForm$MH+0x00000222811aac00' +Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811aa800 'java/lang/invoke/LambdaForm$MH+0x00000222811aa800' +Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811aa400 'java/lang/invoke/LambdaForm$BMH+0x00000222811aa400' +Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811aa000 'java/lang/invoke/LambdaForm$DMH+0x00000222811aa000' +Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811a8c00 'java/lang/invoke/LambdaForm$DMH+0x00000222811a8c00' +Event: 549.607 Thread 0x00000222e5bb1360 Unloading class 0x0000022281779000 'java/lang/invoke/LambdaForm$DMH+0x0000022281779000' +Event: 549.607 Thread 0x00000222e5bb1360 Unloading class 0x0000022281778c00 'java/lang/invoke/LambdaForm$DMH+0x0000022281778c00' +Event: 549.607 Thread 0x00000222e5bb1360 Unloading class 0x0000022281778800 'java/lang/invoke/LambdaForm$DMH+0x0000022281778800' +Event: 549.607 Thread 0x00000222e5bb1360 Unloading class 0x0000022281778400 'java/lang/invoke/LambdaForm$DMH+0x0000022281778400' + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 2812.417 Thread 0x00000222c9cbbeb0 Exception (0x00000000d58a7080) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.417 Thread 0x00000222c9cbbeb0 Exception (0x00000000d58a7980) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.444 Thread 0x00000222c9cbbeb0 Exception (0x00000000d56c9830) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.444 Thread 0x00000222c9cbbeb0 Exception (0x00000000d56ca130) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.456 Thread 0x00000222c9cbbeb0 Exception (0x00000000d59a2220) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.456 Thread 0x00000222c9cbbeb0 Exception (0x00000000d59a2b20) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.501 Thread 0x00000222c9cbbeb0 Implicit null exception at 0x00000222f33197d3 to 0x00000222f331b144 +Event: 2812.539 Thread 0x00000222c9cbbeb0 Exception (0x00000000d5682c30) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.539 Thread 0x00000222c9cbbeb0 Exception (0x00000000d5683530) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.621 Thread 0x00000222c9cbb190 Implicit null exception at 0x00000222f3171444 to 0x00000222f317437c +Event: 2812.622 Thread 0x00000222c9cbb190 Exception (0x00000000d56db3a8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.622 Thread 0x00000222c9cbb190 Exception (0x00000000d56dbca8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.636 Thread 0x00000222c9cbb190 Exception (0x00000000d58fb690) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.637 Thread 0x00000222c9cbb190 Exception (0x00000000d58fbf90) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.710 Thread 0x00000222c9cbb190 Exception (0x00000000d56c45a0) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.710 Thread 0x00000222c9cbb190 Exception (0x00000000d56c4ea0) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.945 Thread 0x00000222c9cbab00 Exception (0x00000000d562c7c8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.945 Thread 0x00000222c9cbbeb0 Exception (0x00000000d5622140) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.945 Thread 0x00000222c9cbab00 Exception (0x00000000d562d0c8) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] +Event: 2812.945 Thread 0x00000222c9cbbeb0 Exception (0x00000000d5622a40) +thrown [s\src\hotspot\share\prims\jni.cpp, line 520] + +ZGC Phase Switch (0 events): +No events + +VM Operations (20 events): +Event: 2812.942 Executing VM operation: ParallelGCFailedAllocation (Allocation Failure) +Event: 2812.944 Executing VM operation: ParallelGCFailedAllocation (Allocation Failure) done +Event: 2813.952 Executing VM operation: Cleanup +Event: 2813.952 Executing VM operation: Cleanup done +Event: 2826.119 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) +Event: 2826.119 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done +Event: 2826.119 Executing VM operation: RendezvousGCThreads +Event: 2826.119 Executing VM operation: RendezvousGCThreads done +Event: 2886.245 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) +Event: 2886.245 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done +Event: 2886.245 Executing VM operation: RendezvousGCThreads +Event: 2886.245 Executing VM operation: RendezvousGCThreads done +Event: 2946.367 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) +Event: 2946.367 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done +Event: 2946.367 Executing VM operation: RendezvousGCThreads +Event: 2946.367 Executing VM operation: RendezvousGCThreads done +Event: 3006.465 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) +Event: 3006.465 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done +Event: 3006.465 Executing VM operation: RendezvousGCThreads +Event: 3006.465 Executing VM operation: RendezvousGCThreads done + +Memory protections (0 events): +No events + +Nmethod flushes (20 events): +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb79b910 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb79cb10 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7a0990 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7b2690 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7b5010 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7be710 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7dbf10 +Event: 549.750 Thread 0x00000222e5bb1360 flushing osr nmethod 0x00000222eb7dc390 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb80ae90 +Event: 549.750 Thread 0x00000222e5bb1360 flushing osr nmethod 0x00000222eb80b490 +Event: 549.750 Thread 0x00000222e5bb1360 flushing osr nmethod 0x00000222eb813610 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb83ae10 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb84cf10 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb854d10 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb85c110 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb861d10 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb87c690 +Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb89ad10 +Event: 549.751 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb92cb10 +Event: 549.751 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb92d390 + +Events (20 events): +Event: 2386.274 Thread 0x00000222c9cbab00 Thread exited: 0x00000222c9cbab00 +Event: 2446.276 Thread 0x00000222c9cbdf80 Thread exited: 0x00000222c9cbdf80 +Event: 2506.276 Thread 0x00000222c9cbd260 Thread exited: 0x00000222c9cbd260 +Event: 2566.285 Thread 0x00000222c9cba470 Thread exited: 0x00000222c9cba470 +Event: 2796.136 Thread 0x00000222c9a808e0 Thread added: 0x00000222c9cbbeb0 +Event: 2799.852 Thread 0x00000222c9cbe610 Thread added: 0x00000222c9cb9750 +Event: 2801.116 Thread 0x00000222e5edbaf0 Thread added: 0x00000222d559f660 +Event: 2801.626 Thread 0x00000222e5edbaf0 Thread added: 0x00000222d55a33b0 +Event: 2807.678 Thread 0x00000222d55a33b0 Thread exited: 0x00000222d55a33b0 +Event: 2807.695 Thread 0x00000222d559f660 Thread exited: 0x00000222d559f660 +Event: 2809.131 Thread 0x00000222e5edbaf0 Thread added: 0x00000222c89c41c0 +Event: 2812.080 Thread 0x00000222c9a808e0 Thread added: 0x00000222c9cbab00 +Event: 2812.502 Thread 0x00000222c9cbbeb0 Thread added: 0x00000222c9cbb190 +Event: 2812.509 Thread 0x00000222c9cbb190 Thread exited: 0x00000222c9cbb190 +Event: 2812.559 Thread 0x00000222c9a808e0 Thread added: 0x00000222c9cbb190 +Event: 2812.877 Thread 0x00000222c89c41c0 Thread exited: 0x00000222c89c41c0 +Event: 2859.857 Thread 0x00000222c9cb9750 Thread exited: 0x00000222c9cb9750 +Event: 2872.992 Thread 0x00000222c9cbab00 Thread exited: 0x00000222c9cbab00 +Event: 2932.999 Thread 0x00000222c9cbbeb0 Thread exited: 0x00000222c9cbbeb0 +Event: 2993.005 Thread 0x00000222c9cbb190 Thread exited: 0x00000222c9cbb190 + + +Dynamic libraries: +0x00007ff639630000 - 0x00007ff63963e000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.exe +0x00007ffbe2be0000 - 0x00007ffbe2e47000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ffbe17e0000 - 0x00007ffbe18a9000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ffbe0170000 - 0x00007ffbe055f000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ffbe05a0000 - 0x00007ffbe06eb000 C:\WINDOWS\System32\ucrtbase.dll +0x00007ffb49350000 - 0x00007ffb49368000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jli.dll +0x00007ffbe14d0000 - 0x00007ffbe1695000 C:\WINDOWS\System32\USER32.dll +0x00007ffbe0570000 - 0x00007ffbe0597000 C:\WINDOWS\System32\win32u.dll +0x00007ffbe1370000 - 0x00007ffbe139b000 C:\WINDOWS\System32\GDI32.dll +0x00007ffb49370000 - 0x00007ffb4938e000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\VCRUNTIME140.dll +0x00007ffbe06f0000 - 0x00007ffbe081c000 C:\WINDOWS\System32\gdi32full.dll +0x00007ffbe0820000 - 0x00007ffbe08c3000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ffbbd980000 - 0x00007ffbbdc13000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll +0x00007ffbe1420000 - 0x00007ffbe14c9000 C:\WINDOWS\System32\msvcrt.dll +0x00007ffbe16a0000 - 0x00007ffbe16d1000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffbd5760000 - 0x00007ffbd576c000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\vcruntime140_1.dll +0x00007ffb817a0000 - 0x00007ffb8182d000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\msvcp140.dll +0x00007ffb43390000 - 0x00007ffb44130000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\server\jvm.dll +0x00007ffbe19f0000 - 0x00007ffbe1aa4000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ffbe1940000 - 0x00007ffbe19e6000 C:\WINDOWS\System32\sechost.dll +0x00007ffbe1150000 - 0x00007ffbe1268000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffbe13a0000 - 0x00007ffbe1414000 C:\WINDOWS\System32\WS2_32.dll +0x00007ffbdfb90000 - 0x00007ffbdfbee000 C:\WINDOWS\SYSTEM32\POWRPROF.dll +0x00007ffbd8980000 - 0x00007ffbd898b000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007ffbd8940000 - 0x00007ffbd8975000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ffbdfb70000 - 0x00007ffbdfb84000 C:\WINDOWS\SYSTEM32\UMPDC.dll +0x00007ffbdeaa0000 - 0x00007ffbdeabb000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffbd5750000 - 0x00007ffbd575a000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jimage.dll +0x00007ffbd1710000 - 0x00007ffbd1952000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ffbe2690000 - 0x00007ffbe2a16000 C:\WINDOWS\System32\combase.dll +0x00007ffbe0fc0000 - 0x00007ffbe1096000 C:\WINDOWS\System32\OLEAUT32.dll +0x00007ffbc4b30000 - 0x00007ffbc4b6c000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ffbe08d0000 - 0x00007ffbe0975000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007ffbd5620000 - 0x00007ffbd562f000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\instrument.dll +0x00007ffbaefb0000 - 0x00007ffbaefd0000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.dll +0x00007ffbe1f30000 - 0x00007ffbe2683000 C:\WINDOWS\System32\SHELL32.dll +0x00007ffbdfd30000 - 0x00007ffbdfe9a000 C:\WINDOWS\System32\wintypes.dll +0x00007ffbdd8f0000 - 0x00007ffbde14e000 C:\WINDOWS\SYSTEM32\windows.storage.dll +0x00007ffbe1ab0000 - 0x00007ffbe1ba5000 C:\WINDOWS\System32\SHCORE.dll +0x00007ffbe1300000 - 0x00007ffbe1366000 C:\WINDOWS\System32\shlwapi.dll +0x00007ffbdfc50000 - 0x00007ffbdfc79000 C:\WINDOWS\SYSTEM32\profapi.dll +0x00007ffbaef90000 - 0x00007ffbaefa8000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\zip.dll +0x00007ffbd3760000 - 0x00007ffbd3770000 C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\net.dll +0x00007ffbd5a80000 - 0x00007ffbd5ba8000 C:\WINDOWS\SYSTEM32\WINHTTP.dll +0x00007ffbdeff0000 - 0x00007ffbdf05b000 C:\WINDOWS\system32\mswsock.dll +0x00007ffb49120000 - 0x00007ffb49136000 C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\nio.dll +0x00007ffbc4510000 - 0x00007ffbc4520000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\verify.dll +0x00007ffba66c0000 - 0x00007ffba6704000 C:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win\org.eclipse.equinox.launcher\org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.1400.v20250801-0854\eclipse_11916.dll +0x00007ffbe1d90000 - 0x00007ffbe1f27000 C:\WINDOWS\System32\ole32.dll +0x00007ffbdf3e0000 - 0x00007ffbdf3fb000 C:\WINDOWS\SYSTEM32\CRYPTSP.dll +0x00007ffbdea00000 - 0x00007ffbdea3a000 C:\WINDOWS\system32\rsaenh.dll +0x00007ffbdf0a0000 - 0x00007ffbdf0cb000 C:\WINDOWS\SYSTEM32\USERENV.dll +0x00007ffbdfc20000 - 0x00007ffbdfc4a000 C:\WINDOWS\SYSTEM32\bcrypt.dll +0x00007ffbdf240000 - 0x00007ffbdf24c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll +0x00007ffbde490000 - 0x00007ffbde4c4000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL +0x00007ffbe0a50000 - 0x00007ffbe0a5a000 C:\WINDOWS\System32\NSI.dll +0x00007ffbd3770000 - 0x00007ffbd37b9000 C:\Users\Mustapha\AppData\Local\Temp\jna-918639377\jna14061272421266381748.dll +0x00007ffbe2b90000 - 0x00007ffbe2b98000 C:\WINDOWS\System32\PSAPI.DLL +0x00007ffbd5d40000 - 0x00007ffbd5d5e000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL +0x00007ffbd5d10000 - 0x00007ffbd5d33000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL +0x00007ffbae200000 - 0x00007ffbae209000 C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\extnet.dll + +JVMTI agents: +c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar path:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\instrument.dll, loaded, initialized, instrumentlib options:none + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\server;C:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win\org.eclipse.equinox.launcher\org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.1400.v20250801-0854;C:\Users\Mustapha\AppData\Local\Temp\jna-918639377 + +VM Arguments: +jvm_args: --add-modules=ALL-SYSTEM --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -javaagent:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java -Daether.dependencyCollector.impl=bf +java_command: c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -configuration c:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win -data c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java\jdt_ws --pipe=\\.\pipe\lsp-3417bb743ec522de09de7b6008ec2ba1-sock +java_class_path (initial): c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar +Launcher Type: SUN_STANDARD + +[Global flags] + uintx AdaptiveSizePolicyWeight = 90 {product} {command line} + intx CICompilerCount = 4 {product} {ergonomic} + uintx GCTimeRatio = 4 {product} {command line} + bool HeapDumpOnOutOfMemoryError = true {manageable} {command line} + ccstr HeapDumpPath = c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java {manageable} {command line} + size_t InitialHeapSize = 104857600 {product} {command line} + size_t MaxHeapSize = 2147483648 {product} {command line} + size_t MaxNewSize = 715653120 {product} {ergonomic} + size_t MinHeapDeltaBytes = 524288 {product} {ergonomic} + size_t MinHeapSize = 104857600 {product} {command line} + size_t NewSize = 34603008 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839372 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + size_t OldSize = 70254592 {product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 2147483648 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + bool UseParallelGC = true {product} {command line} + +Logging: +Log output configuration: + #0: stdout all=off uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Release file: +JAVA_VERSION="21.0.9" +MODULES="java.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.jvmstat jdk.attach jdk.charsets jdk.internal.opt jdk.zipfs jdk.compiler jdk.crypto.ec jdk.crypto.cryptoki jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.hotspot.agent jdk.httpserver jdk.internal.le jdk.internal.vm.ci jdk.internal.vm.compiler jdk.internal.vm.compiler.management jdk.jartool jdk.javadoc jdk.jcmd jdk.management jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.nio.mapmode jdk.random jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported jdk.unsupported.desktop jdk.xml.dom" + +Environment Variables: +JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 +PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm +USERNAME=Mustapha +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD +TMP=C:\Users\Mustapha\AppData\Local\Temp +TEMP=C:\Users\Mustapha\AppData\Local\Temp + + + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +OS uptime: 0 days 0:53 hours +Hyper-V role detected + +CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss +Processor Information for the first 12 processors : + Max Mhz: 2301, Current Mhz: 1990, Mhz Limit: 2301 + +Memory: 4k page, system-wide physical 15681M (4912M free) +TotalPageFile size 23873M (AvailPageFile size 3M) +current process WorkingSet (physical memory assigned to process): 403M, peak: 585M +current process commit charge ("private bytes"): 775M, peak: 777M + +vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-21T00:00:00Z by "admin" with unknown MS VC++:1942 + +END. diff --git a/hs_err_pid16588.log b/hs_err_pid16588.log new file mode 100644 index 0000000..3d52d05 --- /dev/null +++ b/hs_err_pid16588.log @@ -0,0 +1,814 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (mmap) failed to map 236978176 bytes. Error detail: G1 virtual space +# Possible reasons: +# The system is out of physical RAM or swap space +# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Zero Based Compressed Oops mode in which the Java heap is +# placed in the first 32GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 32GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (os_windows.cpp:3716), pid=16588, tid=14856 +# +# JRE version: OpenJDK Runtime Environment Microsoft-12574459 (21.0.9+10) (build 21.0.9+10-LTS) +# Java VM: OpenJDK 64-Bit Server VM Microsoft-12574459 (21.0.9+10-LTS, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: -XX:TieredStopAtLevel=1 fr.codecake.airbnbclone.NbatCloneBackApplication + +Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +Time: Wed Jan 28 22:40:57 2026 Morocco Daylight Time elapsed time: 18089.733494 seconds (0d 5h 1m 29s) + +--------------- T H R E A D --------------- + +Current thread (0x0000023f746dfda0): VMThread "VM Thread" [id=14856, stack(0x000000b5d2200000,0x000000b5d2300000) (1024K)] + +Stack: [0x000000b5d2200000,0x000000b5d2300000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6df259] (no source info available) +V [jvm.dll+0x8bfe4b] (no source info available) +V [jvm.dll+0x8c23da] (no source info available) +V [jvm.dll+0x8c2ab3] (no source info available) +V [jvm.dll+0x28a416] (no source info available) +V [jvm.dll+0x6de705] (no source info available) +V [jvm.dll+0x6d264a] (no source info available) +V [jvm.dll+0x36742e] (no source info available) +V [jvm.dll+0x36f2fb] (no source info available) +V [jvm.dll+0x3c0c99] (no source info available) +V [jvm.dll+0x3c0f3b] (no source info available) +V [jvm.dll+0x33ace7] (no source info available) +V [jvm.dll+0x33ad77] (no source info available) +V [jvm.dll+0x37fb6c] (no source info available) +V [jvm.dll+0x37e34e] (no source info available) +V [jvm.dll+0x33a441] (no source info available) +V [jvm.dll+0x37d9ba] (no source info available) +V [jvm.dll+0x8c881f] (no source info available) +V [jvm.dll+0x8c9d2c] (no source info available) +V [jvm.dll+0x8ca2a4] (no source info available) +V [jvm.dll+0x8ca3a3] (no source info available) +V [jvm.dll+0x869f7d] (no source info available) +V [jvm.dll+0x6e080d] (no source info available) +C [ucrtbase.dll+0x37b0] (no source info available) +C [KERNEL32.DLL+0x2e8d7] (no source info available) +C [ntdll.dll+0x8c53c] (no source info available) + +VM_Operation (0x000000b5d2afb190): G1CollectForAllocation, mode: safepoint, requested by thread 0x0000023f7c8c31c0 + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000023f7c69afd0, length=32, elements={ +0x0000023f746fdf80, 0x0000023f746ff150, 0x0000023f74706800, 0x0000023f7470a230, +0x0000023f7470ff80, 0x0000023f747105e0, 0x0000023f74724560, 0x0000023f74886d20, +0x0000023f74895580, 0x0000023f7b045b50, 0x0000023f7c6a0220, 0x0000023f7c908420, +0x0000023f7c908ab0, 0x0000023f7c907d90, 0x0000023f7c9097d0, 0x0000023f7c90a4f0, +0x0000023f7c69c710, 0x0000023f7c909e60, 0x0000023f7b044110, 0x0000023f7c69d430, +0x0000023f7c6a0f40, 0x0000023f7c8c3ee0, 0x0000023f7c8c31c0, 0x0000023f7cf71150, +0x0000023f7c8c4570, 0x0000023f7cf6fce0, 0x0000023f7cf6dad0, 0x0000023f7c8c10f0, +0x0000023f7c8c5920, 0x0000023f7c8c7360, 0x0000023f7c8c8710, 0x0000023f7c8c5fb0 +} + +Java Threads: ( => current thread ) + 0x0000023f746fdf80 JavaThread "Reference Handler" daemon [_thread_blocked, id=6476, stack(0x000000b5d2300000,0x000000b5d2400000) (1024K)] + 0x0000023f746ff150 JavaThread "Finalizer" daemon [_thread_blocked, id=8188, stack(0x000000b5d2400000,0x000000b5d2500000) (1024K)] + 0x0000023f74706800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=15196, stack(0x000000b5d2500000,0x000000b5d2600000) (1024K)] + 0x0000023f7470a230 JavaThread "Attach Listener" daemon [_thread_blocked, id=2400, stack(0x000000b5d2600000,0x000000b5d2700000) (1024K)] + 0x0000023f7470ff80 JavaThread "Service Thread" daemon [_thread_blocked, id=15348, stack(0x000000b5d2700000,0x000000b5d2800000) (1024K)] + 0x0000023f747105e0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=4080, stack(0x000000b5d2800000,0x000000b5d2900000) (1024K)] + 0x0000023f74724560 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=14832, stack(0x000000b5d2900000,0x000000b5d2a00000) (1024K)] + 0x0000023f74886d20 JavaThread "Notification Thread" daemon [_thread_blocked, id=15892, stack(0x000000b5d2b00000,0x000000b5d2c00000) (1024K)] + 0x0000023f74895580 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=9904, stack(0x000000b5d2c00000,0x000000b5d2d00000) (1024K)] + 0x0000023f7b045b50 JavaThread "Live Reload Server" daemon [_thread_in_native, id=7064, stack(0x000000b5d4600000,0x000000b5d4700000) (1024K)] + 0x0000023f7c6a0220 JavaThread "DestroyJavaVM" [_thread_blocked, id=1608, stack(0x000000b5d1b00000,0x000000b5d1c00000) (1024K)] + 0x0000023f7c908420 JavaThread "File Watcher" daemon [_thread_blocked, id=10340, stack(0x000000b5d1900000,0x000000b5d1a00000) (1024K)] + 0x0000023f7c908ab0 JavaThread "File Watcher" daemon [_thread_blocked, id=12424, stack(0x000000b5d2d00000,0x000000b5d2e00000) (1024K)] + 0x0000023f7c907d90 JavaThread "File Watcher" daemon [_thread_blocked, id=5796, stack(0x000000b5d2e00000,0x000000b5d2f00000) (1024K)] + 0x0000023f7c9097d0 JavaThread "File Watcher" daemon [_thread_blocked, id=13052, stack(0x000000b5d1a00000,0x000000b5d1b00000) (1024K)] + 0x0000023f7c90a4f0 JavaThread "File Watcher" daemon [_thread_blocked, id=4188, stack(0x000000b5d3300000,0x000000b5d3400000) (1024K)] + 0x0000023f7c69c710 JavaThread "File Watcher" daemon [_thread_blocked, id=20892, stack(0x000000b5d3800000,0x000000b5d3900000) (1024K)] + 0x0000023f7c909e60 JavaThread "File Watcher" daemon [_thread_blocked, id=2912, stack(0x000000b5d3400000,0x000000b5d3500000) (1024K)] + 0x0000023f7b044110 JavaThread "File Watcher" daemon [_thread_blocked, id=20492, stack(0x000000b5d3900000,0x000000b5d3a00000) (1024K)] + 0x0000023f7c69d430 JavaThread "PostgreSQL-JDBC-Cleaner" daemon [_thread_blocked, id=10248, stack(0x000000b5d4300000,0x000000b5d4400000) (1024K)] + 0x0000023f7c6a0f40 JavaThread "File Watcher" daemon [_thread_blocked, id=19220, stack(0x000000b5d4000000,0x000000b5d4100000) (1024K)] + 0x0000023f7c8c3ee0 JavaThread "Thread-62" [_thread_blocked, id=10452, stack(0x000000b5d1800000,0x000000b5d1900000) (1024K)] + 0x0000023f7c8c31c0 JavaThread "restartedMain" [_thread_blocked, id=19204, stack(0x000000b5d2a00000,0x000000b5d2b00000) (1024K)] + 0x0000023f7cf71150 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=6796, stack(0x000000b5d3f00000,0x000000b5d4000000) (1024K)] + 0x0000023f7c8c4570 JavaThread "Keep-Alive-Timer" daemon [_thread_blocked, id=6764, stack(0x000000b5d4100000,0x000000b5d4200000) (1024K)] + 0x0000023f7cf6fce0 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=11828, stack(0x000000b5d4200000,0x000000b5d4300000) (1024K)] + 0x0000023f7cf6dad0 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=9084, stack(0x000000b5d4400000,0x000000b5d4500000) (1024K)] + 0x0000023f7c8c10f0 JavaThread "Catalina-utility-1" [_thread_blocked, id=10336, stack(0x000000b5d4500000,0x000000b5d4600000) (1024K)] + 0x0000023f7c8c5920 JavaThread "Catalina-utility-2" [_thread_blocked, id=18808, stack(0x000000b5d4700000,0x000000b5d4800000) (1024K)] + 0x0000023f7c8c7360 JavaThread "container-9" [_thread_blocked, id=19136, stack(0x000000b5d4800000,0x000000b5d4900000) (1024K)] + 0x0000023f7c8c8710 JavaThread "Hikari housekeeper" daemon [_thread_blocked, id=11004, stack(0x000000b5d4900000,0x000000b5d4a00000) (1024K)] + 0x0000023f7c8c5fb0 JavaThread "Hikari connection adder" daemon [_thread_blocked, id=18468, stack(0x000000b5d4a00000,0x000000b5d4b00000) (1024K)] +Total: 32 + +Other Threads: +=>0x0000023f746dfda0 VMThread "VM Thread" [id=14856, stack(0x000000b5d2200000,0x000000b5d2300000) (1024K)] + 0x0000023f746ce170 WatcherThread "VM Periodic Task Thread" [id=2652, stack(0x000000b5d2100000,0x000000b5d2200000) (1024K)] + 0x0000023f6140d400 WorkerThread "GC Thread#0" [id=1428, stack(0x000000b5d1c00000,0x000000b5d1d00000) (1024K)] + 0x0000023f746e04e0 WorkerThread "GC Thread#1" [id=15932, stack(0x000000b5d2f00000,0x000000b5d3000000) (1024K)] + 0x0000023f746e0fc0 WorkerThread "GC Thread#2" [id=17440, stack(0x000000b5d3000000,0x000000b5d3100000) (1024K)] + 0x0000023f746e0140 WorkerThread "GC Thread#3" [id=808, stack(0x000000b5d3100000,0x000000b5d3200000) (1024K)] + 0x0000023f746df660 WorkerThread "GC Thread#4" [id=17436, stack(0x000000b5d3200000,0x000000b5d3300000) (1024K)] + 0x0000023f746e0880 WorkerThread "GC Thread#5" [id=17736, stack(0x000000b5d3500000,0x000000b5d3600000) (1024K)] + 0x0000023f746e0c20 WorkerThread "GC Thread#6" [id=17740, stack(0x000000b5d3600000,0x000000b5d3700000) (1024K)] + 0x0000023f798df680 WorkerThread "GC Thread#7" [id=17744, stack(0x000000b5d3700000,0x000000b5d3800000) (1024K)] + 0x0000023f798e0160 WorkerThread "GC Thread#8" [id=1140, stack(0x000000b5d3a00000,0x000000b5d3b00000) (1024K)] + 0x0000023f798dfdc0 WorkerThread "GC Thread#9" [id=3336, stack(0x000000b5d3b00000,0x000000b5d3c00000) (1024K)] + 0x0000023f6141e100 ConcurrentGCThread "G1 Main Marker" [id=17712, stack(0x000000b5d1d00000,0x000000b5d1e00000) (1024K)] + 0x0000023f614210a0 WorkerThread "G1 Conc#0" [id=11280, stack(0x000000b5d1e00000,0x000000b5d1f00000) (1024K)] + 0x0000023f798e0c40 WorkerThread "G1 Conc#1" [id=14956, stack(0x000000b5d3c00000,0x000000b5d3d00000) (1024K)] + 0x0000023f798e0500 WorkerThread "G1 Conc#2" [id=8236, stack(0x000000b5d3d00000,0x000000b5d3e00000) (1024K)] + 0x0000023f7459b4a0 ConcurrentGCThread "G1 Refine#0" [id=7512, stack(0x000000b5d1f00000,0x000000b5d2000000) (1024K)] + 0x0000023f7459bb20 ConcurrentGCThread "G1 Service" [id=14540, stack(0x000000b5d2000000,0x000000b5d2100000) (1024K)] +Total: 18 + +Threads with active compile tasks: +Total: 0 + +VM state: at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00007ffdfde7b8b0] Threads_lock - owner thread: 0x0000023f746dfda0 +[0x00007ffdfde7b9b0] Heap_lock - owner thread: 0x0000023f7c8c31c0 + +Heap address: 0x000000070ae00000, size: 3922 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) mapped at: [0x0000023f00000000-0x0000023f00c80000-0x0000023f00c80000), size 13107200, SharedBaseAddress: 0x0000023f00000000, ArchiveRelocationMode: 1. +Compressed class space mapped at: 0x0000023f01000000-0x0000023f41000000, reserved size: 1073741824 +Narrow klass base: 0x0000023f00000000, Narrow klass shift: 0, Narrow klass range: 0x100000000 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + CPUs: 12 total, 12 available + Memory: 15681M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (Zero based) + Heap Region Size: 2M + Heap Min Capacity: 8M + Heap Initial Capacity: 246M + Heap Max Capacity: 3922M + Pre-touch: Disabled + Parallel Workers: 10 + Concurrent Workers: 3 + Concurrent Refinement Workers: 10 + Periodic GC: Disabled + +Heap: + garbage-first heap total 141312K, used 48097K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 3 survivors (6144K) + Metaspace used 99436K, committed 101376K, reserved 1179648K + class space used 14081K, committed 15040K, reserved 1048576K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom +| 0|0x000000070ae00000, 0x000000070b000000, 0x000000070b000000|100%| O| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked +| 1|0x000000070b000000, 0x000000070b200000, 0x000000070b200000|100%| O| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked +| 2|0x000000070b200000, 0x000000070b400000, 0x000000070b400000|100%| O| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked +| 3|0x000000070b400000, 0x000000070b5ffff0, 0x000000070b600000| 99%| O| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked +| 4|0x000000070b600000, 0x000000070b7fffd0, 0x000000070b800000| 99%| O| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked +| 5|0x000000070b800000, 0x000000070b9ffff0, 0x000000070ba00000| 99%| O| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked +| 6|0x000000070ba00000, 0x000000070bbffff0, 0x000000070bc00000| 99%| O| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked +| 7|0x000000070bc00000, 0x000000070be00000, 0x000000070be00000|100%| O| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked +| 8|0x000000070be00000, 0x000000070bffffd8, 0x000000070c000000| 99%| O| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked +| 9|0x000000070c000000, 0x000000070c1ffff8, 0x000000070c200000| 99%| O| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked +| 10|0x000000070c200000, 0x000000070c3fffb8, 0x000000070c400000| 99%| O| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked +| 11|0x000000070c400000, 0x000000070c5ffff8, 0x000000070c600000| 99%| O| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked +| 12|0x000000070c600000, 0x000000070c7ffff8, 0x000000070c800000| 99%| O| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked +| 13|0x000000070c800000, 0x000000070c9fffa8, 0x000000070ca00000| 99%| O| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked +| 14|0x000000070ca00000, 0x000000070cbfffe0, 0x000000070cc00000| 99%| O| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked +| 15|0x000000070cc00000, 0x000000070cdffff0, 0x000000070ce00000| 99%| O| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked +| 16|0x000000070ce00000, 0x000000070cffffd0, 0x000000070d000000| 99%| O| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked +| 17|0x000000070d000000, 0x000000070d200000, 0x000000070d200000|100%| O| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked +| 18|0x000000070d200000, 0x000000070d2bd178, 0x000000070d400000| 36%| O| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked +| 19|0x000000070d400000, 0x000000070d600000, 0x000000070d600000|100%| O| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked +| 20|0x000000070d600000, 0x000000070d6cb8e8, 0x000000070d800000| 39%| O| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked +| 21|0x000000070d800000, 0x000000070d803748, 0x000000070da00000| 0%| O|Cm|TAMS 0x000000070d800000| PB 0x000000070d800000| Complete +| 22|0x000000070da00000, 0x000000070dab5890, 0x000000070dc00000| 35%| O| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked +| 23|0x000000070dc00000, 0x000000070dc27310, 0x000000070de00000| 7%| O| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked +| 24|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked +| 25|0x000000070e000000, 0x000000070e200000, 0x000000070e200000|100%| O| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked +| 26|0x000000070e200000, 0x000000070e400000, 0x000000070e400000|100%| S|CS|TAMS 0x000000070e200000| PB 0x000000070e200000| Complete +| 27|0x000000070e400000, 0x000000070e600000, 0x000000070e600000|100%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete +| 28|0x000000070e600000, 0x000000070e600000, 0x000000070e800000| 0%| F| |TAMS 0x000000070e600000| PB 0x000000070e600000| Untracked +| 29|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked +| 30|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked +| 31|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked +| 32|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked +| 33|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked +| 34|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked +| 35|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked +| 36|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked +| 37|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked +| 38|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked +| 39|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked +| 40|0x000000070fe00000, 0x000000070fe00000, 0x0000000710000000| 0%| F| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Untracked +| 41|0x0000000710000000, 0x0000000710000000, 0x0000000710200000| 0%| F| |TAMS 0x0000000710000000| PB 0x0000000710000000| Untracked +| 42|0x0000000710200000, 0x0000000710200000, 0x0000000710400000| 0%| F| |TAMS 0x0000000710200000| PB 0x0000000710200000| Untracked +| 43|0x0000000710400000, 0x0000000710400000, 0x0000000710600000| 0%| F| |TAMS 0x0000000710400000| PB 0x0000000710400000| Untracked +| 44|0x0000000710600000, 0x0000000710600000, 0x0000000710800000| 0%| F| |TAMS 0x0000000710600000| PB 0x0000000710600000| Untracked +| 45|0x0000000710800000, 0x0000000710800000, 0x0000000710a00000| 0%| F| |TAMS 0x0000000710800000| PB 0x0000000710800000| Untracked +| 46|0x0000000710a00000, 0x0000000710a00000, 0x0000000710c00000| 0%| F| |TAMS 0x0000000710a00000| PB 0x0000000710a00000| Untracked +| 47|0x0000000710c00000, 0x0000000710c00000, 0x0000000710e00000| 0%| F| |TAMS 0x0000000710c00000| PB 0x0000000710c00000| Untracked +| 48|0x0000000710e00000, 0x0000000710e00000, 0x0000000711000000| 0%| F| |TAMS 0x0000000710e00000| PB 0x0000000710e00000| Untracked +| 49|0x0000000711000000, 0x0000000711000000, 0x0000000711200000| 0%| F| |TAMS 0x0000000711000000| PB 0x0000000711000000| Untracked +| 50|0x0000000711200000, 0x0000000711200000, 0x0000000711400000| 0%| F| |TAMS 0x0000000711200000| PB 0x0000000711200000| Untracked +| 51|0x0000000711400000, 0x0000000711400000, 0x0000000711600000| 0%| F| |TAMS 0x0000000711400000| PB 0x0000000711400000| Untracked +| 52|0x0000000711600000, 0x0000000711600000, 0x0000000711800000| 0%| F| |TAMS 0x0000000711600000| PB 0x0000000711600000| Untracked +| 53|0x0000000711800000, 0x0000000711800000, 0x0000000711a00000| 0%| F| |TAMS 0x0000000711800000| PB 0x0000000711800000| Untracked +| 54|0x0000000711a00000, 0x0000000711a00000, 0x0000000711c00000| 0%| F| |TAMS 0x0000000711a00000| PB 0x0000000711a00000| Untracked +| 55|0x0000000711c00000, 0x0000000711c00000, 0x0000000711e00000| 0%| F| |TAMS 0x0000000711c00000| PB 0x0000000711c00000| Untracked +| 56|0x0000000711e00000, 0x0000000711e00000, 0x0000000712000000| 0%| F| |TAMS 0x0000000711e00000| PB 0x0000000711e00000| Untracked +| 57|0x0000000712000000, 0x0000000712000000, 0x0000000712200000| 0%| F| |TAMS 0x0000000712000000| PB 0x0000000712000000| Untracked +| 58|0x0000000712200000, 0x0000000712200000, 0x0000000712400000| 0%| F| |TAMS 0x0000000712200000| PB 0x0000000712200000| Untracked +| 59|0x0000000712400000, 0x0000000712400000, 0x0000000712600000| 0%| F| |TAMS 0x0000000712400000| PB 0x0000000712400000| Untracked +| 60|0x0000000712600000, 0x0000000712600000, 0x0000000712800000| 0%| F| |TAMS 0x0000000712600000| PB 0x0000000712600000| Untracked +| 61|0x0000000712800000, 0x0000000712800000, 0x0000000712a00000| 0%| F| |TAMS 0x0000000712800000| PB 0x0000000712800000| Untracked +| 62|0x0000000712a00000, 0x0000000712a00000, 0x0000000712c00000| 0%| F| |TAMS 0x0000000712a00000| PB 0x0000000712a00000| Untracked +| 63|0x0000000712c00000, 0x0000000712c00000, 0x0000000712e00000| 0%| F| |TAMS 0x0000000712c00000| PB 0x0000000712c00000| Untracked +| 64|0x0000000712e00000, 0x0000000712e00000, 0x0000000713000000| 0%| F| |TAMS 0x0000000712e00000| PB 0x0000000712e00000| Untracked +| 65|0x0000000713000000, 0x0000000713000000, 0x0000000713200000| 0%| F| |TAMS 0x0000000713000000| PB 0x0000000713000000| Untracked +| 66|0x0000000713200000, 0x0000000713200000, 0x0000000713400000| 0%| F| |TAMS 0x0000000713200000| PB 0x0000000713200000| Untracked +| 67|0x0000000713400000, 0x0000000713453130, 0x0000000713600000| 16%| S|CS|TAMS 0x0000000713400000| PB 0x0000000713400000| Complete +|1960|0x00000007ffe00000, 0x00000007ffe3c780, 0x0000000800000000| 11%| O| |TAMS 0x00000007ffe00000| PB 0x00000007ffe00000| Untracked + +Card table byte_map: [0x0000023f6d590000,0x0000023f6dd40000] _byte_map_base: 0x0000023f69d39000 + +Marking Bits: (CMBitMap*) 0x0000023f6140e310 + Bits: [0x0000023f6dd40000, 0x0000023f71a88000) + +Polling page: 0x0000023f5f1d0000 + +Metaspace: + +Usage: + Non-class: 83.35 MB used. + Class: 13.75 MB used. + Both: 97.11 MB used. + +Virtual space: + Non-class space: 128.00 MB reserved, 84.31 MB ( 66%) committed, 2 nodes. + Class space: 1.00 GB reserved, 14.69 MB ( 1%) committed, 1 nodes. + Both: 1.12 GB reserved, 99.00 MB ( 9%) committed. + +Chunk freelists: + Non-Class: 11.60 MB + Class: 1.92 MB + Both: 13.52 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 171.25 MB +CDS: on + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 11. +num_arena_births: 3156. +num_arena_deaths: 2048. +num_vsnodes_births: 3. +num_vsnodes_deaths: 0. +num_space_committed: 1650. +num_space_uncommitted: 35. +num_chunks_returned_to_freelist: 3272. +num_chunks_taken_from_freelist: 8069. +num_chunk_merges: 556. +num_chunk_splits: 4544. +num_chunks_enlarged: 3414. +num_inconsistent_stats: 0. + +CodeCache: size=49152Kb used=25524Kb max_used=26752Kb free=23627Kb + bounds [0x0000023f69ab0000, 0x0000023f6b650000, 0x0000023f6cab0000] + total_blobs=12210, nmethods=11403, adapters=727, full_count=0 +Compilation: enabled, stopped_count=0, restarted_count=0 + +Compilation events (20 events): +Event: 18087.670 Thread 0x0000023f74724560 nmethod 45246 0x0000023f6b504c90 code [0x0000023f6b505140, 0x0000023f6b507328] +Event: 18087.670 Thread 0x0000023f7cf6dad0 45268 1 org.springframework.data.jpa.repository.query.HqlParser$Ql_statementContext::accept (26 bytes) +Event: 18087.670 Thread 0x0000023f7cf71150 45251 1 org.springframework.data.jpa.repository.query.HqlParser$FromClauseContext::accept (26 bytes) +Event: 18087.670 Thread 0x0000023f74724560 45252 1 org.springframework.data.jpa.repository.query.HqlParser$WhereClauseContext::accept (26 bytes) +Event: 18087.671 Thread 0x0000023f7cf6dad0 nmethod 45268 0x0000023f6b504790 code [0x0000023f6b504960, 0x0000023f6b504ba0] +Event: 18087.671 Thread 0x0000023f7cf71150 nmethod 45251 0x0000023f6b504290 code [0x0000023f6b504460, 0x0000023f6b5046a0] +Event: 18087.671 Thread 0x0000023f7cf6dad0 45253 1 org.springframework.data.jpa.repository.query.HqlParser$SelectQueryContext::groupByClause (11 bytes) +Event: 18087.671 Thread 0x0000023f7cf71150 45254 1 org.springframework.data.jpa.repository.query.HqlParser$SelectQueryContext::havingClause (11 bytes) +Event: 18087.671 Thread 0x0000023f74724560 nmethod 45252 0x0000023f6b503d90 code [0x0000023f6b503f60, 0x0000023f6b5041a0] +Event: 18087.671 Thread 0x0000023f7cf6dad0 nmethod 45253 0x0000023f6b503990 code [0x0000023f6b503b40, 0x0000023f6b503cb0] +Event: 18087.671 Thread 0x0000023f7cf71150 nmethod 45254 0x0000023f6b503590 code [0x0000023f6b503740, 0x0000023f6b5038b0] +Event: 18087.671 Thread 0x0000023f7cf6dad0 45274 1 org.hibernate.metamodel.model.domain.internal.AbstractAttribute::getName (5 bytes) +Event: 18087.671 Thread 0x0000023f74724560 45275 1 org.hibernate.metamodel.model.domain.internal.BasicSqmPathSource::isGeneric (5 bytes) +Event: 18087.671 Thread 0x0000023f7cf6fce0 nmethod 45273 0x0000023f6b502310 code [0x0000023f6b5025a0, 0x0000023f6b502e30] +Event: 18087.671 Thread 0x0000023f7cf6dad0 nmethod 45274 0x0000023f6a7a1690 code [0x0000023f6a7a1820, 0x0000023f6a7a18f0] +Event: 18087.671 Thread 0x0000023f74724560 nmethod 45275 0x0000023f6a7a5f10 code [0x0000023f6a7a60a0, 0x0000023f6a7a6170] +Event: 18087.671 Thread 0x0000023f7cf6dad0 45276 1 org.springframework.aop.support.AbstractPointcutAdvisor:: (5 bytes) +Event: 18087.671 Thread 0x0000023f7cf71150 45277 1 java.lang.reflect.Proxy$ProxyBuilder::validateProxyInterfaces (259 bytes) +Event: 18087.671 Thread 0x0000023f7cf6dad0 nmethod 45276 0x0000023f6a7a9490 code [0x0000023f6a7a9620, 0x0000023f6a7a96e8] +Event: 18087.673 Thread 0x0000023f7cf71150 nmethod 45277 0x0000023f6b500910 code [0x0000023f6b500d00, 0x0000023f6b501b10] + +GC Heap History (20 events): +Event: 18052.821 GC heap after +{Heap after GC invocations=180 (full 7): + garbage-first heap total 137216K, used 45023K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 3 survivors (6144K) + Metaspace used 99599K, committed 101568K, reserved 1179648K + class space used 14111K, committed 15040K, reserved 1048576K +} +Event: 18053.749 GC heap before +{Heap before GC invocations=180 (full 7): + garbage-first heap total 137216K, used 120799K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 40 young (81920K), 3 survivors (6144K) + Metaspace used 99963K, committed 101568K, reserved 1179648K + class space used 14144K, committed 15040K, reserved 1048576K +} +Event: 18053.757 GC heap after +{Heap after GC invocations=181 (full 7): + garbage-first heap total 137216K, used 47302K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 3 survivors (6144K) + Metaspace used 99963K, committed 101568K, reserved 1179648K + class space used 14144K, committed 15040K, reserved 1048576K +} +Event: 18062.510 GC heap before +{Heap before GC invocations=181 (full 7): + garbage-first heap total 137216K, used 112838K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 36 young (73728K), 3 survivors (6144K) + Metaspace used 100154K, committed 101568K, reserved 1179648K + class space used 14163K, committed 15040K, reserved 1048576K +} +Event: 18062.598 GC heap after +{Heap after GC invocations=182 (full 8): + garbage-first heap total 137216K, used 39256K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 0 young (0K), 0 survivors (0K) + Metaspace used 99204K, committed 101184K, reserved 1179648K + class space used 14068K, committed 15040K, reserved 1048576K +} +Event: 18063.968 GC heap before +{Heap before GC invocations=182 (full 8): + garbage-first heap total 137216K, used 119128K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 39 young (79872K), 0 survivors (0K) + Metaspace used 99385K, committed 101184K, reserved 1179648K + class space used 14090K, committed 15040K, reserved 1048576K +} +Event: 18063.972 GC heap after +{Heap after GC invocations=183 (full 8): + garbage-first heap total 137216K, used 43776K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 3 survivors (6144K) + Metaspace used 99385K, committed 101184K, reserved 1179648K + class space used 14090K, committed 15040K, reserved 1048576K +} +Event: 18064.386 GC heap before +{Heap before GC invocations=184 (full 8): + garbage-first heap total 137216K, used 119552K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 40 young (81920K), 3 survivors (6144K) + Metaspace used 99385K, committed 101184K, reserved 1179648K + class space used 14090K, committed 15040K, reserved 1048576K +} +Event: 18064.392 GC heap after +{Heap after GC invocations=185 (full 8): + garbage-first heap total 137216K, used 45178K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 3 survivors (6144K) + Metaspace used 99385K, committed 101184K, reserved 1179648K + class space used 14090K, committed 15040K, reserved 1048576K +} +Event: 18065.219 GC heap before +{Heap before GC invocations=185 (full 8): + garbage-first heap total 137216K, used 118906K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 40 young (81920K), 3 survivors (6144K) + Metaspace used 99755K, committed 101248K, reserved 1179648K + class space used 14124K, committed 15040K, reserved 1048576K +} +Event: 18065.226 GC heap after +{Heap after GC invocations=186 (full 8): + garbage-first heap total 137216K, used 47642K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 3 survivors (6144K) + Metaspace used 99755K, committed 101248K, reserved 1179648K + class space used 14124K, committed 15040K, reserved 1048576K +} +Event: 18084.430 GC heap before +{Heap before GC invocations=186 (full 8): + garbage-first heap total 137216K, used 121370K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 39 young (79872K), 3 survivors (6144K) + Metaspace used 99948K, committed 101376K, reserved 1179648K + class space used 14144K, committed 15040K, reserved 1048576K +} +Event: 18084.440 GC heap after +{Heap after GC invocations=187 (full 8): + garbage-first heap total 137216K, used 48590K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 3 survivors (6144K) + Metaspace used 99948K, committed 101376K, reserved 1179648K + class space used 14144K, committed 15040K, reserved 1048576K +} +Event: 18084.560 GC heap before +{Heap before GC invocations=187 (full 8): + garbage-first heap total 137216K, used 48590K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 4 young (8192K), 3 survivors (6144K) + Metaspace used 99830K, committed 101376K, reserved 1179648K + class space used 14112K, committed 15040K, reserved 1048576K +} +Event: 18084.660 GC heap after +{Heap after GC invocations=188 (full 9): + garbage-first heap total 137216K, used 39330K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 0 young (0K), 0 survivors (0K) + Metaspace used 98887K, committed 101376K, reserved 1179648K + class space used 14024K, committed 15040K, reserved 1048576K +} +Event: 18086.508 GC heap before +{Heap before GC invocations=188 (full 9): + garbage-first heap total 137216K, used 117154K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 39 young (79872K), 0 survivors (0K) + Metaspace used 99072K, committed 101376K, reserved 1179648K + class space used 14047K, committed 15040K, reserved 1048576K +} +Event: 18086.512 GC heap after +{Heap after GC invocations=189 (full 9): + garbage-first heap total 137216K, used 44217K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 3 young (6144K), 3 survivors (6144K) + Metaspace used 99072K, committed 101376K, reserved 1179648K + class space used 14047K, committed 15040K, reserved 1048576K +} +Event: 18086.928 GC heap before +{Heap before GC invocations=189 (full 9): + garbage-first heap total 137216K, used 117945K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 39 young (79872K), 3 survivors (6144K) + Metaspace used 99074K, committed 101376K, reserved 1179648K + class space used 14047K, committed 15040K, reserved 1048576K +} +Event: 18086.933 GC heap after +{Heap after GC invocations=190 (full 9): + garbage-first heap total 137216K, used 45924K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 4 young (8192K), 4 survivors (8192K) + Metaspace used 99074K, committed 101376K, reserved 1179648K + class space used 14047K, committed 15040K, reserved 1048576K +} +Event: 18087.705 GC heap before +{Heap before GC invocations=191 (full 9): + garbage-first heap total 137216K, used 119652K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 40 young (81920K), 4 survivors (8192K) + Metaspace used 99436K, committed 101376K, reserved 1179648K + class space used 14081K, committed 15040K, reserved 1048576K +} + +Dll operation events (10 events): +Event: 0.018 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll +Event: 0.257 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\net.dll +Event: 0.262 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\nio.dll +Event: 0.271 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\zip.dll +Event: 0.499 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jimage.dll +Event: 1.188 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\management.dll +Event: 1.198 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\management_ext.dll +Event: 3.183 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\sunmscapi.dll +Event: 3.321 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\extnet.dll +Event: 11.745 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\verify.dll + +Deoptimization events (12 events): +Event: 2.514 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f69f8fff4 sp=0x000000b5d34fe590 +Event: 2.514 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fda58 mode 0 +Event: 13.839 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f6a7d36dc sp=0x000000b5d34fce80 +Event: 13.839 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fc308 mode 0 +Event: 14.705 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f6a042979 sp=0x000000b5d34fcb40 +Event: 14.705 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fc048 mode 3 +Event: 14.705 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f6a03963a sp=0x000000b5d34fcb00 +Event: 14.705 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fc048 mode 3 +Event: 14.899 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f69f813bc sp=0x000000b5d34fd140 +Event: 14.899 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fc698 mode 0 +Event: 25.264 Thread 0x0000023f7b043a80 DEOPT PACKING pc=0x0000023f69f317ac sp=0x000000b5d47fa5b0 +Event: 25.264 Thread 0x0000023f7b043a80 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d47f9a70 mode 0 + +Classes loaded (20 events): +Event: 18052.405 Loading class java/lang/ObjectCustomizer +Event: 18052.406 Loading class java/lang/ObjectCustomizer done +Event: 18052.406 Loading class java/lang/ObjectCustomizer +Event: 18052.406 Loading class java/lang/ObjectCustomizer done +Event: 18064.043 Loading class java/lang/ObjectBeanInfo +Event: 18064.043 Loading class java/lang/ObjectBeanInfo done +Event: 18064.043 Loading class java/lang/ObjectBeanInfo +Event: 18064.043 Loading class java/lang/ObjectBeanInfo done +Event: 18064.044 Loading class java/lang/ObjectCustomizer +Event: 18064.044 Loading class java/lang/ObjectCustomizer done +Event: 18064.044 Loading class java/lang/ObjectCustomizer +Event: 18064.044 Loading class java/lang/ObjectCustomizer done +Event: 18086.602 Loading class java/lang/ObjectBeanInfo +Event: 18086.602 Loading class java/lang/ObjectBeanInfo done +Event: 18086.602 Loading class java/lang/ObjectBeanInfo +Event: 18086.602 Loading class java/lang/ObjectBeanInfo done +Event: 18086.603 Loading class java/lang/ObjectCustomizer +Event: 18086.603 Loading class java/lang/ObjectCustomizer done +Event: 18086.603 Loading class java/lang/ObjectCustomizer +Event: 18086.603 Loading class java/lang/ObjectCustomizer done + +Classes unloaded (20 events): +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a8d0 'fr/codecake/airbnbclone/user/application/UserService' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a6b8 'fr/codecake/airbnbclone/user/application/Auth0Service' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a490 'fr/codecake/airbnbclone/listing/presentation/TenantResource' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a268 'fr/codecake/airbnbclone/listing/presentation/LandlordResource' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a000 'fr/codecake/airbnbclone/listing/mapper/ListingPictureMapperImpl' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0d80 'fr/codecake/airbnbclone/listing/mapper/ListingPictureMapper' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0aa0 'fr/codecake/airbnbclone/listing/mapper/ListingMapperImpl' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb08a0 'fr/codecake/airbnbclone/listing/mapper/ListingMapper' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0678 'fr/codecake/airbnbclone/listing/application/TenantService' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0460 'fr/codecake/airbnbclone/listing/application/PictureService' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0220 'fr/codecake/airbnbclone/listing/application/LandlordService' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0000 'fr/codecake/airbnbclone/infrastructure/config/SecurityConfiguration' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f011dcc70 'fr/codecake/airbnbclone/infrastructure/config/DatabaseConfiguration' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f011dca38 'fr/codecake/airbnbclone/booking/presentation/BookingResource' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f011dc800 'fr/codecake/airbnbclone/booking/mapper/BookingMapperImpl' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01eb1c48 'fr/codecake/airbnbclone/booking/mapper/BookingMapper' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01eb1a08 'fr/codecake/airbnbclone/booking/application/BookingService' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01eb1800 'fr/codecake/airbnbclone/NbatCloneBackApplication' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f014b0000 'java/lang/invoke/LambdaForm$MH+0x0000023f014b0000' +Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e63800 'java/lang/invoke/LambdaForm$MH+0x0000023f01e63800' + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 18086.664 Thread 0x0000023f7c8c31c0 Exception (0x0000000712835348) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.664 Thread 0x0000023f7c8c31c0 Exception (0x000000071283b8c8) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.665 Thread 0x0000023f7c8c31c0 Exception (0x0000000712851f40) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.666 Thread 0x0000023f7c8c31c0 Exception (0x0000000712858468) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.667 Thread 0x0000023f7c8c31c0 Exception (0x000000071286eff8) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.667 Thread 0x0000023f7c8c31c0 Exception (0x00000007128754c8) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.668 Thread 0x0000023f7c8c31c0 Exception (0x000000071288bf58) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.668 Thread 0x0000023f7c8c31c0 Exception (0x0000000712892178) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.669 Thread 0x0000023f7c8c31c0 Exception (0x00000007128b2820) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.670 Thread 0x0000023f7c8c31c0 Exception (0x00000007128b8e88) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.670 Thread 0x0000023f7c8c31c0 Exception (0x00000007128d5b70) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.671 Thread 0x0000023f7c8c31c0 Exception (0x00000007128dc108) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.671 Thread 0x0000023f7c8c31c0 Exception (0x00000007128f29e8) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.672 Thread 0x0000023f7c8c31c0 Exception (0x00000007128f8bb0) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.673 Thread 0x0000023f7c8c31c0 Exception (0x0000000712909750) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.673 Thread 0x0000023f7c8c31c0 Exception (0x000000071290fc78) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.674 Thread 0x0000023f7c8c31c0 Exception (0x0000000712920750) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.674 Thread 0x0000023f7c8c31c0 Exception (0x0000000712926c20) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.675 Thread 0x0000023f7c8c31c0 Exception (0x000000071293e848) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] +Event: 18086.676 Thread 0x0000023f7c8c31c0 Exception (0x0000000712944de0) +thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] + +ZGC Phase Switch (0 events): +No events + +VM Operations (20 events): +Event: 18066.236 Executing VM operation: Cleanup done +Event: 18071.273 Executing VM operation: Cleanup +Event: 18071.273 Executing VM operation: Cleanup done +Event: 18084.429 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) +Event: 18084.440 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done +Event: 18084.506 Executing VM operation: G1PauseRemark +Event: 18084.544 Executing VM operation: G1PauseRemark done +Event: 18084.560 Executing VM operation: G1CollectFull (System.gc()) +Event: 18084.660 Executing VM operation: G1CollectFull (System.gc()) done +Event: 18085.670 Executing VM operation: Cleanup +Event: 18085.670 Executing VM operation: Cleanup done +Event: 18086.508 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) +Event: 18086.512 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done +Event: 18086.928 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) +Event: 18086.933 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done +Event: 18086.974 Executing VM operation: G1PauseRemark +Event: 18086.987 Executing VM operation: G1PauseRemark done +Event: 18087.002 Executing VM operation: G1PauseCleanup +Event: 18087.002 Executing VM operation: G1PauseCleanup done +Event: 18087.705 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) + +Memory protections (0 events): +No events + +Nmethod flushes (20 events): +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b38b390 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b38b710 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b38c010 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b38d510 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3b0510 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3b0910 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3b0c10 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3b4090 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3cfb90 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3d5b10 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3d5e10 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3ed190 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3eda90 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3edf10 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3ee210 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3ef890 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3efc10 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3eff10 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3f0a90 +Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b486c90 + +Events (20 events): +Event: 18084.456 Thread 0x0000023f7c8c4570 Thread exited: 0x0000023f7c8c4570 +Event: 18084.559 Thread 0x0000023f7c69e7e0 Thread exited: 0x0000023f7c69e7e0 +Event: 18084.660 Thread 0x0000023f7c8c3ee0 Thread added: 0x0000023f7c8c31c0 +Event: 18084.661 Thread 0x0000023f7c69dac0 Thread exited: 0x0000023f7c69dac0 +Event: 18084.661 Thread 0x0000023f7c8c31c0 Thread exited: 0x0000023f7c8c31c0 +Event: 18084.662 Thread 0x0000023f7c8c3ee0 Thread added: 0x0000023f7c8c31c0 +Event: 18084.665 Thread 0x0000023f7c69e150 Thread exited: 0x0000023f7c69e150 +Event: 18084.736 Thread 0x0000023f74724560 Thread added: 0x0000023f7cf71150 +Event: 18084.891 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c4570 +Event: 18084.892 Thread 0x0000023f7c8c4570 Thread exited: 0x0000023f7c8c4570 +Event: 18085.171 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c4570 +Event: 18085.364 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c10f0 +Event: 18085.410 Thread 0x0000023f7c8c10f0 Thread exited: 0x0000023f7c8c10f0 +Event: 18086.339 Thread 0x0000023f74724560 Thread added: 0x0000023f7cf6fce0 +Event: 18086.339 Thread 0x0000023f74724560 Thread added: 0x0000023f7cf6dad0 +Event: 18086.403 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c10f0 +Event: 18086.404 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c5920 +Event: 18086.404 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c7360 +Event: 18086.542 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c8710 +Event: 18086.651 Thread 0x0000023f7c8c8710 Thread added: 0x0000023f7c8c5fb0 + + +Dynamic libraries: +0x00007ff6b0be0000 - 0x00007ff6b0bee000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.exe +0x00007ffe815a0000 - 0x00007ffe81807000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ffe80de0000 - 0x00007ffe80ea9000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ffe7ed40000 - 0x00007ffe7f12f000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ffe7f1f0000 - 0x00007ffe7f33b000 C:\WINDOWS\System32\ucrtbase.dll +0x00007ffe25b90000 - 0x00007ffe25bae000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\VCRUNTIME140.dll +0x00007ffe00530000 - 0x00007ffe00548000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jli.dll +0x00007ffe80490000 - 0x00007ffe80655000 C:\WINDOWS\System32\USER32.dll +0x00007ffe7ed10000 - 0x00007ffe7ed37000 C:\WINDOWS\System32\win32u.dll +0x00007ffe64700000 - 0x00007ffe64993000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll +0x00007ffe7fe30000 - 0x00007ffe7fe5b000 C:\WINDOWS\System32\GDI32.dll +0x00007ffe80f50000 - 0x00007ffe80ff9000 C:\WINDOWS\System32\msvcrt.dll +0x00007ffe7e780000 - 0x00007ffe7e8ac000 C:\WINDOWS\System32\gdi32full.dll +0x00007ffe7f140000 - 0x00007ffe7f1e3000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ffe81520000 - 0x00007ffe81551000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffe74950000 - 0x00007ffe7495c000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\vcruntime140_1.dll +0x00007ffdfdf60000 - 0x00007ffdfdfe9000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\msvcp140.dll +0x00007ffdfd1b0000 - 0x00007ffdfdf5d000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server\jvm.dll +0x00007ffe7ff40000 - 0x00007ffe7fff4000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ffe80d30000 - 0x00007ffe80dd6000 C:\WINDOWS\System32\sechost.dll +0x00007ffe81260000 - 0x00007ffe81378000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffe7fb10000 - 0x00007ffe7fb84000 C:\WINDOWS\System32\WS2_32.dll +0x00007ffe7e550000 - 0x00007ffe7e5ae000 C:\WINDOWS\SYSTEM32\POWRPROF.dll +0x00007ffe772f0000 - 0x00007ffe772fb000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007ffe77270000 - 0x00007ffe772a5000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ffe7e530000 - 0x00007ffe7e544000 C:\WINDOWS\SYSTEM32\UMPDC.dll +0x00007ffe7d460000 - 0x00007ffe7d47b000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffe74530000 - 0x00007ffe7453a000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jimage.dll +0x00007ffe71870000 - 0x00007ffe71ab2000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ffe809a0000 - 0x00007ffe80d26000 C:\WINDOWS\System32\combase.dll +0x00007ffe7fe60000 - 0x00007ffe7ff36000 C:\WINDOWS\System32\OLEAUT32.dll +0x00007ffe66620000 - 0x00007ffe6665c000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ffe7e8b0000 - 0x00007ffe7e955000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007ffdffd70000 - 0x00007ffdffd91000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll +0x00007ffe7f340000 - 0x00007ffe7fa93000 C:\WINDOWS\System32\SHELL32.dll +0x00007ffe7e960000 - 0x00007ffe7eaca000 C:\WINDOWS\System32\wintypes.dll +0x00007ffe7c2b0000 - 0x00007ffe7cb0e000 C:\WINDOWS\SYSTEM32\windows.storage.dll +0x00007ffe7fd30000 - 0x00007ffe7fe25000 C:\WINDOWS\System32\SHCORE.dll +0x00007ffe7faa0000 - 0x00007ffe7fb06000 C:\WINDOWS\System32\shlwapi.dll +0x00007ffe7e610000 - 0x00007ffe7e639000 C:\WINDOWS\SYSTEM32\profapi.dll +0x00007ffdffee0000 - 0x00007ffdffef1000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\net.dll +0x00007ffe782a0000 - 0x00007ffe783c8000 C:\WINDOWS\SYSTEM32\WINHTTP.dll +0x00007ffe7d9b0000 - 0x00007ffe7da1b000 C:\WINDOWS\system32\mswsock.dll +0x00007ffdffd50000 - 0x00007ffdffd66000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\nio.dll +0x00007ffdffd30000 - 0x00007ffdffd48000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\zip.dll +0x00007ffe79700000 - 0x00007ffe7970a000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\management.dll +0x00007ffe796f0000 - 0x00007ffe796fc000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\management_ext.dll +0x00007ffe80f40000 - 0x00007ffe80f48000 C:\WINDOWS\System32\PSAPI.DLL +0x00007ffe7dda0000 - 0x00007ffe7ddbb000 C:\WINDOWS\SYSTEM32\CRYPTSP.dll +0x00007ffe7d3c0000 - 0x00007ffe7d3fa000 C:\WINDOWS\system32\rsaenh.dll +0x00007ffe7da60000 - 0x00007ffe7da8b000 C:\WINDOWS\SYSTEM32\USERENV.dll +0x00007ffe7e5e0000 - 0x00007ffe7e60a000 C:\WINDOWS\SYSTEM32\bcrypt.dll +0x00007ffe7dc00000 - 0x00007ffe7dc0c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll +0x00007ffe7cea0000 - 0x00007ffe7ced4000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL +0x00007ffe81000000 - 0x00007ffe8100a000 C:\WINDOWS\System32\NSI.dll +0x00007ffe796e0000 - 0x00007ffe796ee000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\sunmscapi.dll +0x00007ffe7ead0000 - 0x00007ffe7ec47000 C:\WINDOWS\System32\CRYPT32.dll +0x00007ffe7def0000 - 0x00007ffe7df20000 C:\WINDOWS\SYSTEM32\ncrypt.dll +0x00007ffe7dea0000 - 0x00007ffe7dedf000 C:\WINDOWS\SYSTEM32\NTASN1.dll +0x00007ffe7cf40000 - 0x00007ffe7d06c000 C:\WINDOWS\SYSTEM32\DNSAPI.dll +0x00007ffe77200000 - 0x00007ffe7720b000 C:\Windows\System32\rasadhlp.dll +0x00007ffe78e30000 - 0x00007ffe78eb6000 C:\WINDOWS\System32\fwpuclnt.dll +0x00007ffe74970000 - 0x00007ffe74979000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\extnet.dll +0x00007ffe61140000 - 0x00007ffe61158000 C:\WINDOWS\system32\napinsp.dll +0x00007ffe60da0000 - 0x00007ffe60db2000 C:\WINDOWS\System32\winrnr.dll +0x00007ffe2dfc0000 - 0x00007ffe2dfe2000 C:\WINDOWS\system32\nlansp_c.dll +0x00007ffe7b520000 - 0x00007ffe7b536000 C:\WINDOWS\system32\wshbth.dll +0x00007ffe73120000 - 0x00007ffe73130000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\verify.dll +0x00007ffe66200000 - 0x00007ffe66208000 C:\WINDOWS\system32\wshunix.dll + +JVMTI agents: none + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server + +VM Arguments: +jvm_args: -XX:TieredStopAtLevel=1 +java_command: fr.codecake.airbnbclone.NbatCloneBackApplication +java_class_path (initial): C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend\target\classes;C:\Users\Mustapha\.m2\repository\org\aspectj\aspectjweaver\1.9.21\aspectjweaver-1.9.21.jar;C:\Users\Mustapha\.m2\repository\com\zaxxer\HikariCP\5.0.1\HikariCP-5.0.1.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-jdbc\6.1.5\spring-jdbc-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\orm\hibernate-core\6.4.4.Final\hibernate-core-6.4.4.Final.jar;C:\Users\Mustapha\.m2\repository\jakarta\persistence\jakarta.persistence-api\3.1.0\jakarta.persistence-api-3.1.0.jar;C:\Users\Mustapha\.m2\repository\jakarta\transaction\jakarta.transaction-api\2.0.1\jakarta.transaction-api-2.0.1.jar;C:\Users\Mustapha\.m2\repository\org\jboss\logging\jboss-logging\3.5.3.Final\jboss-logging-3.5.3.Final.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\common\hibernate-commons-annotations\6.0.6.Final\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\Mustapha\.m2\repository\io\smallrye\jandex\3.1.2\jandex-3.1.2.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\classmate\1.6.0\classmate-1.6.0.jar;C:\Users\Mustapha\.m2\repository\net\bytebuddy\byte-buddy\1.14.12\byte-buddy-1.14.12.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\jaxb-runtime\4.0.5\jaxb-runtime-4.0.5.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\jaxb-core\4.0.5\jaxb-core-4.0.5.jar;C:\Users\Mustapha\.m2\repository\org\eclipse\angus\angus-activation\2.0.2\angus-activation-2.0.2.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\txw2\4.0.5\txw2-4.0.5.jar;C:\Users\Mustapha\.m2\repository\com\sun\istack\istack-commons-runtime\4.1.2\istack-commons-runtime-4.1.2.jar;C:\Users\Mustapha\.m2\repository\jakarta\inject\jakarta.inject-api\2.0.1\jakarta.inject-api-2.0.1.jar;C:\Users\Mustapha\.m2\repository\org\antlr\antlr4-runtime\4.13.0\antlr4-runtime-4.13.0.jar;C:\Users\Mustapha\.m2\repository\org\springframework\data\spring-data-jpa\3.2.4\spring-data-jpa-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\data\spring-data-commons\3.2.4\spring-data-commons-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-orm\6.1.5\spring-orm-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-context\6.1.5\spring-context-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-tx\6.1.5\spring-tx-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-beans\6.1.5\spring-beans-6.1.5.jar;C:\Users\Mustapha\.m2\repository\jakarta\annotation\jakarta.annotation-api\2.1.1\jakarta.annotation-api-2.1.1.jar;C:\Users\Mustapha\.m2\repository\org\slf4j\slf4j-api\2.0.12\slf4j-api-2.0.12.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-aspects\6.1.5\spring-aspects-6.1.5.jar;C:\Users\Mustapha\.m2\repository\ch\qos\logback\logback-classic\1.4.14\logback-classic-1.4.14.jar;C:\Users\Mustapha\.m2\repository\ch\qos\logback\logback-core\1.4.14\logback-core-1.4.14.jar;C:\Users\Mustapha\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.21.1\log4j-to-slf4j-2.21.1.jar;C:\Users\Mustapha\.m2\repository\org\apache\logging\log4j\log4j-api\2.21.1\log4j-api-2.21.1.jar;C:\Users\Mustapha\.m2\repository\org\slf4j\jul-to-slf4j\2.0.12\jul-to-slf4j-2.0.12.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-config\6.2.3\spring-security-config-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-core\6.2.3\spring-security-core-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-crypto\6.2.3\spring-security-crypto-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-expression\6.1.5\spring-expression-6.1.5.jar;C:\Users\Mustapha\.m2\repository\io\micrometer\micrometer-observation\1.12.4\micrometer-observation-1.12.4.jar;C:\Users\Mustapha\.m2\repository\io\micrometer\micrometer-commons\1.12.4\micrometer-commons-1.12.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-client\6.2.3\spring-security-oauth2-client-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-core\6.2.3\spring-security-oauth2-core-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\oauth2-oidc-sdk\9.43.3\oauth2-oidc-sdk-9.43.3.jar;C:\Users\Mustapha\.m2\repository\com\github\stephenc\jcip\jcip-annotations\1.0-1\jcip-annotations-1.0-1.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\content-type\2.2\content-type-2.2.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\lang-tag\1.7\lang-tag-1.7.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-jose\6.2.3\spring-security-oauth2-jose-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\nimbus-jose-jwt\9.24.4\nimbus-jose-jwt-9.24.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-aop\6.1.5\spring-aop-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-web\6.2.3\spring-security-web-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\10.1.19\tomcat-embed-el-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\validator\hibernate-validator\8.0.1.Final\hibernate-validator-8.0.1.Final.jar;C:\Users\Mustapha\.m2\repository\jakarta\validation\jakarta.validation-api\3.0.2\jakarta.validation-api-3.0.2.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.15.4\jackson-datatype-jdk8-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.15.4\jackson-datatype-jsr310-2.15.4.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\10.1.19\tomcat-embed-core-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\10.1.19\tomcat-embed-websocket-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-web\6.1.5\spring-web-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-webmvc\6.1.5\spring-webmvc-6.1.5.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-boot-starter\3.0.6\okta-spring-boot-starter-3.0.6.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-security-oauth2\3.0.6\okta-spring-security-oauth2-3.0.6.jar;C:\Users\Mustapha\.m2\repository\com\okta\commons\okta-config-check\1.3.3\okta-config-check-1.3.3.jar;C:\Users\Mustapha\.m2\repository\com\okta\commons\okta-commons-lang\1.3.3\okta-commons-lang-1.3.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-resource-server\6.2.3\spring-security-oauth2-resource-server-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-sdk\3.0.6\okta-spring-sdk-3.0.6.jar;C:\Users\Mustapha\.m2\repository\org\liquibase\liquibase-core\4.24.0\liquibase-core-4.24.0.jar;C:\Users\Mustapha\.m2\repository\com\opencsv\opencsv\5.8\opencsv-5.8.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-lang3\3.13.0\commons-lang3-3.13.0.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-text\1.10.0\commons-text-1.10.0.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar;C:\Users\Mustapha\.m2\repository\org\yaml\snakeyaml\2.2\snakeyaml-2.2.jar;C:\Users\Mustapha\.m2\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;C:\Users\Mustapha\.m2\repository\org\mapstruct\mapstruct\1.5.5.Final\mapstruct-1.5.5.Final.jar;C:\Users\Mustapha\.m2\repository\com\auth0\auth0\2.10.1\auth0-2.10.1.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okhttp3\okhttp\4.12.0\okhttp-4.12.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk8\1.9.23\kotlin-stdlib-jdk8-1.9.23.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib\1.9.23\kotlin-stdlib-1.9.23.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\annotations\13.0\annotations-13.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk7\1.9.23\kotlin-stdlib-jdk7-1.9.23.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okio\okio\3.5.0\okio-3.5.0.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okio\okio-jvm\3.5.0\okio-jvm-3.5.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-common\1.9.23\kotlin-stdlib-common-1.9.23.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okhttp3\logging-interceptor\4.12.0\logging-interceptor-4.12.0.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.15.4\jackson-databind-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.15.4\jackson-annotations-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.15.4\jackson-core-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\auth0\java-jwt\4.4.0\java-jwt-4.4.0.jar;C:\Users\Mustapha\.m2\repository\net\jodah\failsafe\2.4.4\failsafe-2.4.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-devtools\3.2.4\spring-boot-devtools-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot\3.2.4\spring-boot-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\3.2.4\spring-boot-autoconfigure-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-docker-compose\3.2.4\spring-boot-docker-compose-3.2.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.15.4\jackson-module-parameter-names-2.15.4.jar;C:\Users\Mustapha\.m2\repository\org\postgresql\postgresql\42.6.2\postgresql-42.6.2.jar;C:\Users\Mustapha\.m2\repository\org\checkerframework\checker-qual\3.31.0\checker-qual-3.31.0.jar;C:\Users\Mustapha\.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\4.0.2\jakarta.xml.bind-api-4.0.2.jar;C:\Users\Mustapha\.m2\repository\jakarta\activation\jakarta.activation-api\2.1.3\jakarta.activation-api-2.1.3.jar;C:\Users\Mustapha\.m2\repository\net\minidev\json-smart\2.5.0\json-smart-2.5.0.jar;C:\Users\Mustapha\.m2\repository\net\minidev\accessors-smart\2.5.0\accessors-smart-2.5.0.jar;C:\Users\Mustapha\.m2\repository\org\ow2\asm\asm\9.3\asm-9.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-core\6.1.5\spring-core-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-jcl\6.1.5\spring-jcl-6.1.5.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 3 {product} {ergonomic} + uint G1ConcRefinementThreads = 10 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 257949696 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4112515072 {product} {ergonomic} + size_t MaxNewSize = 2466250752 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 4096 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 0 {pd product} {ergonomic} + bool ProfileInterpreter = false {pd product} {command line} + uintx ProfiledCodeHeapSize = 0 {pd product} {ergonomic} + size_t SoftMaxHeapSize = 4112515072 {manageable} {ergonomic} + intx TieredStopAtLevel = 1 {product} {command line} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Release file: +IMPLEMENTOR="Microsoft" +IMPLEMENTOR_VERSION="Microsoft-12574459" +JAVA_RUNTIME_VERSION="21.0.9+10-LTS" +JAVA_VERSION="21.0.9" +JAVA_VERSION_DATE="2025-10-21" +LIBC="default" +MODULES="java.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.jvmstat jdk.attach jdk.charsets jdk.internal.opt jdk.zipfs jdk.compiler jdk.crypto.ec jdk.crypto.cryptoki jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.hotspot.agent jdk.httpserver jdk.incubator.vector jdk.internal.le jdk.internal.vm.ci jdk.internal.vm.compiler jdk.internal.vm.compiler.management jdk.jartool jdk.javadoc jdk.jcmd jdk.management jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jlink jdk.jpackage jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.nio.mapmode jdk.random jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported jdk.unsupported.desktop jdk.xml.dom" +OS_ARCH="x86_64" +OS_NAME="Windows" +SOURCE=".:git:e0bc49609000" + +Environment Variables: +JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 +PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm;c:\Users\Mustapha\.vscode\extensions\vscjava.vscode-java-debug-0.58.5\bundled\scripts\noConfigScripts +USERNAME=Mustapha +LANG=en_US.UTF-8 +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD +TMP=C:\Users\Mustapha\AppData\Local\Temp +TEMP=C:\Users\Mustapha\AppData\Local\Temp + + + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +OS uptime: 0 days 5:03 hours +Hyper-V role detected + +CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss +Processor Information for the first 12 processors : + Max Mhz: 2301, Current Mhz: 1913, Mhz Limit: 2301 + +Memory: 4k page, system-wide physical 15681M (5332M free) +TotalPageFile size 23873M (AvailPageFile size 85M) +current process WorkingSet (physical memory assigned to process): 335M, peak: 405M +current process commit charge ("private bytes"): 412M, peak: 638M + +vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-13T22:04:36Z by "MicrosoftCorporation" with unknown MS VC++:1944 + +END. diff --git a/hs_err_pid3656.log b/hs_err_pid3656.log new file mode 100644 index 0000000..adddb16 --- /dev/null +++ b/hs_err_pid3656.log @@ -0,0 +1,244 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (mmap) failed to map 257949696 bytes. Error detail: G1 virtual space +# Possible reasons: +# The system is out of physical RAM or swap space +# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Zero Based Compressed Oops mode in which the Java heap is +# placed in the first 32GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 32GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (os_windows.cpp:3716), pid=3656, tid=6248 +# +# JRE version: (21.0.9+10) (build ) +# Java VM: OpenJDK 64-Bit Server VM (21.0.9+10-LTS, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: -XX:TieredStopAtLevel=1 fr.codecake.airbnbclone.NbatCloneBackApplication + +Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +Time: Wed Jan 28 10:43:58 2026 Morocco Daylight Time elapsed time: 1.195295 seconds (0d 0h 0m 1s) + +--------------- T H R E A D --------------- + +Current thread (0x000001be65a2b890): JavaThread "Unknown thread" [_thread_in_vm, id=6248, stack(0x0000001161f00000,0x0000001162000000) (1024K)] + +Stack: [0x0000001161f00000,0x0000001162000000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6df259] (no source info available) +V [jvm.dll+0x8bfe4b] (no source info available) +V [jvm.dll+0x8c23da] (no source info available) +V [jvm.dll+0x8c2ab3] (no source info available) +V [jvm.dll+0x28a416] (no source info available) +V [jvm.dll+0x6de705] (no source info available) +V [jvm.dll+0x6d264a] (no source info available) +V [jvm.dll+0x36742e] (no source info available) +V [jvm.dll+0x36f2fb] (no source info available) +V [jvm.dll+0x3c0c99] (no source info available) +V [jvm.dll+0x3c0f3b] (no source info available) +V [jvm.dll+0x33ace7] (no source info available) +V [jvm.dll+0x33b82b] (no source info available) +V [jvm.dll+0x88976e] (no source info available) +V [jvm.dll+0x3cdbf1] (no source info available) +V [jvm.dll+0x87267c] (no source info available) +V [jvm.dll+0x461751] (no source info available) +V [jvm.dll+0x463391] (no source info available) +C [jli.dll+0x52f0] (no source info available) +C [ucrtbase.dll+0x37b0] (no source info available) +C [KERNEL32.DLL+0x2e8d7] (no source info available) +C [ntdll.dll+0x8c53c] (no source info available) + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00007ffb364c7288, length=0, elements={ +} + +Java Threads: ( => current thread ) +Total: 0 + +Other Threads: + 0x000001be65a8e0f0 WorkerThread "GC Thread#0" [id=3160, stack(0x0000001162000000,0x0000001162100000) (1024K)] + 0x000001be65aa0650 ConcurrentGCThread "G1 Main Marker" [id=3204, stack(0x0000001162100000,0x0000001162200000) (1024K)] + 0x000001be65aa1d70 WorkerThread "G1 Conc#0" [id=16088, stack(0x0000001162200000,0x0000001162300000) (1024K)] + +[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffb35bbd7a7] +VM state: not at safepoint (not fully initialized) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00007ffb3653b9b0] Heap_lock - owner thread: 0x000001be65a2b890 + +Heap address: 0x000000070ae00000, size: 3922 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. +Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + +Heap: + garbage-first heap total 0K, used 0K [0x000000070ae00000, 0x0000000800000000) + region size 2048K, 0 young (0K), 0 survivors (0K) + +[error occurred during error reporting (printing heap information), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffb35fac219] +GC Heap History (0 events): +No events + +Dll operation events (1 events): +Event: 0.025 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll + +Deoptimization events (0 events): +No events + +Classes loaded (0 events): +No events + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (0 events): +No events + +ZGC Phase Switch (0 events): +No events + +VM Operations (0 events): +No events + +Memory protections (0 events): +No events + +Nmethod flushes (0 events): +No events + +Events (0 events): +No events + + +Dynamic libraries: +0x00007ff612cd0000 - 0x00007ff612cde000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.exe +0x00007ffbe2be0000 - 0x00007ffbe2e47000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ffbe17e0000 - 0x00007ffbe18a9000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ffbe0170000 - 0x00007ffbe055f000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ffbe05a0000 - 0x00007ffbe06eb000 C:\WINDOWS\System32\ucrtbase.dll +0x00007ffbdca30000 - 0x00007ffbdca48000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jli.dll +0x00007ffbd5640000 - 0x00007ffbd565e000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\VCRUNTIME140.dll +0x00007ffbe14d0000 - 0x00007ffbe1695000 C:\WINDOWS\System32\USER32.dll +0x00007ffbe0570000 - 0x00007ffbe0597000 C:\WINDOWS\System32\win32u.dll +0x00007ffbe1370000 - 0x00007ffbe139b000 C:\WINDOWS\System32\GDI32.dll +0x00007ffbbd980000 - 0x00007ffbbdc13000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll +0x00007ffbe06f0000 - 0x00007ffbe081c000 C:\WINDOWS\System32\gdi32full.dll +0x00007ffbe1420000 - 0x00007ffbe14c9000 C:\WINDOWS\System32\msvcrt.dll +0x00007ffbe0820000 - 0x00007ffbe08c3000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ffbe16a0000 - 0x00007ffbe16d1000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffbdac80000 - 0x00007ffbdac8c000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\vcruntime140_1.dll +0x00007ffbc7490000 - 0x00007ffbc7519000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\msvcp140.dll +0x00007ffb35870000 - 0x00007ffb3661d000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server\jvm.dll +0x00007ffbe19f0000 - 0x00007ffbe1aa4000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ffbe1940000 - 0x00007ffbe19e6000 C:\WINDOWS\System32\sechost.dll +0x00007ffbe1150000 - 0x00007ffbe1268000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffbe13a0000 - 0x00007ffbe1414000 C:\WINDOWS\System32\WS2_32.dll +0x00007ffbdfb90000 - 0x00007ffbdfbee000 C:\WINDOWS\SYSTEM32\POWRPROF.dll +0x00007ffbd8940000 - 0x00007ffbd8975000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ffbd8980000 - 0x00007ffbd898b000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007ffbdfb70000 - 0x00007ffbdfb84000 C:\WINDOWS\SYSTEM32\UMPDC.dll +0x00007ffbdeaa0000 - 0x00007ffbdeabb000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffbd5720000 - 0x00007ffbd572a000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jimage.dll +0x00007ffbd1710000 - 0x00007ffbd1952000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ffbe2690000 - 0x00007ffbe2a16000 C:\WINDOWS\System32\combase.dll +0x00007ffbe0fc0000 - 0x00007ffbe1096000 C:\WINDOWS\System32\OLEAUT32.dll +0x00007ffbc4b30000 - 0x00007ffbc4b6c000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ffbe08d0000 - 0x00007ffbe0975000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007ffbd38c0000 - 0x00007ffbd38e1000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll + +JVMTI agents: none + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server + +VM Arguments: +jvm_args: -XX:TieredStopAtLevel=1 +java_command: fr.codecake.airbnbclone.NbatCloneBackApplication +java_class_path (initial): C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend\target\classes;C:\Users\Mustapha\.m2\repository\org\aspectj\aspectjweaver\1.9.21\aspectjweaver-1.9.21.jar;C:\Users\Mustapha\.m2\repository\com\zaxxer\HikariCP\5.0.1\HikariCP-5.0.1.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-jdbc\6.1.5\spring-jdbc-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\orm\hibernate-core\6.4.4.Final\hibernate-core-6.4.4.Final.jar;C:\Users\Mustapha\.m2\repository\jakarta\persistence\jakarta.persistence-api\3.1.0\jakarta.persistence-api-3.1.0.jar;C:\Users\Mustapha\.m2\repository\jakarta\transaction\jakarta.transaction-api\2.0.1\jakarta.transaction-api-2.0.1.jar;C:\Users\Mustapha\.m2\repository\org\jboss\logging\jboss-logging\3.5.3.Final\jboss-logging-3.5.3.Final.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\common\hibernate-commons-annotations\6.0.6.Final\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\Mustapha\.m2\repository\io\smallrye\jandex\3.1.2\jandex-3.1.2.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\classmate\1.6.0\classmate-1.6.0.jar;C:\Users\Mustapha\.m2\repository\net\bytebuddy\byte-buddy\1.14.12\byte-buddy-1.14.12.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\jaxb-runtime\4.0.5\jaxb-runtime-4.0.5.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\jaxb-core\4.0.5\jaxb-core-4.0.5.jar;C:\Users\Mustapha\.m2\repository\org\eclipse\angus\angus-activation\2.0.2\angus-activation-2.0.2.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\txw2\4.0.5\txw2-4.0.5.jar;C:\Users\Mustapha\.m2\repository\com\sun\istack\istack-commons-runtime\4.1.2\istack-commons-runtime-4.1.2.jar;C:\Users\Mustapha\.m2\repository\jakarta\inject\jakarta.inject-api\2.0.1\jakarta.inject-api-2.0.1.jar;C:\Users\Mustapha\.m2\repository\org\antlr\antlr4-runtime\4.13.0\antlr4-runtime-4.13.0.jar;C:\Users\Mustapha\.m2\repository\org\springframework\data\spring-data-jpa\3.2.4\spring-data-jpa-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\data\spring-data-commons\3.2.4\spring-data-commons-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-orm\6.1.5\spring-orm-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-context\6.1.5\spring-context-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-tx\6.1.5\spring-tx-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-beans\6.1.5\spring-beans-6.1.5.jar;C:\Users\Mustapha\.m2\repository\jakarta\annotation\jakarta.annotation-api\2.1.1\jakarta.annotation-api-2.1.1.jar;C:\Users\Mustapha\.m2\repository\org\slf4j\slf4j-api\2.0.12\slf4j-api-2.0.12.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-aspects\6.1.5\spring-aspects-6.1.5.jar;C:\Users\Mustapha\.m2\repository\ch\qos\logback\logback-classic\1.4.14\logback-classic-1.4.14.jar;C:\Users\Mustapha\.m2\repository\ch\qos\logback\logback-core\1.4.14\logback-core-1.4.14.jar;C:\Users\Mustapha\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.21.1\log4j-to-slf4j-2.21.1.jar;C:\Users\Mustapha\.m2\repository\org\apache\logging\log4j\log4j-api\2.21.1\log4j-api-2.21.1.jar;C:\Users\Mustapha\.m2\repository\org\slf4j\jul-to-slf4j\2.0.12\jul-to-slf4j-2.0.12.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-config\6.2.3\spring-security-config-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-core\6.2.3\spring-security-core-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-crypto\6.2.3\spring-security-crypto-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-expression\6.1.5\spring-expression-6.1.5.jar;C:\Users\Mustapha\.m2\repository\io\micrometer\micrometer-observation\1.12.4\micrometer-observation-1.12.4.jar;C:\Users\Mustapha\.m2\repository\io\micrometer\micrometer-commons\1.12.4\micrometer-commons-1.12.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-client\6.2.3\spring-security-oauth2-client-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-core\6.2.3\spring-security-oauth2-core-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\oauth2-oidc-sdk\9.43.3\oauth2-oidc-sdk-9.43.3.jar;C:\Users\Mustapha\.m2\repository\com\github\stephenc\jcip\jcip-annotations\1.0-1\jcip-annotations-1.0-1.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\content-type\2.2\content-type-2.2.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\lang-tag\1.7\lang-tag-1.7.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-jose\6.2.3\spring-security-oauth2-jose-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\nimbus-jose-jwt\9.24.4\nimbus-jose-jwt-9.24.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-aop\6.1.5\spring-aop-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-web\6.2.3\spring-security-web-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\10.1.19\tomcat-embed-el-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\validator\hibernate-validator\8.0.1.Final\hibernate-validator-8.0.1.Final.jar;C:\Users\Mustapha\.m2\repository\jakarta\validation\jakarta.validation-api\3.0.2\jakarta.validation-api-3.0.2.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.15.4\jackson-datatype-jdk8-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.15.4\jackson-datatype-jsr310-2.15.4.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\10.1.19\tomcat-embed-core-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\10.1.19\tomcat-embed-websocket-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-web\6.1.5\spring-web-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-webmvc\6.1.5\spring-webmvc-6.1.5.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-boot-starter\3.0.6\okta-spring-boot-starter-3.0.6.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-security-oauth2\3.0.6\okta-spring-security-oauth2-3.0.6.jar;C:\Users\Mustapha\.m2\repository\com\okta\commons\okta-config-check\1.3.3\okta-config-check-1.3.3.jar;C:\Users\Mustapha\.m2\repository\com\okta\commons\okta-commons-lang\1.3.3\okta-commons-lang-1.3.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-resource-server\6.2.3\spring-security-oauth2-resource-server-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-sdk\3.0.6\okta-spring-sdk-3.0.6.jar;C:\Users\Mustapha\.m2\repository\org\liquibase\liquibase-core\4.24.0\liquibase-core-4.24.0.jar;C:\Users\Mustapha\.m2\repository\com\opencsv\opencsv\5.8\opencsv-5.8.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-lang3\3.13.0\commons-lang3-3.13.0.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-text\1.10.0\commons-text-1.10.0.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar;C:\Users\Mustapha\.m2\repository\org\yaml\snakeyaml\2.2\snakeyaml-2.2.jar;C:\Users\Mustapha\.m2\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;C:\Users\Mustapha\.m2\repository\org\mapstruct\mapstruct\1.5.5.Final\mapstruct-1.5.5.Final.jar;C:\Users\Mustapha\.m2\repository\com\auth0\auth0\2.10.1\auth0-2.10.1.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okhttp3\okhttp\4.12.0\okhttp-4.12.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk8\1.9.23\kotlin-stdlib-jdk8-1.9.23.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib\1.9.23\kotlin-stdlib-1.9.23.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\annotations\13.0\annotations-13.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk7\1.9.23\kotlin-stdlib-jdk7-1.9.23.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okio\okio\3.5.0\okio-3.5.0.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okio\okio-jvm\3.5.0\okio-jvm-3.5.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-common\1.9.23\kotlin-stdlib-common-1.9.23.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okhttp3\logging-interceptor\4.12.0\logging-interceptor-4.12.0.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.15.4\jackson-databind-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.15.4\jackson-annotations-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.15.4\jackson-core-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\auth0\java-jwt\4.4.0\java-jwt-4.4.0.jar;C:\Users\Mustapha\.m2\repository\net\jodah\failsafe\2.4.4\failsafe-2.4.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-devtools\3.2.4\spring-boot-devtools-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot\3.2.4\spring-boot-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\3.2.4\spring-boot-autoconfigure-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-docker-compose\3.2.4\spring-boot-docker-compose-3.2.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.15.4\jackson-module-parameter-names-2.15.4.jar;C:\Users\Mustapha\.m2\repository\org\postgresql\postgresql\42.6.2\postgresql-42.6.2.jar;C:\Users\Mustapha\.m2\repository\org\checkerframework\checker-qual\3.31.0\checker-qual-3.31.0.jar;C:\Users\Mustapha\.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\4.0.2\jakarta.xml.bind-api-4.0.2.jar;C:\Users\Mustapha\.m2\repository\jakarta\activation\jakarta.activation-api\2.1.3\jakarta.activation-api-2.1.3.jar;C:\Users\Mustapha\.m2\repository\net\minidev\json-smart\2.5.0\json-smart-2.5.0.jar;C:\Users\Mustapha\.m2\repository\net\minidev\accessors-smart\2.5.0\accessors-smart-2.5.0.jar;C:\Users\Mustapha\.m2\repository\org\ow2\asm\asm\9.3\asm-9.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-core\6.1.5\spring-core-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-jcl\6.1.5\spring-jcl-6.1.5.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 4 {product} {ergonomic} + uint ConcGCThreads = 3 {product} {ergonomic} + uint G1ConcRefinementThreads = 10 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 257949696 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 4112515072 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 4096 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 0 {pd product} {ergonomic} + bool ProfileInterpreter = false {pd product} {command line} + uintx ProfiledCodeHeapSize = 0 {pd product} {ergonomic} + size_t SoftMaxHeapSize = 4112515072 {manageable} {ergonomic} + intx TieredStopAtLevel = 1 {product} {command line} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Release file: + +Environment Variables: +JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 +PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm;c:\Users\Mustapha\.vscode\extensions\vscjava.vscode-java-debug-0.58.5\bundled\scripts\noConfigScripts +USERNAME=Mustapha +LANG=en_US.UTF-8 +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD +TMP=C:\Users\Mustapha\AppData\Local\Temp +TEMP=C:\Users\Mustapha\AppData\Local\Temp + + + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +OS uptime: 0 days 1:36 hours +Hyper-V role detected + +CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss +Processor Information for the first 12 processors : + Max Mhz: 2301, Current Mhz: 1990, Mhz Limit: 2301 + +Memory: 4k page, system-wide physical 15681M (7562M free) +TotalPageFile size 23873M (AvailPageFile size 201M) +current process WorkingSet (physical memory assigned to process): 12M, peak: 12M +current process commit charge ("private bytes"): 59M, peak: 305M + +vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-13T22:04:36Z by "MicrosoftCorporation" with unknown MS VC++:1944 + +END. diff --git a/hs_err_pid4644.log b/hs_err_pid4644.log new file mode 100644 index 0000000..5c8f42e --- /dev/null +++ b/hs_err_pid4644.log @@ -0,0 +1,328 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (malloc) failed to allocate 1048576 bytes. Error detail: AllocateHeap +# Possible reasons: +# The system is out of physical RAM or swap space +# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Unscaled Compressed Oops mode in which the Java heap is +# placed in the first 4GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 4GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (allocation.cpp:44), pid=4644, tid=17564 +# +# JRE version: (21.0.9+10) (build ) +# Java VM: OpenJDK 64-Bit Server VM (21.0.9+10-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, parallel gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: --add-modules=ALL-SYSTEM --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -javaagent:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java -Daether.dependencyCollector.impl=bf c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -configuration c:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win -data c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java\jdt_ws --pipe=\\.\pipe\lsp-301b0667ee99336b0b4fd8eba72a3d13-sock + +Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +Time: Tue Jan 27 23:16:22 2026 Morocco Daylight Time elapsed time: 0.108161 seconds (0d 0h 0m 0s) + +--------------- T H R E A D --------------- + +Current thread (0x00000206ed99dc50): JavaThread "Unknown thread" [_thread_in_vm, id=17564, stack(0x0000003d14b00000,0x0000003d14c00000) (1024K)] + +Stack: [0x0000003d14b00000,0x0000003d14c00000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6d6e29] +V [jvm.dll+0x8b4b76] +V [jvm.dll+0x8b712e] +V [jvm.dll+0x8b7813] +V [jvm.dll+0x283d86] +V [jvm.dll+0xc1277] +V [jvm.dll+0x71457d] +V [jvm.dll+0x714c3c] +V [jvm.dll+0x6e59c8] +V [jvm.dll+0x87e58c] +V [jvm.dll+0x3c42fc] +V [jvm.dll+0x86727b] +V [jvm.dll+0x457391] +V [jvm.dll+0x458f81] +C [jli.dll+0x52d0] +C [ucrtbase.dll+0x37b0] +C [KERNEL32.DLL+0x2e8d7] +C [ntdll.dll+0x8c53c] + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00000206eda0a050, length=1, elements={ +0x00000206ed99dc50 +} + +Java Threads: ( => current thread ) +=>0x00000206ed99dc50 JavaThread "Unknown thread" [_thread_in_vm, id=17564, stack(0x0000003d14b00000,0x0000003d14c00000) (1024K)] +Total: 1 + +Other Threads: + 0x00000206844dcb20 WatcherThread "VM Periodic Task Thread" [id=13288, stack(0x0000003d14d00000,0x0000003d14e00000) (1024K)] + 0x00000206ed9bbe20 WorkerThread "GC Thread#0" [id=20208, stack(0x0000003d14c00000,0x0000003d14d00000) (1024K)] +Total: 2 + +Threads with active compile tasks: +Total: 0 + +VM state: not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: None + +Heap address: 0x0000000080000000, size: 2048 MB, Compressed Oops mode: 32-bit + +CDS archive(s) mapped at: [0x0000020685000000-0x0000020685ba0000-0x0000020685ba0000), size 12189696, SharedBaseAddress: 0x0000020685000000, ArchiveRelocationMode: 1. +Compressed class space mapped at: 0x0000020686000000-0x00000206c6000000, reserved size: 1073741824 +Narrow klass base: 0x0000020685000000, Narrow klass shift: 0, Narrow klass range: 0x100000000 + +GC Precious Log: + CardTable entry size: 512 + CPUs: 12 total, 12 available + Memory: 15681M + Large Page Support: Disabled + NUMA Support: Disabled + Compressed Oops: Enabled (32-bit) + Alignments: Space 512K, Generation 512K, Heap 2M + Heap Min Capacity: 100M + Heap Initial Capacity: 100M + Heap Max Capacity: 2G + Pre-touch: Disabled + Parallel Workers: 10 + +Heap: + PSYoungGen total 29696K, used 512K [0x00000000d5580000, 0x00000000d7680000, 0x0000000100000000) + eden space 25600K, 2% used [0x00000000d5580000,0x00000000d5600020,0x00000000d6e80000) + from space 4096K, 0% used [0x00000000d7280000,0x00000000d7280000,0x00000000d7680000) + to space 4096K, 0% used [0x00000000d6e80000,0x00000000d6e80000,0x00000000d7280000) + ParOldGen total 68608K, used 0K [0x0000000080000000, 0x0000000084300000, 0x00000000d5580000) + object space 68608K, 0% used [0x0000000080000000,0x0000000080000000,0x0000000084300000) + Metaspace used 0K, committed 0K, reserved 1048576K + class space used 0K, committed 0K, reserved 1048576K + +Card table byte_map: [0x00000206ed340000,0x00000206ed750000] _byte_map_base: 0x00000206ecf40000 + +Marking Bits: (ParMarkBitMap*) 0x00007ffc71d92460 + Begin Bits: [0x0000020680000000, 0x0000020682000000) + End Bits: [0x0000020682000000, 0x0000020684000000) + +Polling page: 0x00000206eb800000 + +Metaspace: + +Usage: + Non-class: 0 bytes used. + Class: 0 bytes used. + Both: 0 bytes used. + +Virtual space: + Non-class space: 0 bytes reserved, 0 bytes ( ?%) committed, 0 nodes. + Class space: 1.00 GB reserved, 0 bytes ( 0%) committed, 1 nodes. + Both: 1.00 GB reserved, 0 bytes ( 0%) committed. + +Chunk freelists: + Non-Class: 0 bytes + Class: 16.00 MB + Both: 16.00 MB + +MaxMetaspaceSize: unlimited +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 21.00 MB +Current GC threshold: 17179869184.00 GB +CDS: on + - commit_granule_bytes: 65536. + - commit_granule_words: 8192. + - virtual_space_node_default_size: 8388608. + - enlarge_chunks_in_place: 1. + - use_allocation_guard: 0. + + +Internal statistics: + +num_allocs_failed_limit: 0. +num_arena_births: 0. +num_arena_deaths: 0. +num_vsnodes_births: 1. +num_vsnodes_deaths: 0. +num_space_committed: 0. +num_space_uncommitted: 0. +num_chunks_returned_to_freelist: 0. +num_chunks_taken_from_freelist: 1. +num_chunk_merges: 0. +num_chunk_splits: 1. +num_chunks_enlarged: 0. +num_inconsistent_stats: 0. + +CodeHeap 'non-profiled nmethods': size=120000Kb used=0Kb max_used=0Kb free=120000Kb + bounds [0x00000206f8670000, 0x00000206f88e0000, 0x00000206ffba0000] +CodeHeap 'profiled nmethods': size=120000Kb used=0Kb max_used=0Kb free=120000Kb + bounds [0x00000206f0ba0000, 0x00000206f0e10000, 0x00000206f80d0000] +CodeHeap 'non-nmethods': size=5760Kb used=194Kb max_used=342Kb free=5565Kb + bounds [0x00000206f80d0000, 0x00000206f8340000, 0x00000206f8670000] +CodeCache: size=245760Kb, used=194Kb, max_used=342Kb, free=245565Kb + total_blobs=70, nmethods=0, adapters=48, full_count=0 +Compilation: enabled, stopped_count=0, restarted_count=0 + +Compilation events (0 events): +No events + +GC Heap History (0 events): +No events + +Dll operation events (1 events): +Event: 0.021 Loaded shared library c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.dll + +Deoptimization events (0 events): +No events + +Classes loaded (0 events): +No events + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (0 events): +No events + +ZGC Phase Switch (0 events): +No events + +VM Operations (0 events): +No events + +Memory protections (0 events): +No events + +Nmethod flushes (0 events): +No events + +Events (1 events): +Event: 0.043 Thread 0x00000206ed99dc50 Thread added: 0x00000206ed99dc50 + + +Dynamic libraries: +0x00007ff6d7220000 - 0x00007ff6d722e000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.exe +0x00007ffd14000000 - 0x00007ffd14267000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ffd13130000 - 0x00007ffd131f9000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ffd11820000 - 0x00007ffd11c0f000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ffd11c50000 - 0x00007ffd11d9b000 C:\WINDOWS\System32\ucrtbase.dll +0x00007ffcf6520000 - 0x00007ffcf653e000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\VCRUNTIME140.dll +0x00007ffd07170000 - 0x00007ffd07188000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jli.dll +0x00007ffd12500000 - 0x00007ffd126c5000 C:\WINDOWS\System32\USER32.dll +0x00007ffd11c20000 - 0x00007ffd11c47000 C:\WINDOWS\System32\win32u.dll +0x00007ffcebfd0000 - 0x00007ffcec263000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll +0x00007ffd13be0000 - 0x00007ffd13c0b000 C:\WINDOWS\System32\GDI32.dll +0x00007ffd13b20000 - 0x00007ffd13bc9000 C:\WINDOWS\System32\msvcrt.dll +0x00007ffd11200000 - 0x00007ffd1132c000 C:\WINDOWS\System32\gdi32full.dll +0x00007ffd11480000 - 0x00007ffd11523000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ffd13ae0000 - 0x00007ffd13b11000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffcfac30000 - 0x00007ffcfac3c000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\vcruntime140_1.dll +0x00007ffcf52e0000 - 0x00007ffcf536d000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\msvcp140.dll +0x00007ffc710d0000 - 0x00007ffc71e70000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\server\jvm.dll +0x00007ffd12bc0000 - 0x00007ffd12c74000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ffd12a10000 - 0x00007ffd12ab6000 C:\WINDOWS\System32\sechost.dll +0x00007ffd139c0000 - 0x00007ffd13ad8000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffd13c90000 - 0x00007ffd13d04000 C:\WINDOWS\System32\WS2_32.dll +0x00007ffd10fb0000 - 0x00007ffd1100e000 C:\WINDOWS\SYSTEM32\POWRPROF.dll +0x00007ffd0aa50000 - 0x00007ffd0aa5b000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007ffd0aa10000 - 0x00007ffd0aa45000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ffd10f90000 - 0x00007ffd10fa4000 C:\WINDOWS\SYSTEM32\UMPDC.dll +0x00007ffd0fec0000 - 0x00007ffd0fedb000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffcf9670000 - 0x00007ffcf967a000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jimage.dll +0x00007ffd04120000 - 0x00007ffd04362000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ffd13600000 - 0x00007ffd13986000 C:\WINDOWS\System32\combase.dll +0x00007ffd126d0000 - 0x00007ffd127a6000 C:\WINDOWS\System32\OLEAUT32.dll +0x00007ffcf6ec0000 - 0x00007ffcf6efc000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ffd11150000 - 0x00007ffd111f5000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007ffcf8ba0000 - 0x00007ffcf8baf000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\instrument.dll +0x00007ffcf3990000 - 0x00007ffcf39b0000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.dll + +JVMTI agents: +c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar path:none, loaded, not initialized, instrumentlib options:none + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\server + +VM Arguments: +jvm_args: --add-modules=ALL-SYSTEM --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -javaagent:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java -Daether.dependencyCollector.impl=bf +java_command: c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -configuration c:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win -data c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java\jdt_ws --pipe=\\.\pipe\lsp-301b0667ee99336b0b4fd8eba72a3d13-sock +java_class_path (initial): c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar +Launcher Type: SUN_STANDARD + +[Global flags] + uintx AdaptiveSizePolicyWeight = 90 {product} {command line} + intx CICompilerCount = 4 {product} {ergonomic} + uintx GCTimeRatio = 4 {product} {command line} + bool HeapDumpOnOutOfMemoryError = true {manageable} {command line} + ccstr HeapDumpPath = c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java {manageable} {command line} + size_t InitialHeapSize = 104857600 {product} {command line} + size_t MaxHeapSize = 2147483648 {product} {command line} + size_t MaxNewSize = 715653120 {product} {ergonomic} + size_t MinHeapDeltaBytes = 524288 {product} {ergonomic} + size_t MinHeapSize = 104857600 {product} {command line} + size_t NewSize = 34603008 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5839372 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + size_t OldSize = 70254592 {product} {ergonomic} + uintx ProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 2147483648 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + bool UseParallelGC = true {product} {command line} + +Logging: +Log output configuration: + #0: stdout all=off uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Release file: + +Environment Variables: +JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 +PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm +USERNAME=Mustapha +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD +TMP=C:\Users\Mustapha\AppData\Local\Temp +TEMP=C:\Users\Mustapha\AppData\Local\Temp + + + + +Periodic native trim disabled + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 26100 (10.0.26100.7623) +OS uptime: 0 days 1:07 hours +Hyper-V role detected + +CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss +Processor Information for the first 12 processors : + Max Mhz: 2301, Current Mhz: 1990, Mhz Limit: 2301 + +Memory: 4k page, system-wide physical 15681M (5955M free) +TotalPageFile size 23873M (AvailPageFile size 2M) +current process WorkingSet (physical memory assigned to process): 26M, peak: 26M +current process commit charge ("private bytes"): 218M, peak: 219M + +vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-21T00:00:00Z by "admin" with unknown MS VC++:1942 + +END. diff --git a/init.sql b/init.sql new file mode 100644 index 0000000..dec10d4 --- /dev/null +++ b/init.sql @@ -0,0 +1 @@ +CREATE SCHEMA IF NOT EXISTS nbat_schema; \ No newline at end of file diff --git a/src/main/java/fr/codecake/airbnbclone/user/application/Auth0Service.java b/src/main/java/fr/codecake/airbnbclone/user/application/Auth0Service.java index 8f7d2dc..60383bb 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/application/Auth0Service.java +++ b/src/main/java/fr/codecake/airbnbclone/user/application/Auth0Service.java @@ -3,6 +3,7 @@ import com.auth0.client.auth.AuthAPI; import com.auth0.client.mgmt.ManagementAPI; import com.auth0.client.mgmt.filter.FieldsFilter; +import com.auth0.exception.APIException; import com.auth0.exception.Auth0Exception; import com.auth0.json.auth.TokenHolder; import com.auth0.json.mgmt.users.User; @@ -28,34 +29,43 @@ public class Auth0Service { @Value("${okta.oauth2.issuer}") private String domain; + @Value("${application.auth0.management-client-id}") + private String managementClientId; + + @Value("${application.auth0.management-client-secret}") + private String managementClientSecret; + @Value("${application.auth0.role-landlord-id}") private String roleLandlordId; - public void addLandlordRoleToUser(ReadUserDTO readUserDTO) { + public void addLandlordRoleToUser(ReadUserDTO readUserDTO, String auth0UserId) { if (readUserDTO.authorities().stream().noneMatch(role -> role.equals(SecurityUtils.ROLE_LANDLORD))) { try { String accessToken = this.getAccessToken(); - assignRoleById(accessToken, readUserDTO.email(), readUserDTO.publicId(), roleLandlordId); + assignRoleById(accessToken, auth0UserId, roleLandlordId); } catch (Auth0Exception a) { - throw new UserException(String.format("not possible to assign %s to %s", roleLandlordId, readUserDTO.publicId())); + throw new UserException( + String.format("not possible to assign %s to %s", roleLandlordId, readUserDTO.publicId())); } } } - private void assignRoleById(String accessToken, String email, UUID publicId, String roleIdToAdd) throws Auth0Exception { - ManagementAPI mgmt = ManagementAPI.newBuilder(domain, accessToken).build(); - Response> auth0userByEmail = mgmt.users().listByEmail(email, new FieldsFilter()).execute(); - User user = auth0userByEmail.getBody() - .stream().findFirst() - .orElseThrow(() -> new UserException(String.format("Cannot find user with public id %s", publicId))); - mgmt.roles().assignUsers(roleIdToAdd, List.of(user.getId())).execute(); + private void assignRoleById(String accessToken, String auth0UserId, String roleIdToAdd) { + try { + ManagementAPI mgmt = ManagementAPI.newBuilder(domain, accessToken).build(); + mgmt.roles().assignUsers(roleIdToAdd, List.of(auth0UserId)).execute(); + } catch (APIException e) { + System.out.println("request was executed but the response wasn't successful"); + } catch (Auth0Exception e) { + System.out.println("request couldn't be created or executed successfully"); + } } private String getAccessToken() throws Auth0Exception { - AuthAPI authAPI = AuthAPI.newBuilder(domain, clientId, clientSecret).build(); + AuthAPI authAPI = AuthAPI.newBuilder(domain, managementClientId, managementClientSecret).build(); TokenRequest tokenRequest = authAPI.requestToken(domain + "api/v2/"); TokenHolder holder = tokenRequest.execute().getBody(); return holder.getAccessToken(); } -} +} \ No newline at end of file diff --git a/src/main/java/fr/codecake/airbnbclone/user/presentation/AuthResource.java b/src/main/java/fr/codecake/airbnbclone/user/presentation/AuthResource.java index 518f52d..cde7f56 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/presentation/AuthResource.java +++ b/src/main/java/fr/codecake/airbnbclone/user/presentation/AuthResource.java @@ -1,5 +1,6 @@ package fr.codecake.airbnbclone.user.presentation; +import fr.codecake.airbnbclone.user.application.Auth0Service; import fr.codecake.airbnbclone.user.application.UserService; import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; import jakarta.servlet.http.HttpServletRequest; @@ -23,15 +24,18 @@ public class AuthResource { private final ClientRegistration registration; - public AuthResource(UserService userService, ClientRegistrationRepository registration) { + private final Auth0Service auth0Service; + + public AuthResource(UserService userService, ClientRegistrationRepository registration, Auth0Service auth0Service) { this.userService = userService; this.registration = registration.findByRegistrationId("okta"); + this.auth0Service = auth0Service; } @GetMapping("/get-authenticated-user") public ResponseEntity getAuthenticatedUser( @AuthenticationPrincipal OAuth2User user, @RequestParam boolean forceResync) { - if(user == null) { + if (user == null) { return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } else { userService.syncWithIdp(user, forceResync); @@ -40,11 +44,33 @@ public ResponseEntity getAuthenticatedUser( } } + @PostMapping("/assign-landlord-role") + public ResponseEntity assignLandlordRole( + @AuthenticationPrincipal OAuth2User user) { + + String auth0UserId = user.getAttribute("sub"); + System.out.println(auth0UserId); + ReadUserDTO userDto = userService.getAuthenticatedUserFromSecurityContext(); + + // Check if already has landlord role + if (userDto.authorities().contains("ROLE_LANDLORD")) { + return ResponseEntity.badRequest().body("User already has landlord role"); + } + + // add landlord role via Auth0Service + auth0Service.addLandlordRoleToUser(userDto, auth0UserId); // updates Auth0's database + + // force resync to update database + userService.syncWithIdp(user, true); // fetches fresh data from Auth0 and updates YOUR database + + return ResponseEntity.ok("Landlord role assigned successfully"); + } + @PostMapping("/logout") public ResponseEntity> logout(HttpServletRequest request) { String issuerUri = registration.getProviderDetails().getIssuerUri(); String originUrl = request.getHeader(HttpHeaders.ORIGIN); - Object[] params = {issuerUri, registration.getClientId(), originUrl}; + Object[] params = { issuerUri, registration.getClientId(), originUrl }; String logoutUrl = MessageFormat.format("{0}v2/logout?client_id={1}&returnTo={2}", params); request.getSession().invalidate(); return ResponseEntity.ok().body(Map.of("logoutUrl", logoutUrl)); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index fb97b33..dd531c7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,7 +1,7 @@ logging: level: ROOT: INFO - '[org.hibernate.SQL]': DEBUG + "[org.hibernate.SQL]": DEBUG "[mr.imane.nbatcloneback]": DEBUG spring: @@ -40,11 +40,13 @@ server: port: 8080 okta: - oauth2: - issuer: https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ - client-id: WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg - client-secret: Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw -application: - auth0: - role-landlord-id: "rol_rSyLRkZ1gsnawxY4" + oauth2: + issuer: https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ + client-id: WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg + client-secret: Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw +application: + auth0: + management-client-id: nvO5Zh1avQFtJzBGPMmih2W0cvSFU9LZ + management-client-secret: E9gQ6zbcJ3iTA_qBg_W1QD0SMNrnqatggK4lS0YRYz_7njfSxqJSZAAjL0rII8Nc + role-landlord-id: rol_rSyLRkZ1gsnawxY4 diff --git a/src/main/resources/db/changelog/00000000000002_listing.xml b/src/main/resources/db/changelog/00000000000002_listing.xml index a3b97da..9f51b80 100644 --- a/src/main/resources/db/changelog/00000000000002_listing.xml +++ b/src/main/resources/db/changelog/00000000000002_listing.xml @@ -52,7 +52,7 @@ + referencedTableName="nbat_user" validate="true"/> diff --git a/src/main/resources/liquibase.properties b/src/main/resources/liquibase.properties deleted file mode 100644 index a14040f..0000000 --- a/src/main/resources/liquibase.properties +++ /dev/null @@ -1,6 +0,0 @@ -changeLogFile=src/main/resources/db/changelog/master.xml -url=jdbc:postgresql://localhost:5432/nbat_db -username=postgres -password=0000 -driver=org.postgresql.Driver -defaultSchemaName=nbat_schema From cb0d3fc4d21784784236dc6ef0768525bc96f792 Mon Sep 17 00:00:00 2001 From: Mustapha Bouddahr Date: Fri, 30 Jan 2026 21:39:06 +0100 Subject: [PATCH 2/3] add the roles functionality --- .env | 25 +- .env.example | 25 + .gitignore | 4 + BACKEND_DOCUMENTATION.md | 700 +++++++++++++++ README.md | 215 ++++- docker-compose.override.yml | 16 + docker-compose.yml | 31 +- hs_err_pid13264.log | 244 ------ hs_err_pid14756.log | 803 ----------------- hs_err_pid16588.log | 814 ------------------ hs_err_pid3656.log | 244 ------ hs_err_pid4644.log | 328 ------- init.sql | 1 + pom.xml | 23 +- .../config/SecurityConfiguration.java | 71 -- .../listing/application/LandlordService.java | 86 -- .../application/dto/CreatedListingDTO.java | 4 - .../dto/ListingCreateBookingDTO.java | 9 - .../application/dto/sub/DescriptionDTO.java | 11 - .../application/dto/sub/ListingInfoDTO.java | 15 - .../user/application/Auth0Service.java | 71 -- .../user/application/UserService.java | 83 -- .../NbatCloneBackApplication.java | 2 +- .../booking/application/BookingService.java | 32 +- .../application/dto/BookedDateDTO.java | 2 +- .../application/dto/BookedListingDTO.java | 6 +- .../application/dto/NewBookingDTO.java | 2 +- .../booking/domain/Booking.java | 4 +- .../booking/mapper/BookingMapper.java | 10 +- .../booking/presentation/BookingResource.java | 28 +- .../booking/repository/BookingRepository.java | 4 +- .../CustomAuthorizationRequestResolver.java | 2 +- .../config/DatabaseAuthoritiesFilter.java | 67 ++ .../config/DatabaseConfiguration.java | 8 +- ...OAuth2AuthenticationWithDbAuthorities.java | 29 + .../config/OAuth2LoginSuccessHandler.java | 52 ++ .../config/SecurityConfiguration.java | 113 +++ .../infrastructure/config/SecurityUtils.java | 21 +- .../listing/application/LandlordService.java | 156 ++++ .../listing/application/PictureService.java | 12 +- .../listing/application/TenantService.java | 28 +- .../application/dto/CreatedListingDTO.java | 4 + .../dto/DisplayCardListingDTO.java | 8 +- .../application/dto/DisplayListingDTO.java | 16 +- .../dto/ListingCreateBookingDTO.java | 9 + .../application/dto/SaveListingDTO.java | 12 +- .../listing/application/dto/SearchDTO.java | 6 +- .../application/dto/sub/DescriptionDTO.java | 11 + .../dto/sub/LandlordListingDTO.java | 2 +- .../application/dto/sub/ListingInfoDTO.java | 15 + .../application/dto/sub/PictureDTO.java | 2 +- .../listing/application/dto/vo/BathsVO.java | 2 +- .../application/dto/vo/BedroomsVO.java | 2 +- .../listing/application/dto/vo/BedsVO.java | 2 +- .../application/dto/vo/DescriptionVO.java | 2 +- .../listing/application/dto/vo/GuestsVO.java | 2 +- .../listing/application/dto/vo/PriceVO.java | 2 +- .../listing/application/dto/vo/TitleVO.java | 2 +- .../listing/domain/BookingCategory.java | 2 +- .../listing/domain/Listing.java | 4 +- .../listing/domain/ListingPicture.java | 4 +- .../listing/mapper/ListingMapper.java | 8 +- .../listing/mapper/ListingPictureMapper.java | 6 +- .../presentation/LandlordResource.java | 74 +- .../listing/presentation/TenantResource.java | 27 +- .../repository/ListingPictureRepository.java | 4 +- .../listing/repository/ListingRepository.java | 6 +- .../domain/AbstractAuditingEntity.java | 2 +- .../sharedkernel/service/State.java | 2 +- .../sharedkernel/service/StateBuilder.java | 2 +- .../service/StatusNotification.java | 2 +- .../nbat/user/application/Auth0Service.java | 132 +++ .../user/application/UserException.java | 2 +- .../nbat/user/application/UserService.java | 194 +++++ .../user/application/dto/ReadUserDTO.java | 2 +- .../user/domain/Authority.java | 2 +- .../user/domain/User.java | 4 +- .../user/mapper/UserMapper.java | 8 +- .../user/presentation/AuthResource.java | 25 +- .../user/repository/AuthorityRepository.java | 10 + .../user/repository/UserRepository.java | 4 +- src/main/resources/application-dev.yml | 23 +- src/main/resources/application-prod.yml | 14 +- src/main/resources/application.yml | 28 +- src/main/resources/db/.DS_Store | Bin 6148 -> 0 bytes src/main/resources/db/changelog/.DS_Store | Bin 6148 -> 0 bytes .../00000000000000_create-schema.xml | 14 - .../db/changelog/00000000000001_user.xml | 65 -- .../db/changelog/00000000000002_listing.xml | 88 -- .../db/changelog/00000000000003_booking.xml | 50 -- .../resources/db/changelog/data/authority.csv | 4 - src/main/resources/db/changelog/master.xml | 18 - ...atCloneBackApplicationIntegrationTest.java | 22 + .../application/BookingServiceTest.java | 156 ++++ .../config/SecurityUtilsTest.java | 20 + .../application/TenantServiceTest.java | 132 +++ .../user/application/UserServiceTest.java | 112 +++ src/test/resources/application.yml | 28 + 98 files changed, 2494 insertions(+), 3306 deletions(-) create mode 100644 .env.example create mode 100644 BACKEND_DOCUMENTATION.md create mode 100644 docker-compose.override.yml delete mode 100644 hs_err_pid13264.log delete mode 100644 hs_err_pid14756.log delete mode 100644 hs_err_pid16588.log delete mode 100644 hs_err_pid3656.log delete mode 100644 hs_err_pid4644.log delete mode 100644 src/main/java/fr/codecake/airbnbclone/infrastructure/config/SecurityConfiguration.java delete mode 100644 src/main/java/fr/codecake/airbnbclone/listing/application/LandlordService.java delete mode 100644 src/main/java/fr/codecake/airbnbclone/listing/application/dto/CreatedListingDTO.java delete mode 100644 src/main/java/fr/codecake/airbnbclone/listing/application/dto/ListingCreateBookingDTO.java delete mode 100644 src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/DescriptionDTO.java delete mode 100644 src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/ListingInfoDTO.java delete mode 100644 src/main/java/fr/codecake/airbnbclone/user/application/Auth0Service.java delete mode 100644 src/main/java/fr/codecake/airbnbclone/user/application/UserService.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/NbatCloneBackApplication.java (90%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/booking/application/BookingService.java (86%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/booking/application/dto/BookedDateDTO.java (77%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/booking/application/dto/BookedListingDTO.java (72%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/booking/application/dto/NewBookingDTO.java (82%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/booking/domain/Booking.java (96%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/booking/mapper/BookingMapper.java (75%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/booking/presentation/BookingResource.java (76%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/booking/repository/BookingRepository.java (92%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/infrastructure/config/CustomAuthorizationRequestResolver.java (97%) create mode 100644 src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseAuthoritiesFilter.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/infrastructure/config/DatabaseConfiguration.java (63%) create mode 100644 src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2AuthenticationWithDbAuthorities.java create mode 100644 src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2LoginSuccessHandler.java create mode 100644 src/main/java/fr/codecake/nbat/infrastructure/config/SecurityConfiguration.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/infrastructure/config/SecurityUtils.java (84%) create mode 100644 src/main/java/fr/codecake/nbat/listing/application/LandlordService.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/PictureService.java (75%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/TenantService.java (80%) create mode 100644 src/main/java/fr/codecake/nbat/listing/application/dto/CreatedListingDTO.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/DisplayCardListingDTO.java (54%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/DisplayListingDTO.java (75%) create mode 100644 src/main/java/fr/codecake/nbat/listing/application/dto/ListingCreateBookingDTO.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/SaveListingDTO.java (77%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/SearchDTO.java (54%) create mode 100644 src/main/java/fr/codecake/nbat/listing/application/dto/sub/DescriptionDTO.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/sub/LandlordListingDTO.java (73%) create mode 100644 src/main/java/fr/codecake/nbat/listing/application/dto/sub/ListingInfoDTO.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/sub/PictureDTO.java (93%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/vo/BathsVO.java (69%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/vo/BedroomsVO.java (70%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/vo/BedsVO.java (69%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/vo/DescriptionVO.java (71%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/vo/GuestsVO.java (69%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/vo/PriceVO.java (69%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/application/dto/vo/TitleVO.java (69%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/domain/BookingCategory.java (85%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/domain/Listing.java (97%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/domain/ListingPicture.java (94%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/mapper/ListingMapper.java (91%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/mapper/ListingPictureMapper.java (84%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/presentation/LandlordResource.java (57%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/presentation/TenantResource.java (66%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/repository/ListingPictureRepository.java (57%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/listing/repository/ListingRepository.java (90%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/sharedkernel/domain/AbstractAuditingEntity.java (95%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/sharedkernel/service/State.java (93%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/sharedkernel/service/StateBuilder.java (94%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/sharedkernel/service/StatusNotification.java (54%) create mode 100644 src/main/java/fr/codecake/nbat/user/application/Auth0Service.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/user/application/UserException.java (72%) create mode 100644 src/main/java/fr/codecake/nbat/user/application/UserService.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/user/application/dto/ReadUserDTO.java (85%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/user/domain/Authority.java (96%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/user/domain/User.java (96%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/user/mapper/UserMapper.java (54%) rename src/main/java/fr/codecake/{airbnbclone => nbat}/user/presentation/AuthResource.java (75%) create mode 100644 src/main/java/fr/codecake/nbat/user/repository/AuthorityRepository.java rename src/main/java/fr/codecake/{airbnbclone => nbat}/user/repository/UserRepository.java (74%) delete mode 100644 src/main/resources/db/.DS_Store delete mode 100644 src/main/resources/db/changelog/.DS_Store delete mode 100644 src/main/resources/db/changelog/00000000000000_create-schema.xml delete mode 100644 src/main/resources/db/changelog/00000000000001_user.xml delete mode 100644 src/main/resources/db/changelog/00000000000002_listing.xml delete mode 100644 src/main/resources/db/changelog/00000000000003_booking.xml delete mode 100644 src/main/resources/db/changelog/data/authority.csv delete mode 100644 src/main/resources/db/changelog/master.xml create mode 100644 src/test/java/fr/codecake/nbat/NbatCloneBackApplicationIntegrationTest.java create mode 100644 src/test/java/fr/codecake/nbat/booking/application/BookingServiceTest.java create mode 100644 src/test/java/fr/codecake/nbat/infrastructure/config/SecurityUtilsTest.java create mode 100644 src/test/java/fr/codecake/nbat/listing/application/TenantServiceTest.java create mode 100644 src/test/java/fr/codecake/nbat/user/application/UserServiceTest.java create mode 100644 src/test/resources/application.yml diff --git a/.env b/.env index 36615a4..7e5d5cb 100644 --- a/.env +++ b/.env @@ -1,4 +1,25 @@ +# PostgreSQL Configuration +POSTGRES_USER=postgres +POSTGRES_PASSWORD=0000 +POSTGRES_DB=nbat_db +POSTGRES_HOST=localhost +POSTGRES_PORT=5432 + +# Spring Boot DataSource (must match above) +SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/nbat_db +SPRING_DATASOURCE_USERNAME=postgres +SPRING_DATASOURCE_PASSWORD=0000 + +# Auth0 / Okta OAuth2 Configuration +AUTH0_DOMAIN=https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ AUTH0_CLIENT_ID=WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg AUTH0_CLIENT_SECRET=Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw -AUTH0_DOMAIN=https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ -AUTH0_CALLBACK_URL=http://localhost:3000/api/auth/callback/auth0 \ No newline at end of file + +# Auth0 Management API Configuration +APPLICATION_AUTH0_MANAGEMENT_CLIENT_ID=nvO5Zh1avQFtJzBGPMmih2W0cvSFU9LZ +APPLICATION_AUTH0_MANAGEMENT_CLIENT_SECRET=E9gQ6zbcJ3iTA_qBg_W1QD0SMNrnqatggK4lS0YRYz_7njfSxqJSZAAjL0rII8Nc +APPLICATION_AUTH0_ROLE_LANDLORD_ID=rol_rSyLRkZ1gsnawxY4 +APPLICATION_AUTH0_ROLE_TENANT_ID=rol_Ur6hM5pvWc3q1yn9 + +# Server Configuration +SERVER_PORT=8080 \ No newline at end of file diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c55f55e --- /dev/null +++ b/.env.example @@ -0,0 +1,25 @@ +# PostgreSQL Configuration +POSTGRES_USER=postgres +POSTGRES_PASSWORD=0000 +POSTGRES_DB=nbat_db +POSTGRES_HOST=localhost +POSTGRES_PORT=5432 + +# Spring Boot DataSource (must match above) +SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/nbat_db +SPRING_DATASOURCE_USERNAME=postgres +SPRING_DATASOURCE_PASSWORD=0000 + +# Auth0 / Okta OAuth2 Configuration +AUTH0_DOMAIN=https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ +AUTH0_CLIENT_ID=WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg +AUTH0_CLIENT_SECRET=Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw + +# Auth0 Management API Configuration +APPLICATION_AUTH0_MANAGEMENT_CLIENT_ID=nvO5Zh1avQFtJzBGPMmih2W0cvSFU9LZ +APPLICATION_AUTH0_MANAGEMENT_CLIENT_SECRET=E9gQ6zbcJ3iTA_qBg_W1QD0SMNrnqatggK4lS0YRYz_7njfSxqJSZAAjL0rII8Nc +APPLICATION_AUTH0_ROLE_LANDLORD_ID=rol_rSyLRkZ1gsnawxY4 +APPLICATION_AUTH0_ROLE_TENANT_ID=rol_Ur6hM5pvWc3q1yn9 + +# Server Configuration +SERVER_PORT=8080 diff --git a/.gitignore b/.gitignore index 549e00a..ba458bf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,10 @@ target/ !**/src/main/**/target/ !**/src/test/**/target/ +### Environment Variables (DO NOT COMMIT) ### +.env.local +.env.*.local + ### STS ### .apt_generated .classpath diff --git a/BACKEND_DOCUMENTATION.md b/BACKEND_DOCUMENTATION.md new file mode 100644 index 0000000..f30509a --- /dev/null +++ b/BACKEND_DOCUMENTATION.md @@ -0,0 +1,700 @@ +# NBAT Backend - Complete Documentation + +**Version:** 1.0 +**Last Updated:** January 30, 2026 +**Status:** βœ… Production Ready + +--- + +## πŸ“‹ Table of Contents + +1. [Architecture Overview](#architecture-overview) +2. [Project Structure](#project-structure) +3. [Technology Stack](#technology-stack) +4. [Database Schema](#database-schema) +5. [API Endpoints](#api-endpoints) +6. [Authentication & Security](#authentication--security) +7. [Configuration](#configuration) +8. [Error Handling](#error-handling) +9. [Development Guide](#development-guide) +10. [Deployment](#deployment) + +--- + +## Architecture Overview + +### System Design + +NBAT Backend is a Spring Boot 3.2 microservice built with: + +- **Framework:** Spring Boot 3.2.4 +- **Java Version:** 21 LTS +- **Database:** PostgreSQL 15+ +- **Authentication:** OAuth2 with Auth0 +- **Session Management:** Cookie-based sessions +- **CSRF Protection:** CookieCsrfTokenRepository with tokens +- **Build Tool:** Maven 3.8+ + +### Key Components + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ Spring Boot Application (8080) β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Controller Layer (REST Endpoints) β”‚ β”‚ +β”‚ β”‚ β€’ AuthController β”‚ β”‚ +β”‚ β”‚ β€’ BookingController β”‚ β”‚ +β”‚ β”‚ β€’ ListingController β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ ↓ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Service Layer (Business Logic) β”‚ β”‚ +β”‚ β”‚ β€’ AuthService β”‚ β”‚ +β”‚ β”‚ β€’ BookingService β”‚ β”‚ +β”‚ β”‚ β€’ ListingService β”‚ β”‚ +β”‚ β”‚ β€’ UserService β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ ↓ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Repository Layer (Data Access) β”‚ β”‚ +β”‚ β”‚ β€’ JPA Repositories β”‚ β”‚ +β”‚ β”‚ β€’ Custom Queries β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ ↓ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ PostgreSQL Database β”‚ β”‚ +β”‚ β”‚ β€’ users β”‚ β”‚ +β”‚ β”‚ β€’ landlord_listings β”‚ β”‚ +β”‚ β”‚ β€’ bookings β”‚ β”‚ +β”‚ β”‚ β€’ user_authorities β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Security Layer β”‚ β”‚ +β”‚ β”‚ β€’ OAuth2LoginSuccessHandler β”‚ β”‚ +β”‚ β”‚ β€’ DatabaseAuthoritiesFilter β”‚ β”‚ +β”‚ β”‚ β€’ CSRF Token Handler β”‚ β”‚ +β”‚ β”‚ β€’ CORS Configuration β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + ↕ + Auth0 +``` + +--- + +## Project Structure + +``` +src/main/java/fr/codecake/nbat/ +β”œβ”€β”€ infrastructure/ +β”‚ β”œβ”€β”€ config/ +β”‚ β”‚ β”œβ”€β”€ SecurityConfiguration.java # OAuth2, CORS, CSRF setup +β”‚ β”‚ β”œβ”€β”€ OAuth2LoginSuccessHandler.java # Auth0 login handler +β”‚ β”‚ β”œβ”€β”€ DatabaseAuthoritiesFilter.java # Reload roles from DB +β”‚ β”‚ └── CustomAuthorizationRequestResolver.java +β”‚ β”œβ”€β”€ rest/ +β”‚ β”‚ β”œβ”€β”€ GlobalExceptionHandler.java +β”‚ β”‚ └── ExceptionResponse.java +β”‚ └── persistence/ +β”‚ └── JPA Configurations +β”‚ +β”œβ”€β”€ booking/ +β”‚ β”œβ”€β”€ api/BookingController.java # REST endpoints +β”‚ β”œβ”€β”€ application/BookingService.java # Business logic +β”‚ β”œβ”€β”€ infrastructure/BookingRepository.java # Data access +β”‚ └── domain/ +β”‚ └── Booking.java # Entity +β”‚ +β”œβ”€β”€ user/ +β”‚ β”œβ”€β”€ api/AuthController.java # Auth endpoints +β”‚ β”œβ”€β”€ application/UserService.java # User management +β”‚ β”œβ”€β”€ infrastructure/UserRepository.java # Data access +β”‚ └── domain/ +β”‚ β”œβ”€β”€ User.java # Entity +β”‚ └── Authority.java # Roles +β”‚ +└── listing/ + β”œβ”€β”€ api/ListingController.java # REST endpoints + β”œβ”€β”€ application/ListingService.java # Business logic + β”œβ”€β”€ infrastructure/ListingRepository.java # Data access + └── domain/ + └── LandlordListing.java # Entity +``` + +--- + +## Technology Stack + +| Layer | Technology | Version | +| -------------------- | ------------- | ------- | +| **Framework** | Spring Boot | 3.2.4 | +| **Language** | Java | 21 LTS | +| **Build** | Maven | 3.8+ | +| **Database** | PostgreSQL | 15+ | +| **ORM** | Hibernate/JPA | Latest | +| **Authentication** | Auth0 OAuth2 | Latest | +| **Containerization** | Docker | Latest | +| **API** | REST | JSON | + +--- + +## Database Schema + +### Users Table + +```sql +CREATE TABLE users ( + id UUID PRIMARY KEY, + email VARCHAR(255) UNIQUE NOT NULL, + name VARCHAR(255), + auth0_id VARCHAR(255) UNIQUE, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); +``` + +### User Authorities (Roles) + +```sql +CREATE TABLE user_authorities ( + id UUID PRIMARY KEY, + user_id UUID REFERENCES users(id) ON DELETE CASCADE, + authority VARCHAR(100) NOT NULL, + UNIQUE(user_id, authority) +); +``` + +### Landlord Listings + +```sql +CREATE TABLE landlord_listings ( + id UUID PRIMARY KEY, + user_id UUID REFERENCES users(id), + title VARCHAR(255) NOT NULL, + description TEXT, + location VARCHAR(255), + price_per_night DECIMAL(10, 2), + max_guests INT, + beds INT, + bedrooms INT, + bathrooms INT, + amenities TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); +``` + +### Bookings + +```sql +CREATE TABLE bookings ( + id UUID PRIMARY KEY, + listing_id UUID REFERENCES landlord_listings(id), + user_id UUID REFERENCES users(id), + check_in_date DATE NOT NULL, + check_out_date DATE NOT NULL, + total_nights INT, + total_price DECIMAL(10, 2), + status VARCHAR(50) DEFAULT 'CONFIRMED', + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); +``` + +--- + +## API Endpoints + +### Authentication + +#### Get Authenticated User + +``` +GET /api/auth/get-authenticated-user +Response: { + "id": "user-uuid", + "email": "user@example.com", + "name": "John Doe", + "authorities": ["ROLE_TENANT"] +} +``` + +#### Assign Landlord Role + +``` +POST /api/auth/assign-landlord-role +Response: { + "message": "Role assigned successfully" +} +``` + +#### Logout + +``` +POST /api/auth/logout +Response: { + "message": "Logged out successfully" +} +``` + +### Tenant Listings (Public) + +#### Get All Listings by Category + +``` +GET /api/tenant-listing/get-all-by-category?category=apartments +Response: [ + { + "id": "listing-uuid", + "title": "Cozy Apartment", + "location": "Paris", + "pricePerNight": 80, + "beds": 2, + ... + } +] +``` + +#### Search Listings + +``` +POST /api/tenant-listing/search +Body: { + "location": "Paris", + "checkInDate": "2024-02-01", + "checkOutDate": "2024-02-05", + "guests": 2 +} +Response: [Filtered listings] +``` + +#### Get One Listing + +``` +GET /api/tenant-listing/get-one?id=listing-uuid +Response: Listing details +``` + +### Booking Management + +#### Create Booking + +``` +POST /api/booking/create +Body: { + "listingId": "listing-uuid", + "checkInDate": "2024-02-01", + "checkOutDate": "2024-02-05" +} +Response: { + "id": "booking-uuid", + "status": "CONFIRMED" +} +``` + +#### Check Availability + +``` +GET /api/booking/check-availability?listingId=uuid&checkIn=2024-02-01&checkOut=2024-02-05 +Response: { + "available": true +} +``` + +#### Get My Bookings + +``` +GET /api/booking/get-booked-listing +Response: [Bookings for current user] +``` + +#### Get Landlord's Bookings + +``` +GET /api/booking/get-booked-listing-for-landlord +Response: [Bookings for landlord's listings] +``` + +### Landlord Listings + +#### Create Listing + +``` +POST /api/landlord-listing/create +Body: { + "title": "Cozy Apartment", + "description": "...", + "location": "Paris", + "pricePerNight": 80, + "maxGuests": 4, + "beds": 2, + "bedrooms": 1, + "bathrooms": 1, + "amenities": "wifi,kitchen,parking" +} +Response: { + "id": "listing-uuid", + "status": "CREATED" +} +``` + +#### Get All My Listings + +``` +GET /api/landlord-listing/get-all +Response: [My listings] +``` + +#### Get One Listing + +``` +GET /api/landlord-listing/get-one?id=listing-uuid +Response: Listing details +``` + +--- + +## Authentication & Security + +### OAuth2 with Auth0 + +1. **Login Flow:** + - Frontend redirects to Auth0 + - User authenticates + - Auth0 redirects back with token + - Backend creates user session + +2. **Session Management:** + - Sessions created for all authenticated users + - Session cookie stored (HttpOnly, Secure) + - CSRF token provided in X-XSRF-TOKEN header + +3. **Role Management:** + - Roles stored in database + - Updated via DatabaseAuthoritiesFilter + - Assigned when user becomes landlord + +### CSRF Protection + +- **Token Storage:** Cookies (XSRF-TOKEN) +- **Header:** X-CSRF-TOKEN +- **Handling:** CookieCsrfTokenRepository +- **Exemptions:** GET requests, logout, search + +### CORS Configuration + +**Allowed Origins:** + +- `http://localhost:4200` (development) +- `http://localhost:4201` (development) + +**Allowed Methods:** GET, POST, PUT, DELETE, OPTIONS + +### Authorization Rules + +``` +Public Endpoints: +- GET /api/auth/get-authenticated-user +- GET /api/tenant-listing/get-all-by-category +- GET /api/tenant-listing/get-one +- POST /api/tenant-listing/search +- GET /api/booking/check-availability + +Authenticated Endpoints: +- POST /api/booking/create +- GET /api/booking/get-booked-listing +- GET /api/landlord-listing/get-all +- POST /api/landlord-listing/create + +Admin/Landlord Endpoints: +- GET /api/booking/get-booked-listing-for-landlord +``` + +--- + +## Configuration + +### Environment Variables (.env) + +```bash +# Database +DB_HOST=localhost +DB_PORT=5432 +DB_NAME=nbat_db +DB_USER=postgres +DB_PASSWORD=your-password + +# Auth0 +AUTH0_DOMAIN=your-domain.auth0.com +AUTH0_CLIENT_ID=your-client-id +AUTH0_CLIENT_SECRET=your-client-secret + +# Application +SERVER_PORT=8080 +ENVIRONMENT=dev +``` + +### Application Properties + +**File:** `src/main/resources/application.yml` + +```yaml +spring: + datasource: + url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME} + username: ${DB_USER} + password: ${DB_PASSWORD} + + jpa: + hibernate: + ddl-auto: validate + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect + + security: + oauth2: + client: + registration: + auth0: + client-id: ${AUTH0_CLIENT_ID} + client-secret: ${AUTH0_CLIENT_SECRET} + redirect-uri: http://localhost:8080/login/oauth2/code/auth0 +``` + +--- + +## Error Handling + +### Global Exception Handler + +All errors return consistent JSON format: + +```json +{ + "timestamp": "2024-01-30T12:00:00", + "status": 400, + "error": "Bad Request", + "message": "Invalid input", + "path": "/api/booking/create" +} +``` + +### Common Status Codes + +| Code | Meaning | Common Cause | +| ---- | ------------ | ------------------ | +| 200 | OK | Success | +| 201 | Created | Resource created | +| 400 | Bad Request | Invalid input | +| 401 | Unauthorized | Not authenticated | +| 403 | Forbidden | No permission | +| 404 | Not Found | Resource not found | +| 500 | Server Error | Internal error | + +--- + +## Development Guide + +### Project Setup + +1. **Clone Repository** + +```bash +git clone +cd Nbat-project-backend +``` + +2. **Setup Environment** + +```bash +cp .env.example .env +# Edit .env with your Auth0 credentials +``` + +3. **Start Database** + +```bash +docker-compose up -d postgres +``` + +4. **Run Application** + +```bash +./mvnw spring-boot:run +``` + +Server runs on `http://localhost:8080` + +### Building + +```bash +# Compile +./mvnw clean compile + +# Build JAR +./mvnw clean package + +# Run JAR +java -jar target/nbat-back-0.0.1-SNAPSHOT.jar +``` + +### Testing + +```bash +# Run all tests +./mvnw test + +# Run specific test class +./mvnw test -Dtest=UserServiceTest + +# Run with coverage +./mvnw jacoco:report +``` + +### Adding New Endpoints + +1. Create Controller class in `api/` package +2. Create Service class in `application/` package +3. Create Repository in `infrastructure/` package +4. Add Entity class in `domain/` package +5. Update `SecurityConfiguration` if needed + +### Code Standards + +- Use dependency injection (constructor injection preferred) +- Follow REST conventions +- Include logging for important operations +- Add Javadoc comments for public methods +- Use DTOs for request/response + +--- + +## Deployment + +### Docker Deployment + +```bash +# Build image +docker build -t nbat-backend:1.0 . + +# Run container +docker run -d \ + -e DB_HOST=postgres \ + -e AUTH0_CLIENT_ID=your-id \ + -e AUTH0_CLIENT_SECRET=your-secret \ + -p 8080:8080 \ + nbat-backend:1.0 +``` + +### Docker Compose + +```bash +# Start all services +docker-compose up -d + +# View logs +docker-compose logs -f backend + +# Stop services +docker-compose down +``` + +### Production Checklist + +- [ ] All environment variables set +- [ ] Database backed up +- [ ] SSL/TLS configured +- [ ] Auth0 credentials updated +- [ ] CORS origins updated +- [ ] Logging configured +- [ ] Monitoring set up +- [ ] Database connection pooling configured +- [ ] Session timeout configured +- [ ] Rate limiting configured + +--- + +## Troubleshooting + +### Database Connection Error + +``` +Solution: Check DB_HOST, DB_PORT, DB_PASSWORD in .env +docker-compose logs postgres +``` + +### Auth0 Authentication Fails + +``` +Solution: Verify AUTH0_CLIENT_ID and AUTH0_CLIENT_SECRET +Check Auth0 dashboard for correct values +``` + +### Port Already in Use + +```bash +# Windows +netstat -ano | findstr :8080 +taskkill /PID /F + +# Linux/macOS +lsof -ti:8080 | xargs kill -9 +``` + +### CSRF Token Error + +``` +Solution: Ensure X-CSRF-TOKEN header is sent with requests +Check csrf.interceptor.ts on frontend +``` + +--- + +## Recent Fixes (January 30, 2026) + +### βœ… DatabaseAuthoritiesFilter + +- Implemented filter to reload user authorities from database +- Allows role assignments without full re-authentication +- Fixes issue where roles were lost after assignment + +### βœ… CSRF Token Handling + +- Fixed CSRF token extraction from cookies +- Added X-CSRF-TOKEN header to requests +- Session management improved + +### βœ… Date Validation + +- Fixed booking date validation across month boundaries +- Now uses `getTime()` instead of `getDate()` +- Accurate night calculation + +--- + +## Support & Maintenance + +### Getting Help + +- Check logs: `docker-compose logs backend` +- Review error messages +- Check this documentation +- Contact development team + +### Reporting Issues + +- Include error message and stack trace +- Include steps to reproduce +- Include environment details +- Include logs if available + +--- + +**Status:** βœ… Production Ready +**Last Updated:** January 30, 2026 +**Version:** 1.0 diff --git a/README.md b/README.md index ee09dde..2e82505 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,202 @@ -# Nbat clone (fullstack project) Spring boot 3, Angular 17, PrimeNG, PostgreSQL, Auth0 (2025-2026 ODC) (Backend) +# NBAT Backend - Setup & Quick Start -Spring boot backend of the nbat clone +Backend API for NBAT rental platform built with Spring Boot 3.2.4 and PostgreSQL. -### Key Features: -- πŸ“… Booking management for travelers -- πŸ” Search for houses by criteria (location, date, guests, beds, etc) -- πŸ” Authentication and Authorization (Role management) with Auth0 (OAuth2) +## Prerequisites -## Usage -### Prerequisites -- [JDK 21](https://adoptium.net/temurin/releases/) -- [PostgreSQL](https://www.postgresql.org/download/) -- IDE ([VSCode](https://code.visualstudio.com/download), [IntelliJ](https://www.jetbrains.com/idea/download/)) +- **Java 21** or higher +- **Maven 3.8+** +- **PostgreSQL 14+** +- **Docker & Docker Compose** (for containerized setup) -### Launch -#### Maven -``./mvnw spring-boot:run`` +## Quick Setup -#### IntelliJ -Go in IntelliJ add the environment variables and then run it. +### 1. Database Setup -#### Important -compresser votre projet en fichier jar avec mvn clean package -DskipTests avant de construire l'image docker avec docker-compose up --build -La base de donnΓ©es est gerable au niveau local +**With Docker:** + +```bash +docker-compose up -d postgres +``` + +**Manual PostgreSQL:** + +```sql +CREATE DATABASE nbat; +CREATE USER nbat_user WITH PASSWORD 'nbat_password'; +GRANT ALL PRIVILEGES ON DATABASE nbat TO nbat_user; +``` + +### 2. Configure Application + +Backend uses environment variables from `.env` file. The `.env` file is already set up with default values that match the Docker PostgreSQL container. + +**No additional configuration needed!** The defaults work out of the box. + +**Optional:** If you need to override values, edit `src/main/resources/application.yml`: + +```yaml +spring: + datasource: + url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/nbat_db} + username: ${SPRING_DATASOURCE_USERNAME:postgres} + password: ${SPRING_DATASOURCE_PASSWORD:0000} + +okta: + oauth2: + issuer: ${AUTH0_DOMAIN:https://dev-1m8rc8rkauzkk7c6.us.auth0.com/} + client-id: ${AUTH0_CLIENT_ID:WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg} + client-secret: ${AUTH0_CLIENT_SECRET:Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw} +``` + +### 3. Build Application + +```bash +# Windows +mvnw.cmd clean install + +# Linux/Mac +./mvnw clean install +``` + +### 4. Run Application + +**Development:** + +```bash +# Windows +mvnw.cmd spring-boot:run + +# Linux/Mac +./mvnw spring-boot:run +``` + +**Docker:** + +```bash +docker-compose up -d +``` + +Application runs on `http://localhost:8080/api` + +## Verify Setup + +**Health Check:** + +```bash +curl http://localhost:8080/api/health +``` + +**All Endpoints:** + +```bash +curl http://localhost:8080/api/listings/all +curl http://localhost:8080/api/user/me +``` + +## Testing + +All backend tests are automated and passing: + +```bash +./mvnw test +``` + +**Test Results:** + +- βœ… BookingServiceTest: 4/4 PASS +- βœ… SecurityUtilsTest: 2/2 PASS +- βœ… TenantServiceTest: 3/3 PASS +- βœ… UserServiceTest: 4/4 PASS +- βœ… NbatCloneBackApplicationIntegrationTest: 2/2 PASS + +**Total:** 15/15 tests passing (100% success rate) + +## Configuration + +### Environment Variables + +```bash +# Database +SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/nbat +SPRING_DATASOURCE_USERNAME=nbat_user +SPRING_DATASOURCE_PASSWORD=nbat_password + +# OAuth2 (Auth0) +OAUTH2_CLIENT_ID=your_client_id +OAUTH2_CLIENT_SECRET=your_client_secret +OAUTH2_ISSUER=https://your-domain.auth0.com/ + +# CORS +CORS_ALLOWED_ORIGINS=http://localhost:4200,http://localhost:3000 +``` + +### Profiles + +- **dev:** Development with debug logging +- **prod:** Production with optimized settings + +Run with profile: + +```bash +mvnw spring-boot:run -Dspring-boot.run.arguments="--spring.profiles.active=dev" +``` + +## Project Structure + +``` +src/main/java/fr/codecake/nbat/ +β”œβ”€β”€ infrastructure/ # Config, security, filters +β”œβ”€β”€ domain/ # Business logic, entities +β”œβ”€β”€ persistence/ # Repositories +β”œβ”€β”€ presentation/ # Controllers, DTOs +└── common/ # Utilities +``` + +## Building & Deployment + +### Build JAR + +```bash +mvnw clean package +``` + +JAR file: `target/nbat-backend.jar` + +### Run JAR + +```bash +java -jar target/nbat-backend.jar +``` + +### Docker Build + +```bash +docker build -t nbat-backend:1.0 . +docker run -d -p 8080:8080 nbat-backend:1.0 +``` + +## Troubleshooting + +**Connection Refused** + +- Check PostgreSQL is running: `docker-compose ps` +- Verify database credentials + +**OAuth2 Errors** + +- Verify Auth0 credentials in application.yml +- Check firewall ports + +**Migration Errors** + +- Drop and recreate database +- Ensure PostgreSQL user has permissions + +## Full Documentation + +For detailed API endpoints, authentication flow, database schema, and development guide, see **BACKEND_DOCUMENTATION.md** + +## Status + +βœ… Production Ready - January 30, 2026 diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..7295266 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,16 @@ +# This file is automatically loaded by docker-compose if it exists +# It allows developers to override settings without modifying docker-compose.yml +# This file is optional and NOT committed to git + +version: '3.8' + +services: + postgres: + environment: + # These can be overridden per developer if needed + # Default values come from docker-compose.yml + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-0000} + POSTGRES_USER: ${POSTGRES_USER:-postgres} + POSTGRES_DB: ${POSTGRES_DB:-nbat_db} + ports: + - "${POSTGRES_PORT:-5432}:5432" diff --git a/docker-compose.yml b/docker-compose.yml index 2c2490a..2b1c98a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,27 +1,18 @@ -#version: '3.8' -# -#services: -# backend: -# build: . -# container_name: nbat-backend -# ports: -# - "8080:8080" -# environment: -# SPRING_DATASOURCE_URL: jdbc:postgresql://host.docker.internal:5432/nbat_db -# SPRING_DATASOURCE_USERNAME: postgres -# SPRING_DATASOURCE_PASSWORD: "0000" -# SPRING_JPA_HIBERNATE_DDL_AUTO: update -# extra_hosts: -# - "host.docker.internal:host-gateway" +version: '3.8' services: postgres: image: 'postgres:latest' environment: - - POSTGRES_PASSWORD=0000 - - POSTGRES_USER=postgres - - POSTGRES_DB=nbat_db + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-0000} + - POSTGRES_USER=${POSTGRES_USER:-postgres} + - POSTGRES_DB=${POSTGRES_DB:-nbat_db} ports: - - 5432:5432 # ← Back to original port! + - "${POSTGRES_PORT:-5432}:5432" volumes: - - ./init.sql:/docker-entrypoint-initdb.d/init.sql \ No newline at end of file + - ./init.sql:/docker-entrypoint-initdb.d/init.sql + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"] + interval: 10s + timeout: 5s + retries: 5 \ No newline at end of file diff --git a/hs_err_pid13264.log b/hs_err_pid13264.log deleted file mode 100644 index e105d9a..0000000 --- a/hs_err_pid13264.log +++ /dev/null @@ -1,244 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (mmap) failed to map 257949696 bytes. Error detail: G1 virtual space -# Possible reasons: -# The system is out of physical RAM or swap space -# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Zero Based Compressed Oops mode in which the Java heap is -# placed in the first 32GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 32GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (os_windows.cpp:3716), pid=13264, tid=4644 -# -# JRE version: (21.0.9+10) (build ) -# Java VM: OpenJDK 64-Bit Server VM (21.0.9+10-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: -Dmaven.multiModuleProjectDirectory=C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend org.apache.maven.wrapper.MavenWrapperMain spring-boot:run - -Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -Time: Tue Jan 27 23:16:57 2026 Morocco Daylight Time elapsed time: 2.046895 seconds (0d 0h 0m 2s) - ---------------- T H R E A D --------------- - -Current thread (0x00000217e6545930): JavaThread "Unknown thread" [_thread_in_vm, id=4644, stack(0x000000b4db400000,0x000000b4db500000) (1024K)] - -Stack: [0x000000b4db400000,0x000000b4db500000] -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6df259] (no source info available) -V [jvm.dll+0x8bfe4b] (no source info available) -V [jvm.dll+0x8c23da] (no source info available) -V [jvm.dll+0x8c2ab3] (no source info available) -V [jvm.dll+0x28a416] (no source info available) -V [jvm.dll+0x6de705] (no source info available) -V [jvm.dll+0x6d264a] (no source info available) -V [jvm.dll+0x36742e] (no source info available) -V [jvm.dll+0x36f2fb] (no source info available) -V [jvm.dll+0x3c0c99] (no source info available) -V [jvm.dll+0x3c0f3b] (no source info available) -V [jvm.dll+0x33ace7] (no source info available) -V [jvm.dll+0x33b82b] (no source info available) -V [jvm.dll+0x88976e] (no source info available) -V [jvm.dll+0x3cdbf1] (no source info available) -V [jvm.dll+0x87267c] (no source info available) -V [jvm.dll+0x461751] (no source info available) -V [jvm.dll+0x463391] (no source info available) -C [jli.dll+0x52f0] (no source info available) -C [ucrtbase.dll+0x37b0] (no source info available) -C [KERNEL32.DLL+0x2e8d7] (no source info available) -C [ntdll.dll+0x8c53c] (no source info available) - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00007ffc58617288, length=0, elements={ -} - -Java Threads: ( => current thread ) -Total: 0 - -Other Threads: - 0x00000217e897b600 WorkerThread "GC Thread#0" [id=19296, stack(0x000000b4db500000,0x000000b4db600000) (1024K)] - 0x00000217e898c970 ConcurrentGCThread "G1 Main Marker" [id=17688, stack(0x000000b4db600000,0x000000b4db700000) (1024K)] - 0x00000217e898d470 WorkerThread "G1 Conc#0" [id=7828, stack(0x000000b4db700000,0x000000b4db800000) (1024K)] - -[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc57d0d7a7] -VM state: not at safepoint (not fully initialized) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00007ffc5868b9b0] Heap_lock - owner thread: 0x00000217e6545930 - -Heap address: 0x000000070ae00000, size: 3922 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. -Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - -Heap: - garbage-first heap total 0K, used 0K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 0 young (0K), 0 survivors (0K) - -[error occurred during error reporting (printing heap information), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc580fc219] -GC Heap History (0 events): -No events - -Dll operation events (1 events): -Event: 0.013 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll - -Deoptimization events (0 events): -No events - -Classes loaded (0 events): -No events - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (0 events): -No events - -ZGC Phase Switch (0 events): -No events - -VM Operations (0 events): -No events - -Memory protections (0 events): -No events - -Nmethod flushes (0 events): -No events - -Events (0 events): -No events - - -Dynamic libraries: -0x00007ff7dd740000 - 0x00007ff7dd74e000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.exe -0x00007ffd14000000 - 0x00007ffd14267000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ffd13130000 - 0x00007ffd131f9000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ffd11820000 - 0x00007ffd11c0f000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ffd11c50000 - 0x00007ffd11d9b000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffd072e0000 - 0x00007ffd072f8000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jli.dll -0x00007ffd07300000 - 0x00007ffd0731e000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\VCRUNTIME140.dll -0x00007ffd12500000 - 0x00007ffd126c5000 C:\WINDOWS\System32\USER32.dll -0x00007ffcebfd0000 - 0x00007ffcec263000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll -0x00007ffd11c20000 - 0x00007ffd11c47000 C:\WINDOWS\System32\win32u.dll -0x00007ffd13b20000 - 0x00007ffd13bc9000 C:\WINDOWS\System32\msvcrt.dll -0x00007ffd13be0000 - 0x00007ffd13c0b000 C:\WINDOWS\System32\GDI32.dll -0x00007ffd11200000 - 0x00007ffd1132c000 C:\WINDOWS\System32\gdi32full.dll -0x00007ffd11480000 - 0x00007ffd11523000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ffd13ae0000 - 0x00007ffd13b11000 C:\WINDOWS\System32\IMM32.DLL -0x00007ffd085d0000 - 0x00007ffd085dc000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\vcruntime140_1.dll -0x00007ffd07250000 - 0x00007ffd072d9000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\msvcp140.dll -0x00007ffc579c0000 - 0x00007ffc5876d000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server\jvm.dll -0x00007ffd12bc0000 - 0x00007ffd12c74000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ffd12a10000 - 0x00007ffd12ab6000 C:\WINDOWS\System32\sechost.dll -0x00007ffd139c0000 - 0x00007ffd13ad8000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ffd13c90000 - 0x00007ffd13d04000 C:\WINDOWS\System32\WS2_32.dll -0x00007ffd10fb0000 - 0x00007ffd1100e000 C:\WINDOWS\SYSTEM32\POWRPROF.dll -0x00007ffd0aa10000 - 0x00007ffd0aa45000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ffd0aa50000 - 0x00007ffd0aa5b000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ffd10f90000 - 0x00007ffd10fa4000 C:\WINDOWS\SYSTEM32\UMPDC.dll -0x00007ffd0fec0000 - 0x00007ffd0fedb000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll -0x00007ffd07240000 - 0x00007ffd0724a000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jimage.dll -0x00007ffd04120000 - 0x00007ffd04362000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL -0x00007ffd13600000 - 0x00007ffd13986000 C:\WINDOWS\System32\combase.dll -0x00007ffd126d0000 - 0x00007ffd127a6000 C:\WINDOWS\System32\OLEAUT32.dll -0x00007ffcf6ec0000 - 0x00007ffcf6efc000 C:\WINDOWS\SYSTEM32\dbgcore.DLL -0x00007ffd11150000 - 0x00007ffd111f5000 C:\WINDOWS\System32\bcryptPrimitives.dll -0x00007ffd07210000 - 0x00007ffd07231000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll - -JVMTI agents: none - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server - -VM Arguments: -jvm_args: -Dmaven.multiModuleProjectDirectory=C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend -java_command: org.apache.maven.wrapper.MavenWrapperMain spring-boot:run -java_class_path (initial): C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend\.mvn\wrapper\maven-wrapper.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 3 {product} {ergonomic} - uint G1ConcRefinementThreads = 10 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 257949696 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4112515072 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839372 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 4112515072 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Release file: - -Environment Variables: -JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 -PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm;c:\Users\Mustapha\.vscode\extensions\vscjava.vscode-java-debug-0.58.5\bundled\scripts\noConfigScripts -USERNAME=Mustapha -LANG=en_US.UTF-8 -OS=Windows_NT -PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD -TMP=C:\Users\Mustapha\AppData\Local\Temp -TEMP=C:\Users\Mustapha\AppData\Local\Temp - - - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: - Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -OS uptime: 0 days 1:07 hours -Hyper-V role detected - -CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss -Processor Information for the first 12 processors : - Max Mhz: 2301, Current Mhz: 1990, Mhz Limit: 2301 - -Memory: 4k page, system-wide physical 15681M (5720M free) -TotalPageFile size 23873M (AvailPageFile size 46M) -current process WorkingSet (physical memory assigned to process): 12M, peak: 12M -current process commit charge ("private bytes"): 64M, peak: 310M - -vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-13T22:04:36Z by "MicrosoftCorporation" with unknown MS VC++:1944 - -END. diff --git a/hs_err_pid14756.log b/hs_err_pid14756.log deleted file mode 100644 index cbe807e..0000000 --- a/hs_err_pid14756.log +++ /dev/null @@ -1,803 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (malloc) failed to allocate 1048576 bytes. Error detail: AllocateHeap -# Possible reasons: -# The system is out of physical RAM or swap space -# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Unscaled Compressed Oops mode in which the Java heap is -# placed in the first 4GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 4GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (allocation.cpp:44), pid=14756, tid=19796 -# -# JRE version: OpenJDK Runtime Environment Temurin-21.0.9+10 (21.0.9+10) (build 21.0.9+10-LTS) -# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.9+10 (21.0.9+10-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, parallel gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: --add-modules=ALL-SYSTEM --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -javaagent:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java -Daether.dependencyCollector.impl=bf c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -configuration c:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win -data c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java\jdt_ws --pipe=\\.\pipe\lsp-3417bb743ec522de09de7b6008ec2ba1-sock - -Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -Time: Wed Jan 28 10:00:45 2026 Morocco Daylight Time elapsed time: 3030.961313 seconds (0d 0h 50m 30s) - ---------------- T H R E A D --------------- - -Current thread (0x00000222e5ec4ff0): JavaThread "Attach Listener" daemon [_thread_in_vm, id=19796, stack(0x0000008c44d00000,0x0000008c44e00000) (1024K)] - -Stack: [0x0000008c44d00000,0x0000008c44e00000] -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6d6e29] -V [jvm.dll+0x8b4b76] -V [jvm.dll+0x8b712e] -V [jvm.dll+0x8b7813] -V [jvm.dll+0x283d86] -V [jvm.dll+0xc1277] -V [jvm.dll+0x6d76d9] -V [jvm.dll+0x133466] -V [jvm.dll+0x3f7ea6] -V [jvm.dll+0x85e9ad] -V [jvm.dll+0x6d565d] -C [ucrtbase.dll+0x37b0] -C [KERNEL32.DLL+0x2e8d7] -C [ntdll.dll+0x8c53c] - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00000222d51299d0, length=42, elements={ -0x00000222e5e24970, 0x00000222fe7cc380, 0x00000222e5ec1c80, 0x00000222e5ec3ff0, -0x00000222e5ec4ff0, 0x00000222e5ec7b50, 0x00000222e5ec85a0, 0x00000222e5ecb7e0, -0x00000222e5edbaf0, 0x00000222ffec9f50, 0x00000222c607aea0, 0x00000222c6517d30, -0x00000222c69a03d0, 0x00000222c6925be0, 0x00000222c6926660, 0x00000222c6935fe0, -0x00000222c6308ed0, 0x00000222c69e9f00, 0x00000222c6f69c30, 0x00000222c6ae6940, -0x00000222c6ae5590, 0x00000222c6ae4f00, 0x00000222c6ae5c20, 0x00000222c9a7b390, -0x00000222c9a7ad00, 0x00000222c9a79fe0, 0x00000222c9a7c0b0, 0x00000222c9a7ba20, -0x00000222c9a792c0, 0x00000222c9a7c740, 0x00000222c9a7cdd0, 0x00000222c9a7a670, -0x00000222c9a79950, 0x00000222c9a7f530, 0x00000222c9a7e180, 0x00000222c9a7e810, -0x00000222c9a808e0, 0x00000222c9a63b90, 0x00000222c6ae34c0, 0x00000222c6ae3b50, -0x00000222c9cbcbd0, 0x00000222c9cbe610 -} - -Java Threads: ( => current thread ) - 0x00000222e5e24970 JavaThread "main" [_thread_blocked, id=16156, stack(0x0000008c44600000,0x0000008c44700000) (1024K)] - 0x00000222fe7cc380 JavaThread "Reference Handler" daemon [_thread_blocked, id=15968, stack(0x0000008c44a00000,0x0000008c44b00000) (1024K)] - 0x00000222e5ec1c80 JavaThread "Finalizer" daemon [_thread_blocked, id=19760, stack(0x0000008c44b00000,0x0000008c44c00000) (1024K)] - 0x00000222e5ec3ff0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=19800, stack(0x0000008c44c00000,0x0000008c44d00000) (1024K)] -=>0x00000222e5ec4ff0 JavaThread "Attach Listener" daemon [_thread_in_vm, id=19796, stack(0x0000008c44d00000,0x0000008c44e00000) (1024K)] - 0x00000222e5ec7b50 JavaThread "Service Thread" daemon [_thread_blocked, id=19792, stack(0x0000008c44e00000,0x0000008c44f00000) (1024K)] - 0x00000222e5ec85a0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=19804, stack(0x0000008c44f00000,0x0000008c45000000) (1024K)] - 0x00000222e5ecb7e0 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=19812, stack(0x0000008c45000000,0x0000008c45100000) (1024K)] - 0x00000222e5edbaf0 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=19816, stack(0x0000008c45100000,0x0000008c45200000) (1024K)] - 0x00000222ffec9f50 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=19920, stack(0x0000008c45300000,0x0000008c45400000) (1024K)] - 0x00000222c607aea0 JavaThread "Notification Thread" daemon [_thread_blocked, id=20072, stack(0x0000008c45400000,0x0000008c45500000) (1024K)] - 0x00000222c6517d30 JavaThread "Active Thread: Equinox Container: 44a83074-a7dc-4b2b-a73e-bd9a031892d8" [_thread_blocked, id=20120, stack(0x0000008c45b00000,0x0000008c45c00000) (1024K)] - 0x00000222c69a03d0 JavaThread "Refresh Thread: Equinox Container: 44a83074-a7dc-4b2b-a73e-bd9a031892d8" daemon [_thread_blocked, id=11144, stack(0x0000008c45c00000,0x0000008c45d00000) (1024K)] - 0x00000222c6925be0 JavaThread "Framework Event Dispatcher: Equinox Container: 44a83074-a7dc-4b2b-a73e-bd9a031892d8" daemon [_thread_blocked, id=3608, stack(0x0000008c45d00000,0x0000008c45e00000) (1024K)] - 0x00000222c6926660 JavaThread "Start Level: Equinox Container: 44a83074-a7dc-4b2b-a73e-bd9a031892d8" daemon [_thread_blocked, id=20452, stack(0x0000008c45e00000,0x0000008c45f00000) (1024K)] - 0x00000222c6935fe0 JavaThread "Bundle File Closer" daemon [_thread_blocked, id=20320, stack(0x0000008c46200000,0x0000008c46300000) (1024K)] - 0x00000222c6308ed0 JavaThread "SCR Component Actor" daemon [_thread_blocked, id=7620, stack(0x0000008c45f00000,0x0000008c46000000) (1024K)] - 0x00000222c69e9f00 JavaThread "Worker-JM" [_thread_blocked, id=11672, stack(0x0000008c46500000,0x0000008c46600000) (1024K)] - 0x00000222c6f69c30 JavaThread "JNA Cleaner" daemon [_thread_blocked, id=14656, stack(0x0000008c46300000,0x0000008c46400000) (1024K)] - 0x00000222c6ae6940 JavaThread "Worker-1" [_thread_blocked, id=14728, stack(0x0000008c46600000,0x0000008c46700000) (1024K)] - 0x00000222c6ae5590 JavaThread "Java indexing" daemon [_thread_blocked, id=10080, stack(0x0000008c46a00000,0x0000008c46b00000) (1024K)] - 0x00000222c6ae4f00 JavaThread "Thread-1" daemon [_thread_in_native, id=16092, stack(0x0000008c47100000,0x0000008c47200000) (1024K)] - 0x00000222c6ae5c20 JavaThread "Thread-2" daemon [_thread_in_native, id=16084, stack(0x0000008c47200000,0x0000008c47300000) (1024K)] - 0x00000222c9a7b390 JavaThread "Thread-3" daemon [_thread_in_native, id=16096, stack(0x0000008c47300000,0x0000008c47400000) (1024K)] - 0x00000222c9a7ad00 JavaThread "Thread-4" daemon [_thread_in_native, id=14492, stack(0x0000008c47400000,0x0000008c47500000) (1024K)] - 0x00000222c9a79fe0 JavaThread "Thread-5" daemon [_thread_in_native, id=20156, stack(0x0000008c47500000,0x0000008c47600000) (1024K)] - 0x00000222c9a7c0b0 JavaThread "Thread-6" daemon [_thread_in_native, id=19384, stack(0x0000008c47600000,0x0000008c47700000) (1024K)] - 0x00000222c9a7ba20 JavaThread "Thread-7" daemon [_thread_in_native, id=2892, stack(0x0000008c47700000,0x0000008c47800000) (1024K)] - 0x00000222c9a792c0 JavaThread "Thread-8" daemon [_thread_in_native, id=9892, stack(0x0000008c47800000,0x0000008c47900000) (1024K)] - 0x00000222c9a7c740 JavaThread "Thread-9" daemon [_thread_in_native, id=15064, stack(0x0000008c47900000,0x0000008c47a00000) (1024K)] - 0x00000222c9a7cdd0 JavaThread "Thread-10" daemon [_thread_in_native, id=14496, stack(0x0000008c47a00000,0x0000008c47b00000) (1024K)] - 0x00000222c9a7a670 JavaThread "Thread-11" daemon [_thread_in_native, id=15156, stack(0x0000008c47b00000,0x0000008c47c00000) (1024K)] - 0x00000222c9a79950 JavaThread "Thread-12" daemon [_thread_in_native, id=15152, stack(0x0000008c47c00000,0x0000008c47d00000) (1024K)] - 0x00000222c9a7f530 JavaThread "Thread-13" daemon [_thread_in_native, id=15076, stack(0x0000008c47d00000,0x0000008c47e00000) (1024K)] - 0x00000222c9a7e180 JavaThread "pool-2-thread-1" [_thread_blocked, id=20140, stack(0x0000008c47e00000,0x0000008c47f00000) (1024K)] - 0x00000222c9a7e810 JavaThread "WorkspaceEventsHandler" [_thread_blocked, id=19888, stack(0x0000008c47f00000,0x0000008c48000000) (1024K)] - 0x00000222c9a808e0 JavaThread "pool-1-thread-1" [_thread_blocked, id=3248, stack(0x0000008c48000000,0x0000008c48100000) (1024K)] - 0x00000222c9a63b90 JavaThread "Cleaner-0" daemon [_thread_blocked, id=12984, stack(0x0000008c4ac00000,0x0000008c4ad00000) (1024K)] - 0x00000222c6ae34c0 JavaThread "Java Debug Server" daemon [_thread_in_native, id=16376, stack(0x0000008c44500000,0x0000008c44600000) (1024K)] - 0x00000222c6ae3b50 JavaThread "RxSchedulerPurge-1" daemon [_thread_blocked, id=1324, stack(0x0000008c46800000,0x0000008c46900000) (1024K)] - 0x00000222c9cbcbd0 JavaThread "RxCachedWorkerPoolEvictor-1" daemon [_thread_blocked, id=16296, stack(0x0000008c46900000,0x0000008c46a00000) (1024K)] - 0x00000222c9cbe610 JavaThread "Worker-8" [_thread_blocked, id=4644, stack(0x0000008c44400000,0x0000008c44500000) (1024K)] -Total: 42 - -Other Threads: - 0x00000222e5bb1360 VMThread "VM Thread" [id=2920, stack(0x0000008c44900000,0x0000008c44a00000) (1024K)] - 0x00000222fe6aca00 WatcherThread "VM Periodic Task Thread" [id=9232, stack(0x0000008c44800000,0x0000008c44900000) (1024K)] - 0x00000222e5bb2920 WorkerThread "GC Thread#0" [id=12240, stack(0x0000008c44700000,0x0000008c44800000) (1024K)] - 0x00000222e5bb1aa0 WorkerThread "GC Thread#1" [id=19900, stack(0x0000008c45500000,0x0000008c45600000) (1024K)] - 0x00000222e5bb1e40 WorkerThread "GC Thread#2" [id=19916, stack(0x0000008c45600000,0x0000008c45700000) (1024K)] - 0x00000222e5bb21e0 WorkerThread "GC Thread#3" [id=20052, stack(0x0000008c45700000,0x0000008c45800000) (1024K)] - 0x00000222c64d8580 WorkerThread "GC Thread#4" [id=20176, stack(0x0000008c45800000,0x0000008c45900000) (1024K)] - 0x00000222c64d8cc0 WorkerThread "GC Thread#5" [id=19884, stack(0x0000008c45900000,0x0000008c45a00000) (1024K)] - 0x00000222c64da620 WorkerThread "GC Thread#6" [id=20228, stack(0x0000008c45a00000,0x0000008c45b00000) (1024K)] - 0x00000222c64d9060 WorkerThread "GC Thread#7" [id=20308, stack(0x0000008c45200000,0x0000008c45300000) (1024K)] - 0x00000222c64d7aa0 WorkerThread "GC Thread#8" [id=4608, stack(0x0000008c46000000,0x0000008c46100000) (1024K)] - 0x00000222c64d7700 WorkerThread "GC Thread#9" [id=5752, stack(0x0000008c46100000,0x0000008c46200000) (1024K)] -Total: 12 - -Threads with active compile tasks: -Total: 0 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap address: 0x0000000080000000, size: 2048 MB, Compressed Oops mode: 32-bit - -CDS archive(s) mapped at: [0x0000022280000000-0x0000022280ba0000-0x0000022280ba0000), size 12189696, SharedBaseAddress: 0x0000022280000000, ArchiveRelocationMode: 1. -Compressed class space mapped at: 0x0000022281000000-0x00000222c1000000, reserved size: 1073741824 -Narrow klass base: 0x0000022280000000, Narrow klass shift: 0, Narrow klass range: 0x100000000 - -GC Precious Log: - CardTable entry size: 512 - CPUs: 12 total, 12 available - Memory: 15681M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (32-bit) - Alignments: Space 512K, Generation 512K, Heap 2M - Heap Min Capacity: 100M - Heap Initial Capacity: 100M - Heap Max Capacity: 2G - Pre-touch: Disabled - Parallel Workers: 10 - -Heap: - PSYoungGen total 6656K, used 2752K [0x00000000d5580000, 0x00000000d5d80000, 0x0000000100000000) - eden space 5632K, 36% used [0x00000000d5580000,0x00000000d5780248,0x00000000d5b00000) - from space 1024K, 68% used [0x00000000d5c80000,0x00000000d5d30000,0x00000000d5d80000) - to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) - ParOldGen total 391680K, used 391660K [0x0000000080000000, 0x0000000097e80000, 0x00000000d5580000) - object space 391680K, 99% used [0x0000000080000000,0x0000000097e7b048,0x0000000097e80000) - Metaspace used 90985K, committed 92864K, reserved 1179648K - class space used 9789K, committed 10688K, reserved 1048576K - -Card table byte_map: [0x00000222f9ae0000,0x00000222f9ef0000] _byte_map_base: 0x00000222f96e0000 - -Marking Bits: (ParMarkBitMap*) 0x00007ffb44052460 - Begin Bits: [0x00000222fa1a0000, 0x00000222fc1a0000) - End Bits: [0x00000222fc1a0000, 0x00000222fe1a0000) - -Polling page: 0x00000222e5b70000 - -Metaspace: - -Usage: - Non-class: 79.29 MB used. - Class: 9.56 MB used. - Both: 88.85 MB used. - -Virtual space: - Non-class space: 128.00 MB reserved, 80.25 MB ( 63%) committed, 2 nodes. - Class space: 1.00 GB reserved, 10.44 MB ( 1%) committed, 1 nodes. - Both: 1.12 GB reserved, 90.69 MB ( 8%) committed. - -Chunk freelists: - Non-Class: 15.69 MB - Class: 5.39 MB - Both: 21.08 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 142.44 MB -CDS: on - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 9. -num_arena_births: 1770. -num_arena_deaths: 22. -num_vsnodes_births: 3. -num_vsnodes_deaths: 0. -num_space_committed: 1450. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 34. -num_chunks_taken_from_freelist: 6356. -num_chunk_merges: 18. -num_chunk_splits: 3842. -num_chunks_enlarged: 2063. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=120000Kb used=16506Kb max_used=16506Kb free=103493Kb - bounds [0x00000222f23c0000, 0x00000222f33e0000, 0x00000222f98f0000] -CodeHeap 'profiled nmethods': size=120000Kb used=44178Kb max_used=44178Kb free=75822Kb - bounds [0x00000222ea8f0000, 0x00000222ed420000, 0x00000222f1e20000] -CodeHeap 'non-nmethods': size=5760Kb used=1527Kb max_used=1597Kb free=4232Kb - bounds [0x00000222f1e20000, 0x00000222f2090000, 0x00000222f23c0000] -CodeCache: size=245760Kb, used=62211Kb, max_used=62281Kb, free=183547Kb - total_blobs=18491, nmethods=17631, adapters=763, full_count=0 -Compilation: enabled, stopped_count=0, restarted_count=0 - -Compilation events (20 events): -Event: 2812.929 Thread 0x00000222e5edbaf0 nmethod 19394 0x00000222ed412210 code [0x00000222ed4123c0, 0x00000222ed412508] -Event: 2812.938 Thread 0x00000222e5edbaf0 19395 2 org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope::findImport (394 bytes) -Event: 2812.940 Thread 0x00000222e5edbaf0 nmethod 19395 0x00000222ed412590 code [0x00000222ed412900, 0x00000222ed413960] -Event: 2812.961 Thread 0x00000222e5edbaf0 19397 3 java.util.concurrent.CompletableFuture::thenApply (7 bytes) -Event: 2812.961 Thread 0x00000222e5edbaf0 nmethod 19397 0x00000222ed414110 code [0x00000222ed4142c0, 0x00000222ed414408] -Event: 2812.965 Thread 0x00000222e5ecb7e0 nmethod 19387 0x00000222f33d2990 code [0x00000222f33d2ce0, 0x00000222f33d54b0] -Event: 2812.966 Thread 0x00000222e5ecb7e0 19396 4 sun.nio.fs.WindowsPath::getFileSystem (5 bytes) -Event: 2812.966 Thread 0x00000222e5ecb7e0 nmethod 19396 0x00000222f33d6790 code [0x00000222f33d6920, 0x00000222f33d69b0] -Event: 2812.966 Thread 0x00000222e5ecb7e0 19385 4 org.eclipse.jdt.internal.core.JavaProject::getElementName (10 bytes) -Event: 2812.968 Thread 0x00000222e5ecb7e0 nmethod 19385 0x00000222f33d6a90 code [0x00000222f33d6c40, 0x00000222f33d6d90] -Event: 2812.968 Thread 0x00000222e5ecb7e0 19398 ! 4 jdk.internal.reflect.MethodHandleAccessorFactory::newFieldAccessor (240 bytes) -Event: 2813.091 Thread 0x00000222e5ecb7e0 nmethod 19398 0x00000222f33d6f10 code [0x00000222f33d76c0, 0x00000222f33db058] -Event: 2813.091 Thread 0x00000222e5ecb7e0 19399 4 jdk.internal.reflect.ReflectionFactory::newFieldAccessor (93 bytes) -Event: 2813.094 Thread 0x00000222e5ecb7e0 nmethod 19399 0x00000222f33ddd90 code [0x00000222f33ddf40, 0x00000222f33de0d8] -Event: 2813.100 Thread 0x00000222e5edbaf0 19400 1 org.eclipse.lsp4j.ClientCapabilities::getWindow (5 bytes) -Event: 2813.101 Thread 0x00000222e5edbaf0 nmethod 19400 0x00000222f33de290 code [0x00000222f33de420, 0x00000222f33de4e8] -Event: 2813.103 Thread 0x00000222e5edbaf0 19401 3 org.eclipse.core.internal.resources.WorkManager::rebalanceNestedOperations (9 bytes) -Event: 2813.103 Thread 0x00000222e5edbaf0 nmethod 19401 0x00000222ed414490 code [0x00000222ed414620, 0x00000222ed414730] -Event: 2996.348 Thread 0x00000222e5ecb7e0 19402 ! 4 java.util.concurrent.locks.AbstractQueuedSynchronizer::tryInitializeHead (66 bytes) -Event: 2996.352 Thread 0x00000222e5ecb7e0 nmethod 19402 0x00000222f33de590 code [0x00000222f33de720, 0x00000222f33de910] - -GC Heap History (20 events): -Event: 2812.653 GC heap before -{Heap before GC invocations=713 (full 4): - PSYoungGen total 6656K, used 6260K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) - eden space 5632K, 99% used [0x00000000d5580000,0x00000000d5afffa8,0x00000000d5b00000) - from space 1024K, 61% used [0x00000000d5c00000,0x00000000d5c9d200,0x00000000d5d00000) - to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) - ParOldGen total 388608K, used 388305K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) - object space 388608K, 99% used [0x0000000080000000,0x0000000097b347e0,0x0000000097b80000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.655 GC heap after -{Heap after GC invocations=713 (full 4): - PSYoungGen total 6656K, used 404K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 1024K, 39% used [0x00000000d5b00000,0x00000000d5b65200,0x00000000d5c00000) - to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) - ParOldGen total 388608K, used 388409K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) - object space 388608K, 99% used [0x0000000080000000,0x0000000097b4e7e0,0x0000000097b80000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.676 GC heap before -{Heap before GC invocations=714 (full 4): - PSYoungGen total 6656K, used 6036K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 1024K, 39% used [0x00000000d5b00000,0x00000000d5b65200,0x00000000d5c00000) - to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) - ParOldGen total 388608K, used 388409K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) - object space 388608K, 99% used [0x0000000080000000,0x0000000097b4e7e0,0x0000000097b80000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.678 GC heap after -{Heap after GC invocations=714 (full 4): - PSYoungGen total 6144K, used 390K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 512K, 76% used [0x00000000d5c00000,0x00000000d5c61828,0x00000000d5c80000) - to space 512K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000d5c00000) - ParOldGen total 388608K, used 388505K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) - object space 388608K, 99% used [0x0000000080000000,0x0000000097b667e0,0x0000000097b80000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.692 GC heap before -{Heap before GC invocations=715 (full 4): - PSYoungGen total 6144K, used 6022K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 512K, 76% used [0x00000000d5c00000,0x00000000d5c61828,0x00000000d5c80000) - to space 512K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000d5c00000) - ParOldGen total 388608K, used 388505K [0x0000000080000000, 0x0000000097b80000, 0x00000000d5580000) - object space 388608K, 99% used [0x0000000080000000,0x0000000097b667e0,0x0000000097b80000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.693 GC heap after -{Heap after GC invocations=715 (full 4): - PSYoungGen total 6144K, used 378K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 512K, 73% used [0x00000000d5b80000,0x00000000d5bde900,0x00000000d5c00000) - to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) - ParOldGen total 389120K, used 388693K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) - object space 389120K, 99% used [0x0000000080000000,0x0000000097b95430,0x0000000097c00000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.703 GC heap before -{Heap before GC invocations=716 (full 4): - PSYoungGen total 6144K, used 6010K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 512K, 73% used [0x00000000d5b80000,0x00000000d5bde900,0x00000000d5c00000) - to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) - ParOldGen total 389120K, used 388693K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) - object space 389120K, 99% used [0x0000000080000000,0x0000000097b95430,0x0000000097c00000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.705 GC heap after -{Heap after GC invocations=716 (full 4): - PSYoungGen total 6144K, used 448K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 512K, 87% used [0x00000000d5c00000,0x00000000d5c70000,0x00000000d5c80000) - to space 512K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000d5c00000) - ParOldGen total 389120K, used 388757K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) - object space 389120K, 99% used [0x0000000080000000,0x0000000097ba5570,0x0000000097c00000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.887 GC heap before -{Heap before GC invocations=717 (full 4): - PSYoungGen total 6144K, used 6080K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 512K, 87% used [0x00000000d5c00000,0x00000000d5c70000,0x00000000d5c80000) - to space 512K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000d5c00000) - ParOldGen total 389120K, used 388757K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) - object space 389120K, 99% used [0x0000000080000000,0x0000000097ba5570,0x0000000097c00000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.888 GC heap after -{Heap after GC invocations=717 (full 4): - PSYoungGen total 6144K, used 512K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 512K, 100% used [0x00000000d5b80000,0x00000000d5c00000,0x00000000d5c00000) - to space 1024K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5d00000) - ParOldGen total 389120K, used 388957K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) - object space 389120K, 99% used [0x0000000080000000,0x0000000097bd7570,0x0000000097c00000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.903 GC heap before -{Heap before GC invocations=718 (full 4): - PSYoungGen total 6144K, used 6144K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 512K, 100% used [0x00000000d5b80000,0x00000000d5c00000,0x00000000d5c00000) - to space 1024K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5d00000) - ParOldGen total 389120K, used 388957K [0x0000000080000000, 0x0000000097c00000, 0x00000000d5580000) - object space 389120K, 99% used [0x0000000080000000,0x0000000097bd7570,0x0000000097c00000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.905 GC heap after -{Heap after GC invocations=718 (full 4): - PSYoungGen total 6656K, used 692K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 1024K, 67% used [0x00000000d5c00000,0x00000000d5cad200,0x00000000d5d00000) - to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) - ParOldGen total 389632K, used 389493K [0x0000000080000000, 0x0000000097c80000, 0x00000000d5580000) - object space 389632K, 99% used [0x0000000080000000,0x0000000097c5d570,0x0000000097c80000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.911 GC heap before -{Heap before GC invocations=719 (full 4): - PSYoungGen total 6656K, used 6324K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 1024K, 67% used [0x00000000d5c00000,0x00000000d5cad200,0x00000000d5d00000) - to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) - ParOldGen total 389632K, used 389493K [0x0000000080000000, 0x0000000097c80000, 0x00000000d5580000) - object space 389632K, 99% used [0x0000000080000000,0x0000000097c5d570,0x0000000097c80000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.912 GC heap after -{Heap after GC invocations=719 (full 4): - PSYoungGen total 6656K, used 160K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 1024K, 15% used [0x00000000d5b00000,0x00000000d5b28000,0x00000000d5c00000) - to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) - ParOldGen total 390144K, used 389869K [0x0000000080000000, 0x0000000097d00000, 0x00000000d5580000) - object space 390144K, 99% used [0x0000000080000000,0x0000000097cbb570,0x0000000097d00000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.920 GC heap before -{Heap before GC invocations=720 (full 4): - PSYoungGen total 6656K, used 5792K [0x00000000d5580000, 0x00000000d5c80000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 1024K, 15% used [0x00000000d5b00000,0x00000000d5b28000,0x00000000d5c00000) - to space 512K, 0% used [0x00000000d5c00000,0x00000000d5c00000,0x00000000d5c80000) - ParOldGen total 390144K, used 389869K [0x0000000080000000, 0x0000000097d00000, 0x00000000d5580000) - object space 390144K, 99% used [0x0000000080000000,0x0000000097cbb570,0x0000000097d00000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.922 GC heap after -{Heap after GC invocations=720 (full 4): - PSYoungGen total 6144K, used 500K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 512K, 97% used [0x00000000d5c00000,0x00000000d5c7d200,0x00000000d5c80000) - to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) - ParOldGen total 390656K, used 390218K [0x0000000080000000, 0x0000000097d80000, 0x00000000d5580000) - object space 390656K, 99% used [0x0000000080000000,0x0000000097d12848,0x0000000097d80000) - Metaspace used 90973K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.932 GC heap before -{Heap before GC invocations=721 (full 4): - PSYoungGen total 6144K, used 6132K [0x00000000d5580000, 0x00000000d5d00000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 512K, 97% used [0x00000000d5c00000,0x00000000d5c7d200,0x00000000d5c80000) - to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) - ParOldGen total 390656K, used 390218K [0x0000000080000000, 0x0000000097d80000, 0x00000000d5580000) - object space 390656K, 99% used [0x0000000080000000,0x0000000097d12848,0x0000000097d80000) - Metaspace used 90975K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.934 GC heap after -{Heap after GC invocations=721 (full 4): - PSYoungGen total 6656K, used 1012K [0x00000000d5580000, 0x00000000d5e00000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 1024K, 98% used [0x00000000d5b00000,0x00000000d5bfd200,0x00000000d5c00000) - to space 1536K, 0% used [0x00000000d5c80000,0x00000000d5c80000,0x00000000d5e00000) - ParOldGen total 391168K, used 390747K [0x0000000080000000, 0x0000000097e00000, 0x00000000d5580000) - object space 391168K, 99% used [0x0000000080000000,0x0000000097d96c48,0x0000000097e00000) - Metaspace used 90975K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.942 GC heap before -{Heap before GC invocations=722 (full 4): - PSYoungGen total 6656K, used 6644K [0x00000000d5580000, 0x00000000d5e00000, 0x0000000100000000) - eden space 5632K, 100% used [0x00000000d5580000,0x00000000d5b00000,0x00000000d5b00000) - from space 1024K, 98% used [0x00000000d5b00000,0x00000000d5bfd200,0x00000000d5c00000) - to space 1536K, 0% used [0x00000000d5c80000,0x00000000d5c80000,0x00000000d5e00000) - ParOldGen total 391168K, used 390747K [0x0000000080000000, 0x0000000097e00000, 0x00000000d5580000) - object space 391168K, 99% used [0x0000000080000000,0x0000000097d96c48,0x0000000097e00000) - Metaspace used 90975K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} -Event: 2812.944 GC heap after -{Heap after GC invocations=722 (full 4): - PSYoungGen total 6656K, used 704K [0x00000000d5580000, 0x00000000d5d80000, 0x0000000100000000) - eden space 5632K, 0% used [0x00000000d5580000,0x00000000d5580000,0x00000000d5b00000) - from space 1024K, 68% used [0x00000000d5c80000,0x00000000d5d30000,0x00000000d5d80000) - to space 1024K, 0% used [0x00000000d5b00000,0x00000000d5b00000,0x00000000d5c00000) - ParOldGen total 391680K, used 391660K [0x0000000080000000, 0x0000000097e80000, 0x00000000d5580000) - object space 391680K, 99% used [0x0000000080000000,0x0000000097e7b048,0x0000000097e80000) - Metaspace used 90975K, committed 92864K, reserved 1179648K - class space used 9788K, committed 10688K, reserved 1048576K -} - -Dll operation events (11 events): -Event: 0.040 Loaded shared library c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.dll -Event: 0.264 Loaded shared library c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\zip.dll -Event: 0.314 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\instrument.dll -Event: 0.325 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\net.dll -Event: 0.331 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\nio.dll -Event: 0.340 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\zip.dll -Event: 0.382 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jimage.dll -Event: 0.622 Loaded shared library c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\verify.dll -Event: 21.186 Loaded shared library C:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win\org.eclipse.equinox.launcher\org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.1400.v20250801-0854\eclipse_11916.dll -Event: 46.251 Loaded shared library C:\Users\Mustapha\AppData\Local\Temp\jna-918639377\jna14061272421266381748.dll -Event: 488.147 Loaded shared library C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\extnet.dll - -Deoptimization events (20 events): -Event: 2812.897 Thread 0x00000222c9cbbeb0 DEOPT PACKING pc=0x00000222f33b24b0 sp=0x0000008c443fe1d0 -Event: 2812.897 Thread 0x00000222c9cbbeb0 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c443fe1b8 mode 2 -Event: 2812.897 Thread 0x00000222c9cbab00 DEOPT PACKING pc=0x00000222f33b24b0 sp=0x0000008c46bfe310 -Event: 2812.897 Thread 0x00000222c9cbab00 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c46bfe2f8 mode 2 -Event: 2812.902 Thread 0x00000222c9cbab00 Uncommon trap: trap_request=0xffffffc6 fr.pc=0x00000222f336439c relative=0x0000000000002c3c -Event: 2812.902 Thread 0x00000222c9cbab00 Uncommon trap: reason=bimorphic_or_optimized_type_check action=maybe_recompile pc=0x00000222f336439c method=org.eclipse.jdt.internal.core.BinaryMethod.isConstructor()Z @ 28 c2 -Event: 2812.902 Thread 0x00000222c9cbab00 DEOPT PACKING pc=0x00000222f336439c sp=0x0000008c46bfe380 -Event: 2812.903 Thread 0x00000222c9cbab00 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c46bfe298 mode 2 -Event: 2812.909 Thread 0x00000222c9cbab00 Uncommon trap: trap_request=0xffffffc6 fr.pc=0x00000222f33b24b0 relative=0x0000000000001e90 -Event: 2812.909 Thread 0x00000222c9cbbeb0 Uncommon trap: trap_request=0xffffffc6 fr.pc=0x00000222f33b24b0 relative=0x0000000000001e90 -Event: 2812.909 Thread 0x00000222c9cbab00 Uncommon trap: reason=bimorphic_or_optimized_type_check action=maybe_recompile pc=0x00000222f33b24b0 method=org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport([[CI)Lorg/eclipse/jdt/internal/compiler/lookup/Binding; @ 297 c2 -Event: 2812.909 Thread 0x00000222c9cbbeb0 Uncommon trap: reason=bimorphic_or_optimized_type_check action=maybe_recompile pc=0x00000222f33b24b0 method=org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport([[CI)Lorg/eclipse/jdt/internal/compiler/lookup/Binding; @ 297 c2 -Event: 2812.909 Thread 0x00000222c9cbab00 DEOPT PACKING pc=0x00000222f33b24b0 sp=0x0000008c46bfe270 -Event: 2812.909 Thread 0x00000222c9cbbeb0 DEOPT PACKING pc=0x00000222f33b24b0 sp=0x0000008c443fe130 -Event: 2812.909 Thread 0x00000222c9cbbeb0 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c443fe118 mode 2 -Event: 2812.909 Thread 0x00000222c9cbab00 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c46bfe258 mode 2 -Event: 2812.965 Thread 0x00000222c9cbbeb0 Uncommon trap: trap_request=0xffffffde fr.pc=0x00000222f25778cc relative=0x00000000000000ac -Event: 2812.965 Thread 0x00000222c9cbbeb0 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000222f25778cc method=jdk.internal.util.StrongReferenceKey.equals(Ljava/lang/Object;)Z @ 1 c2 -Event: 2812.965 Thread 0x00000222c9cbbeb0 DEOPT PACKING pc=0x00000222f25778cc sp=0x0000008c443fd370 -Event: 2812.965 Thread 0x00000222c9cbbeb0 DEOPT UNPACKING pc=0x00000222f1e73aa2 sp=0x0000008c443fd2f8 mode 2 - -Classes loaded (20 events): -Event: 567.036 Loading class java/util/stream/ReferencePipeline$15 -Event: 567.036 Loading class java/util/stream/ReferencePipeline$15 done -Event: 567.037 Loading class java/util/stream/ReferencePipeline$15$1 -Event: 567.037 Loading class java/util/stream/ReferencePipeline$15$1 done -Event: 571.969 Loading class java/util/function/IntBinaryOperator -Event: 571.970 Loading class java/util/function/IntBinaryOperator done -Event: 571.970 Loading class java/util/stream/ReduceOps$6 -Event: 571.970 Loading class java/util/stream/ReduceOps$6 done -Event: 571.970 Loading class java/util/stream/ReduceOps$5ReducingSink -Event: 571.971 Loading class java/util/stream/ReduceOps$5ReducingSink done -Event: 581.850 Loading class java/util/concurrent/CompletableFuture$AsyncSupply -Event: 581.850 Loading class java/util/concurrent/CompletableFuture$AsyncSupply done -Event: 2204.255 Loading class java/lang/StringLatin1$CharsSpliterator -Event: 2204.255 Loading class java/lang/StringLatin1$CharsSpliterator done -Event: 2205.415 Loading class java/util/function/IntPredicate -Event: 2205.415 Loading class java/util/function/IntPredicate done -Event: 2205.469 Loading class java/util/regex/Pattern$Bound -Event: 2205.469 Loading class java/util/regex/Pattern$Bound done -Event: 2812.503 Loading class java/net/HttpURLConnection -Event: 2812.504 Loading class java/net/HttpURLConnection done - -Classes unloaded (11 events): -Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811ab400 'java/lang/invoke/LambdaForm$MH+0x00000222811ab400' -Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811ab000 'java/lang/invoke/LambdaForm$MH+0x00000222811ab000' -Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811aac00 'java/lang/invoke/LambdaForm$MH+0x00000222811aac00' -Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811aa800 'java/lang/invoke/LambdaForm$MH+0x00000222811aa800' -Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811aa400 'java/lang/invoke/LambdaForm$BMH+0x00000222811aa400' -Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811aa000 'java/lang/invoke/LambdaForm$DMH+0x00000222811aa000' -Event: 47.108 Thread 0x00000222e5bb1360 Unloading class 0x00000222811a8c00 'java/lang/invoke/LambdaForm$DMH+0x00000222811a8c00' -Event: 549.607 Thread 0x00000222e5bb1360 Unloading class 0x0000022281779000 'java/lang/invoke/LambdaForm$DMH+0x0000022281779000' -Event: 549.607 Thread 0x00000222e5bb1360 Unloading class 0x0000022281778c00 'java/lang/invoke/LambdaForm$DMH+0x0000022281778c00' -Event: 549.607 Thread 0x00000222e5bb1360 Unloading class 0x0000022281778800 'java/lang/invoke/LambdaForm$DMH+0x0000022281778800' -Event: 549.607 Thread 0x00000222e5bb1360 Unloading class 0x0000022281778400 'java/lang/invoke/LambdaForm$DMH+0x0000022281778400' - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 2812.417 Thread 0x00000222c9cbbeb0 Exception (0x00000000d58a7080) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.417 Thread 0x00000222c9cbbeb0 Exception (0x00000000d58a7980) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.444 Thread 0x00000222c9cbbeb0 Exception (0x00000000d56c9830) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.444 Thread 0x00000222c9cbbeb0 Exception (0x00000000d56ca130) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.456 Thread 0x00000222c9cbbeb0 Exception (0x00000000d59a2220) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.456 Thread 0x00000222c9cbbeb0 Exception (0x00000000d59a2b20) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.501 Thread 0x00000222c9cbbeb0 Implicit null exception at 0x00000222f33197d3 to 0x00000222f331b144 -Event: 2812.539 Thread 0x00000222c9cbbeb0 Exception (0x00000000d5682c30) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.539 Thread 0x00000222c9cbbeb0 Exception (0x00000000d5683530) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.621 Thread 0x00000222c9cbb190 Implicit null exception at 0x00000222f3171444 to 0x00000222f317437c -Event: 2812.622 Thread 0x00000222c9cbb190 Exception (0x00000000d56db3a8) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.622 Thread 0x00000222c9cbb190 Exception (0x00000000d56dbca8) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.636 Thread 0x00000222c9cbb190 Exception (0x00000000d58fb690) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.637 Thread 0x00000222c9cbb190 Exception (0x00000000d58fbf90) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.710 Thread 0x00000222c9cbb190 Exception (0x00000000d56c45a0) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.710 Thread 0x00000222c9cbb190 Exception (0x00000000d56c4ea0) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.945 Thread 0x00000222c9cbab00 Exception (0x00000000d562c7c8) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.945 Thread 0x00000222c9cbbeb0 Exception (0x00000000d5622140) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.945 Thread 0x00000222c9cbab00 Exception (0x00000000d562d0c8) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] -Event: 2812.945 Thread 0x00000222c9cbbeb0 Exception (0x00000000d5622a40) -thrown [s\src\hotspot\share\prims\jni.cpp, line 520] - -ZGC Phase Switch (0 events): -No events - -VM Operations (20 events): -Event: 2812.942 Executing VM operation: ParallelGCFailedAllocation (Allocation Failure) -Event: 2812.944 Executing VM operation: ParallelGCFailedAllocation (Allocation Failure) done -Event: 2813.952 Executing VM operation: Cleanup -Event: 2813.952 Executing VM operation: Cleanup done -Event: 2826.119 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) -Event: 2826.119 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done -Event: 2826.119 Executing VM operation: RendezvousGCThreads -Event: 2826.119 Executing VM operation: RendezvousGCThreads done -Event: 2886.245 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) -Event: 2886.245 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done -Event: 2886.245 Executing VM operation: RendezvousGCThreads -Event: 2886.245 Executing VM operation: RendezvousGCThreads done -Event: 2946.367 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) -Event: 2946.367 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done -Event: 2946.367 Executing VM operation: RendezvousGCThreads -Event: 2946.367 Executing VM operation: RendezvousGCThreads done -Event: 3006.465 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) -Event: 3006.465 Executing VM operation: HandshakeAllThreads (HandshakeForDeflation) done -Event: 3006.465 Executing VM operation: RendezvousGCThreads -Event: 3006.465 Executing VM operation: RendezvousGCThreads done - -Memory protections (0 events): -No events - -Nmethod flushes (20 events): -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb79b910 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb79cb10 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7a0990 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7b2690 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7b5010 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7be710 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb7dbf10 -Event: 549.750 Thread 0x00000222e5bb1360 flushing osr nmethod 0x00000222eb7dc390 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb80ae90 -Event: 549.750 Thread 0x00000222e5bb1360 flushing osr nmethod 0x00000222eb80b490 -Event: 549.750 Thread 0x00000222e5bb1360 flushing osr nmethod 0x00000222eb813610 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb83ae10 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb84cf10 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb854d10 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb85c110 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb861d10 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb87c690 -Event: 549.750 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb89ad10 -Event: 549.751 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb92cb10 -Event: 549.751 Thread 0x00000222e5bb1360 flushing nmethod 0x00000222eb92d390 - -Events (20 events): -Event: 2386.274 Thread 0x00000222c9cbab00 Thread exited: 0x00000222c9cbab00 -Event: 2446.276 Thread 0x00000222c9cbdf80 Thread exited: 0x00000222c9cbdf80 -Event: 2506.276 Thread 0x00000222c9cbd260 Thread exited: 0x00000222c9cbd260 -Event: 2566.285 Thread 0x00000222c9cba470 Thread exited: 0x00000222c9cba470 -Event: 2796.136 Thread 0x00000222c9a808e0 Thread added: 0x00000222c9cbbeb0 -Event: 2799.852 Thread 0x00000222c9cbe610 Thread added: 0x00000222c9cb9750 -Event: 2801.116 Thread 0x00000222e5edbaf0 Thread added: 0x00000222d559f660 -Event: 2801.626 Thread 0x00000222e5edbaf0 Thread added: 0x00000222d55a33b0 -Event: 2807.678 Thread 0x00000222d55a33b0 Thread exited: 0x00000222d55a33b0 -Event: 2807.695 Thread 0x00000222d559f660 Thread exited: 0x00000222d559f660 -Event: 2809.131 Thread 0x00000222e5edbaf0 Thread added: 0x00000222c89c41c0 -Event: 2812.080 Thread 0x00000222c9a808e0 Thread added: 0x00000222c9cbab00 -Event: 2812.502 Thread 0x00000222c9cbbeb0 Thread added: 0x00000222c9cbb190 -Event: 2812.509 Thread 0x00000222c9cbb190 Thread exited: 0x00000222c9cbb190 -Event: 2812.559 Thread 0x00000222c9a808e0 Thread added: 0x00000222c9cbb190 -Event: 2812.877 Thread 0x00000222c89c41c0 Thread exited: 0x00000222c89c41c0 -Event: 2859.857 Thread 0x00000222c9cb9750 Thread exited: 0x00000222c9cb9750 -Event: 2872.992 Thread 0x00000222c9cbab00 Thread exited: 0x00000222c9cbab00 -Event: 2932.999 Thread 0x00000222c9cbbeb0 Thread exited: 0x00000222c9cbbeb0 -Event: 2993.005 Thread 0x00000222c9cbb190 Thread exited: 0x00000222c9cbb190 - - -Dynamic libraries: -0x00007ff639630000 - 0x00007ff63963e000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.exe -0x00007ffbe2be0000 - 0x00007ffbe2e47000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ffbe17e0000 - 0x00007ffbe18a9000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ffbe0170000 - 0x00007ffbe055f000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ffbe05a0000 - 0x00007ffbe06eb000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffb49350000 - 0x00007ffb49368000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jli.dll -0x00007ffbe14d0000 - 0x00007ffbe1695000 C:\WINDOWS\System32\USER32.dll -0x00007ffbe0570000 - 0x00007ffbe0597000 C:\WINDOWS\System32\win32u.dll -0x00007ffbe1370000 - 0x00007ffbe139b000 C:\WINDOWS\System32\GDI32.dll -0x00007ffb49370000 - 0x00007ffb4938e000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\VCRUNTIME140.dll -0x00007ffbe06f0000 - 0x00007ffbe081c000 C:\WINDOWS\System32\gdi32full.dll -0x00007ffbe0820000 - 0x00007ffbe08c3000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ffbbd980000 - 0x00007ffbbdc13000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll -0x00007ffbe1420000 - 0x00007ffbe14c9000 C:\WINDOWS\System32\msvcrt.dll -0x00007ffbe16a0000 - 0x00007ffbe16d1000 C:\WINDOWS\System32\IMM32.DLL -0x00007ffbd5760000 - 0x00007ffbd576c000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\vcruntime140_1.dll -0x00007ffb817a0000 - 0x00007ffb8182d000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\msvcp140.dll -0x00007ffb43390000 - 0x00007ffb44130000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\server\jvm.dll -0x00007ffbe19f0000 - 0x00007ffbe1aa4000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ffbe1940000 - 0x00007ffbe19e6000 C:\WINDOWS\System32\sechost.dll -0x00007ffbe1150000 - 0x00007ffbe1268000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ffbe13a0000 - 0x00007ffbe1414000 C:\WINDOWS\System32\WS2_32.dll -0x00007ffbdfb90000 - 0x00007ffbdfbee000 C:\WINDOWS\SYSTEM32\POWRPROF.dll -0x00007ffbd8980000 - 0x00007ffbd898b000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ffbd8940000 - 0x00007ffbd8975000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ffbdfb70000 - 0x00007ffbdfb84000 C:\WINDOWS\SYSTEM32\UMPDC.dll -0x00007ffbdeaa0000 - 0x00007ffbdeabb000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll -0x00007ffbd5750000 - 0x00007ffbd575a000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jimage.dll -0x00007ffbd1710000 - 0x00007ffbd1952000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL -0x00007ffbe2690000 - 0x00007ffbe2a16000 C:\WINDOWS\System32\combase.dll -0x00007ffbe0fc0000 - 0x00007ffbe1096000 C:\WINDOWS\System32\OLEAUT32.dll -0x00007ffbc4b30000 - 0x00007ffbc4b6c000 C:\WINDOWS\SYSTEM32\dbgcore.DLL -0x00007ffbe08d0000 - 0x00007ffbe0975000 C:\WINDOWS\System32\bcryptPrimitives.dll -0x00007ffbd5620000 - 0x00007ffbd562f000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\instrument.dll -0x00007ffbaefb0000 - 0x00007ffbaefd0000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.dll -0x00007ffbe1f30000 - 0x00007ffbe2683000 C:\WINDOWS\System32\SHELL32.dll -0x00007ffbdfd30000 - 0x00007ffbdfe9a000 C:\WINDOWS\System32\wintypes.dll -0x00007ffbdd8f0000 - 0x00007ffbde14e000 C:\WINDOWS\SYSTEM32\windows.storage.dll -0x00007ffbe1ab0000 - 0x00007ffbe1ba5000 C:\WINDOWS\System32\SHCORE.dll -0x00007ffbe1300000 - 0x00007ffbe1366000 C:\WINDOWS\System32\shlwapi.dll -0x00007ffbdfc50000 - 0x00007ffbdfc79000 C:\WINDOWS\SYSTEM32\profapi.dll -0x00007ffbaef90000 - 0x00007ffbaefa8000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\zip.dll -0x00007ffbd3760000 - 0x00007ffbd3770000 C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\net.dll -0x00007ffbd5a80000 - 0x00007ffbd5ba8000 C:\WINDOWS\SYSTEM32\WINHTTP.dll -0x00007ffbdeff0000 - 0x00007ffbdf05b000 C:\WINDOWS\system32\mswsock.dll -0x00007ffb49120000 - 0x00007ffb49136000 C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\nio.dll -0x00007ffbc4510000 - 0x00007ffbc4520000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\verify.dll -0x00007ffba66c0000 - 0x00007ffba6704000 C:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win\org.eclipse.equinox.launcher\org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.1400.v20250801-0854\eclipse_11916.dll -0x00007ffbe1d90000 - 0x00007ffbe1f27000 C:\WINDOWS\System32\ole32.dll -0x00007ffbdf3e0000 - 0x00007ffbdf3fb000 C:\WINDOWS\SYSTEM32\CRYPTSP.dll -0x00007ffbdea00000 - 0x00007ffbdea3a000 C:\WINDOWS\system32\rsaenh.dll -0x00007ffbdf0a0000 - 0x00007ffbdf0cb000 C:\WINDOWS\SYSTEM32\USERENV.dll -0x00007ffbdfc20000 - 0x00007ffbdfc4a000 C:\WINDOWS\SYSTEM32\bcrypt.dll -0x00007ffbdf240000 - 0x00007ffbdf24c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll -0x00007ffbde490000 - 0x00007ffbde4c4000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL -0x00007ffbe0a50000 - 0x00007ffbe0a5a000 C:\WINDOWS\System32\NSI.dll -0x00007ffbd3770000 - 0x00007ffbd37b9000 C:\Users\Mustapha\AppData\Local\Temp\jna-918639377\jna14061272421266381748.dll -0x00007ffbe2b90000 - 0x00007ffbe2b98000 C:\WINDOWS\System32\PSAPI.DLL -0x00007ffbd5d40000 - 0x00007ffbd5d5e000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL -0x00007ffbd5d10000 - 0x00007ffbd5d33000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL -0x00007ffbae200000 - 0x00007ffbae209000 C:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\extnet.dll - -JVMTI agents: -c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar path:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\instrument.dll, loaded, initialized, instrumentlib options:none - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\server;C:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win\org.eclipse.equinox.launcher\org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.1400.v20250801-0854;C:\Users\Mustapha\AppData\Local\Temp\jna-918639377 - -VM Arguments: -jvm_args: --add-modules=ALL-SYSTEM --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -javaagent:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java -Daether.dependencyCollector.impl=bf -java_command: c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -configuration c:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win -data c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java\jdt_ws --pipe=\\.\pipe\lsp-3417bb743ec522de09de7b6008ec2ba1-sock -java_class_path (initial): c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -Launcher Type: SUN_STANDARD - -[Global flags] - uintx AdaptiveSizePolicyWeight = 90 {product} {command line} - intx CICompilerCount = 4 {product} {ergonomic} - uintx GCTimeRatio = 4 {product} {command line} - bool HeapDumpOnOutOfMemoryError = true {manageable} {command line} - ccstr HeapDumpPath = c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java {manageable} {command line} - size_t InitialHeapSize = 104857600 {product} {command line} - size_t MaxHeapSize = 2147483648 {product} {command line} - size_t MaxNewSize = 715653120 {product} {ergonomic} - size_t MinHeapDeltaBytes = 524288 {product} {ergonomic} - size_t MinHeapSize = 104857600 {product} {command line} - size_t NewSize = 34603008 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839372 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} - size_t OldSize = 70254592 {product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 2147483648 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - bool UseParallelGC = true {product} {command line} - -Logging: -Log output configuration: - #0: stdout all=off uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Release file: -JAVA_VERSION="21.0.9" -MODULES="java.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.jvmstat jdk.attach jdk.charsets jdk.internal.opt jdk.zipfs jdk.compiler jdk.crypto.ec jdk.crypto.cryptoki jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.hotspot.agent jdk.httpserver jdk.internal.le jdk.internal.vm.ci jdk.internal.vm.compiler jdk.internal.vm.compiler.management jdk.jartool jdk.javadoc jdk.jcmd jdk.management jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.nio.mapmode jdk.random jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported jdk.unsupported.desktop jdk.xml.dom" - -Environment Variables: -JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 -PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm -USERNAME=Mustapha -OS=Windows_NT -PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD -TMP=C:\Users\Mustapha\AppData\Local\Temp -TEMP=C:\Users\Mustapha\AppData\Local\Temp - - - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: - Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -OS uptime: 0 days 0:53 hours -Hyper-V role detected - -CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss -Processor Information for the first 12 processors : - Max Mhz: 2301, Current Mhz: 1990, Mhz Limit: 2301 - -Memory: 4k page, system-wide physical 15681M (4912M free) -TotalPageFile size 23873M (AvailPageFile size 3M) -current process WorkingSet (physical memory assigned to process): 403M, peak: 585M -current process commit charge ("private bytes"): 775M, peak: 777M - -vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-21T00:00:00Z by "admin" with unknown MS VC++:1942 - -END. diff --git a/hs_err_pid16588.log b/hs_err_pid16588.log deleted file mode 100644 index 3d52d05..0000000 --- a/hs_err_pid16588.log +++ /dev/null @@ -1,814 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (mmap) failed to map 236978176 bytes. Error detail: G1 virtual space -# Possible reasons: -# The system is out of physical RAM or swap space -# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Zero Based Compressed Oops mode in which the Java heap is -# placed in the first 32GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 32GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (os_windows.cpp:3716), pid=16588, tid=14856 -# -# JRE version: OpenJDK Runtime Environment Microsoft-12574459 (21.0.9+10) (build 21.0.9+10-LTS) -# Java VM: OpenJDK 64-Bit Server VM Microsoft-12574459 (21.0.9+10-LTS, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: -XX:TieredStopAtLevel=1 fr.codecake.airbnbclone.NbatCloneBackApplication - -Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -Time: Wed Jan 28 22:40:57 2026 Morocco Daylight Time elapsed time: 18089.733494 seconds (0d 5h 1m 29s) - ---------------- T H R E A D --------------- - -Current thread (0x0000023f746dfda0): VMThread "VM Thread" [id=14856, stack(0x000000b5d2200000,0x000000b5d2300000) (1024K)] - -Stack: [0x000000b5d2200000,0x000000b5d2300000] -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6df259] (no source info available) -V [jvm.dll+0x8bfe4b] (no source info available) -V [jvm.dll+0x8c23da] (no source info available) -V [jvm.dll+0x8c2ab3] (no source info available) -V [jvm.dll+0x28a416] (no source info available) -V [jvm.dll+0x6de705] (no source info available) -V [jvm.dll+0x6d264a] (no source info available) -V [jvm.dll+0x36742e] (no source info available) -V [jvm.dll+0x36f2fb] (no source info available) -V [jvm.dll+0x3c0c99] (no source info available) -V [jvm.dll+0x3c0f3b] (no source info available) -V [jvm.dll+0x33ace7] (no source info available) -V [jvm.dll+0x33ad77] (no source info available) -V [jvm.dll+0x37fb6c] (no source info available) -V [jvm.dll+0x37e34e] (no source info available) -V [jvm.dll+0x33a441] (no source info available) -V [jvm.dll+0x37d9ba] (no source info available) -V [jvm.dll+0x8c881f] (no source info available) -V [jvm.dll+0x8c9d2c] (no source info available) -V [jvm.dll+0x8ca2a4] (no source info available) -V [jvm.dll+0x8ca3a3] (no source info available) -V [jvm.dll+0x869f7d] (no source info available) -V [jvm.dll+0x6e080d] (no source info available) -C [ucrtbase.dll+0x37b0] (no source info available) -C [KERNEL32.DLL+0x2e8d7] (no source info available) -C [ntdll.dll+0x8c53c] (no source info available) - -VM_Operation (0x000000b5d2afb190): G1CollectForAllocation, mode: safepoint, requested by thread 0x0000023f7c8c31c0 - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x0000023f7c69afd0, length=32, elements={ -0x0000023f746fdf80, 0x0000023f746ff150, 0x0000023f74706800, 0x0000023f7470a230, -0x0000023f7470ff80, 0x0000023f747105e0, 0x0000023f74724560, 0x0000023f74886d20, -0x0000023f74895580, 0x0000023f7b045b50, 0x0000023f7c6a0220, 0x0000023f7c908420, -0x0000023f7c908ab0, 0x0000023f7c907d90, 0x0000023f7c9097d0, 0x0000023f7c90a4f0, -0x0000023f7c69c710, 0x0000023f7c909e60, 0x0000023f7b044110, 0x0000023f7c69d430, -0x0000023f7c6a0f40, 0x0000023f7c8c3ee0, 0x0000023f7c8c31c0, 0x0000023f7cf71150, -0x0000023f7c8c4570, 0x0000023f7cf6fce0, 0x0000023f7cf6dad0, 0x0000023f7c8c10f0, -0x0000023f7c8c5920, 0x0000023f7c8c7360, 0x0000023f7c8c8710, 0x0000023f7c8c5fb0 -} - -Java Threads: ( => current thread ) - 0x0000023f746fdf80 JavaThread "Reference Handler" daemon [_thread_blocked, id=6476, stack(0x000000b5d2300000,0x000000b5d2400000) (1024K)] - 0x0000023f746ff150 JavaThread "Finalizer" daemon [_thread_blocked, id=8188, stack(0x000000b5d2400000,0x000000b5d2500000) (1024K)] - 0x0000023f74706800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=15196, stack(0x000000b5d2500000,0x000000b5d2600000) (1024K)] - 0x0000023f7470a230 JavaThread "Attach Listener" daemon [_thread_blocked, id=2400, stack(0x000000b5d2600000,0x000000b5d2700000) (1024K)] - 0x0000023f7470ff80 JavaThread "Service Thread" daemon [_thread_blocked, id=15348, stack(0x000000b5d2700000,0x000000b5d2800000) (1024K)] - 0x0000023f747105e0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=4080, stack(0x000000b5d2800000,0x000000b5d2900000) (1024K)] - 0x0000023f74724560 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=14832, stack(0x000000b5d2900000,0x000000b5d2a00000) (1024K)] - 0x0000023f74886d20 JavaThread "Notification Thread" daemon [_thread_blocked, id=15892, stack(0x000000b5d2b00000,0x000000b5d2c00000) (1024K)] - 0x0000023f74895580 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=9904, stack(0x000000b5d2c00000,0x000000b5d2d00000) (1024K)] - 0x0000023f7b045b50 JavaThread "Live Reload Server" daemon [_thread_in_native, id=7064, stack(0x000000b5d4600000,0x000000b5d4700000) (1024K)] - 0x0000023f7c6a0220 JavaThread "DestroyJavaVM" [_thread_blocked, id=1608, stack(0x000000b5d1b00000,0x000000b5d1c00000) (1024K)] - 0x0000023f7c908420 JavaThread "File Watcher" daemon [_thread_blocked, id=10340, stack(0x000000b5d1900000,0x000000b5d1a00000) (1024K)] - 0x0000023f7c908ab0 JavaThread "File Watcher" daemon [_thread_blocked, id=12424, stack(0x000000b5d2d00000,0x000000b5d2e00000) (1024K)] - 0x0000023f7c907d90 JavaThread "File Watcher" daemon [_thread_blocked, id=5796, stack(0x000000b5d2e00000,0x000000b5d2f00000) (1024K)] - 0x0000023f7c9097d0 JavaThread "File Watcher" daemon [_thread_blocked, id=13052, stack(0x000000b5d1a00000,0x000000b5d1b00000) (1024K)] - 0x0000023f7c90a4f0 JavaThread "File Watcher" daemon [_thread_blocked, id=4188, stack(0x000000b5d3300000,0x000000b5d3400000) (1024K)] - 0x0000023f7c69c710 JavaThread "File Watcher" daemon [_thread_blocked, id=20892, stack(0x000000b5d3800000,0x000000b5d3900000) (1024K)] - 0x0000023f7c909e60 JavaThread "File Watcher" daemon [_thread_blocked, id=2912, stack(0x000000b5d3400000,0x000000b5d3500000) (1024K)] - 0x0000023f7b044110 JavaThread "File Watcher" daemon [_thread_blocked, id=20492, stack(0x000000b5d3900000,0x000000b5d3a00000) (1024K)] - 0x0000023f7c69d430 JavaThread "PostgreSQL-JDBC-Cleaner" daemon [_thread_blocked, id=10248, stack(0x000000b5d4300000,0x000000b5d4400000) (1024K)] - 0x0000023f7c6a0f40 JavaThread "File Watcher" daemon [_thread_blocked, id=19220, stack(0x000000b5d4000000,0x000000b5d4100000) (1024K)] - 0x0000023f7c8c3ee0 JavaThread "Thread-62" [_thread_blocked, id=10452, stack(0x000000b5d1800000,0x000000b5d1900000) (1024K)] - 0x0000023f7c8c31c0 JavaThread "restartedMain" [_thread_blocked, id=19204, stack(0x000000b5d2a00000,0x000000b5d2b00000) (1024K)] - 0x0000023f7cf71150 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=6796, stack(0x000000b5d3f00000,0x000000b5d4000000) (1024K)] - 0x0000023f7c8c4570 JavaThread "Keep-Alive-Timer" daemon [_thread_blocked, id=6764, stack(0x000000b5d4100000,0x000000b5d4200000) (1024K)] - 0x0000023f7cf6fce0 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=11828, stack(0x000000b5d4200000,0x000000b5d4300000) (1024K)] - 0x0000023f7cf6dad0 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=9084, stack(0x000000b5d4400000,0x000000b5d4500000) (1024K)] - 0x0000023f7c8c10f0 JavaThread "Catalina-utility-1" [_thread_blocked, id=10336, stack(0x000000b5d4500000,0x000000b5d4600000) (1024K)] - 0x0000023f7c8c5920 JavaThread "Catalina-utility-2" [_thread_blocked, id=18808, stack(0x000000b5d4700000,0x000000b5d4800000) (1024K)] - 0x0000023f7c8c7360 JavaThread "container-9" [_thread_blocked, id=19136, stack(0x000000b5d4800000,0x000000b5d4900000) (1024K)] - 0x0000023f7c8c8710 JavaThread "Hikari housekeeper" daemon [_thread_blocked, id=11004, stack(0x000000b5d4900000,0x000000b5d4a00000) (1024K)] - 0x0000023f7c8c5fb0 JavaThread "Hikari connection adder" daemon [_thread_blocked, id=18468, stack(0x000000b5d4a00000,0x000000b5d4b00000) (1024K)] -Total: 32 - -Other Threads: -=>0x0000023f746dfda0 VMThread "VM Thread" [id=14856, stack(0x000000b5d2200000,0x000000b5d2300000) (1024K)] - 0x0000023f746ce170 WatcherThread "VM Periodic Task Thread" [id=2652, stack(0x000000b5d2100000,0x000000b5d2200000) (1024K)] - 0x0000023f6140d400 WorkerThread "GC Thread#0" [id=1428, stack(0x000000b5d1c00000,0x000000b5d1d00000) (1024K)] - 0x0000023f746e04e0 WorkerThread "GC Thread#1" [id=15932, stack(0x000000b5d2f00000,0x000000b5d3000000) (1024K)] - 0x0000023f746e0fc0 WorkerThread "GC Thread#2" [id=17440, stack(0x000000b5d3000000,0x000000b5d3100000) (1024K)] - 0x0000023f746e0140 WorkerThread "GC Thread#3" [id=808, stack(0x000000b5d3100000,0x000000b5d3200000) (1024K)] - 0x0000023f746df660 WorkerThread "GC Thread#4" [id=17436, stack(0x000000b5d3200000,0x000000b5d3300000) (1024K)] - 0x0000023f746e0880 WorkerThread "GC Thread#5" [id=17736, stack(0x000000b5d3500000,0x000000b5d3600000) (1024K)] - 0x0000023f746e0c20 WorkerThread "GC Thread#6" [id=17740, stack(0x000000b5d3600000,0x000000b5d3700000) (1024K)] - 0x0000023f798df680 WorkerThread "GC Thread#7" [id=17744, stack(0x000000b5d3700000,0x000000b5d3800000) (1024K)] - 0x0000023f798e0160 WorkerThread "GC Thread#8" [id=1140, stack(0x000000b5d3a00000,0x000000b5d3b00000) (1024K)] - 0x0000023f798dfdc0 WorkerThread "GC Thread#9" [id=3336, stack(0x000000b5d3b00000,0x000000b5d3c00000) (1024K)] - 0x0000023f6141e100 ConcurrentGCThread "G1 Main Marker" [id=17712, stack(0x000000b5d1d00000,0x000000b5d1e00000) (1024K)] - 0x0000023f614210a0 WorkerThread "G1 Conc#0" [id=11280, stack(0x000000b5d1e00000,0x000000b5d1f00000) (1024K)] - 0x0000023f798e0c40 WorkerThread "G1 Conc#1" [id=14956, stack(0x000000b5d3c00000,0x000000b5d3d00000) (1024K)] - 0x0000023f798e0500 WorkerThread "G1 Conc#2" [id=8236, stack(0x000000b5d3d00000,0x000000b5d3e00000) (1024K)] - 0x0000023f7459b4a0 ConcurrentGCThread "G1 Refine#0" [id=7512, stack(0x000000b5d1f00000,0x000000b5d2000000) (1024K)] - 0x0000023f7459bb20 ConcurrentGCThread "G1 Service" [id=14540, stack(0x000000b5d2000000,0x000000b5d2100000) (1024K)] -Total: 18 - -Threads with active compile tasks: -Total: 0 - -VM state: at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00007ffdfde7b8b0] Threads_lock - owner thread: 0x0000023f746dfda0 -[0x00007ffdfde7b9b0] Heap_lock - owner thread: 0x0000023f7c8c31c0 - -Heap address: 0x000000070ae00000, size: 3922 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) mapped at: [0x0000023f00000000-0x0000023f00c80000-0x0000023f00c80000), size 13107200, SharedBaseAddress: 0x0000023f00000000, ArchiveRelocationMode: 1. -Compressed class space mapped at: 0x0000023f01000000-0x0000023f41000000, reserved size: 1073741824 -Narrow klass base: 0x0000023f00000000, Narrow klass shift: 0, Narrow klass range: 0x100000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - CPUs: 12 total, 12 available - Memory: 15681M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 2M - Heap Min Capacity: 8M - Heap Initial Capacity: 246M - Heap Max Capacity: 3922M - Pre-touch: Disabled - Parallel Workers: 10 - Concurrent Workers: 3 - Concurrent Refinement Workers: 10 - Periodic GC: Disabled - -Heap: - garbage-first heap total 141312K, used 48097K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 3 survivors (6144K) - Metaspace used 99436K, committed 101376K, reserved 1179648K - class space used 14081K, committed 15040K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x000000070ae00000, 0x000000070b000000, 0x000000070b000000|100%| O| |TAMS 0x000000070ae00000| PB 0x000000070ae00000| Untracked -| 1|0x000000070b000000, 0x000000070b200000, 0x000000070b200000|100%| O| |TAMS 0x000000070b000000| PB 0x000000070b000000| Untracked -| 2|0x000000070b200000, 0x000000070b400000, 0x000000070b400000|100%| O| |TAMS 0x000000070b200000| PB 0x000000070b200000| Untracked -| 3|0x000000070b400000, 0x000000070b5ffff0, 0x000000070b600000| 99%| O| |TAMS 0x000000070b400000| PB 0x000000070b400000| Untracked -| 4|0x000000070b600000, 0x000000070b7fffd0, 0x000000070b800000| 99%| O| |TAMS 0x000000070b600000| PB 0x000000070b600000| Untracked -| 5|0x000000070b800000, 0x000000070b9ffff0, 0x000000070ba00000| 99%| O| |TAMS 0x000000070b800000| PB 0x000000070b800000| Untracked -| 6|0x000000070ba00000, 0x000000070bbffff0, 0x000000070bc00000| 99%| O| |TAMS 0x000000070ba00000| PB 0x000000070ba00000| Untracked -| 7|0x000000070bc00000, 0x000000070be00000, 0x000000070be00000|100%| O| |TAMS 0x000000070bc00000| PB 0x000000070bc00000| Untracked -| 8|0x000000070be00000, 0x000000070bffffd8, 0x000000070c000000| 99%| O| |TAMS 0x000000070be00000| PB 0x000000070be00000| Untracked -| 9|0x000000070c000000, 0x000000070c1ffff8, 0x000000070c200000| 99%| O| |TAMS 0x000000070c000000| PB 0x000000070c000000| Untracked -| 10|0x000000070c200000, 0x000000070c3fffb8, 0x000000070c400000| 99%| O| |TAMS 0x000000070c200000| PB 0x000000070c200000| Untracked -| 11|0x000000070c400000, 0x000000070c5ffff8, 0x000000070c600000| 99%| O| |TAMS 0x000000070c400000| PB 0x000000070c400000| Untracked -| 12|0x000000070c600000, 0x000000070c7ffff8, 0x000000070c800000| 99%| O| |TAMS 0x000000070c600000| PB 0x000000070c600000| Untracked -| 13|0x000000070c800000, 0x000000070c9fffa8, 0x000000070ca00000| 99%| O| |TAMS 0x000000070c800000| PB 0x000000070c800000| Untracked -| 14|0x000000070ca00000, 0x000000070cbfffe0, 0x000000070cc00000| 99%| O| |TAMS 0x000000070ca00000| PB 0x000000070ca00000| Untracked -| 15|0x000000070cc00000, 0x000000070cdffff0, 0x000000070ce00000| 99%| O| |TAMS 0x000000070cc00000| PB 0x000000070cc00000| Untracked -| 16|0x000000070ce00000, 0x000000070cffffd0, 0x000000070d000000| 99%| O| |TAMS 0x000000070ce00000| PB 0x000000070ce00000| Untracked -| 17|0x000000070d000000, 0x000000070d200000, 0x000000070d200000|100%| O| |TAMS 0x000000070d000000| PB 0x000000070d000000| Untracked -| 18|0x000000070d200000, 0x000000070d2bd178, 0x000000070d400000| 36%| O| |TAMS 0x000000070d200000| PB 0x000000070d200000| Untracked -| 19|0x000000070d400000, 0x000000070d600000, 0x000000070d600000|100%| O| |TAMS 0x000000070d400000| PB 0x000000070d400000| Untracked -| 20|0x000000070d600000, 0x000000070d6cb8e8, 0x000000070d800000| 39%| O| |TAMS 0x000000070d600000| PB 0x000000070d600000| Untracked -| 21|0x000000070d800000, 0x000000070d803748, 0x000000070da00000| 0%| O|Cm|TAMS 0x000000070d800000| PB 0x000000070d800000| Complete -| 22|0x000000070da00000, 0x000000070dab5890, 0x000000070dc00000| 35%| O| |TAMS 0x000000070da00000| PB 0x000000070da00000| Untracked -| 23|0x000000070dc00000, 0x000000070dc27310, 0x000000070de00000| 7%| O| |TAMS 0x000000070dc00000| PB 0x000000070dc00000| Untracked -| 24|0x000000070de00000, 0x000000070de00000, 0x000000070e000000| 0%| F| |TAMS 0x000000070de00000| PB 0x000000070de00000| Untracked -| 25|0x000000070e000000, 0x000000070e200000, 0x000000070e200000|100%| O| |TAMS 0x000000070e000000| PB 0x000000070e000000| Untracked -| 26|0x000000070e200000, 0x000000070e400000, 0x000000070e400000|100%| S|CS|TAMS 0x000000070e200000| PB 0x000000070e200000| Complete -| 27|0x000000070e400000, 0x000000070e600000, 0x000000070e600000|100%| S|CS|TAMS 0x000000070e400000| PB 0x000000070e400000| Complete -| 28|0x000000070e600000, 0x000000070e600000, 0x000000070e800000| 0%| F| |TAMS 0x000000070e600000| PB 0x000000070e600000| Untracked -| 29|0x000000070e800000, 0x000000070e800000, 0x000000070ea00000| 0%| F| |TAMS 0x000000070e800000| PB 0x000000070e800000| Untracked -| 30|0x000000070ea00000, 0x000000070ea00000, 0x000000070ec00000| 0%| F| |TAMS 0x000000070ea00000| PB 0x000000070ea00000| Untracked -| 31|0x000000070ec00000, 0x000000070ec00000, 0x000000070ee00000| 0%| F| |TAMS 0x000000070ec00000| PB 0x000000070ec00000| Untracked -| 32|0x000000070ee00000, 0x000000070ee00000, 0x000000070f000000| 0%| F| |TAMS 0x000000070ee00000| PB 0x000000070ee00000| Untracked -| 33|0x000000070f000000, 0x000000070f000000, 0x000000070f200000| 0%| F| |TAMS 0x000000070f000000| PB 0x000000070f000000| Untracked -| 34|0x000000070f200000, 0x000000070f200000, 0x000000070f400000| 0%| F| |TAMS 0x000000070f200000| PB 0x000000070f200000| Untracked -| 35|0x000000070f400000, 0x000000070f400000, 0x000000070f600000| 0%| F| |TAMS 0x000000070f400000| PB 0x000000070f400000| Untracked -| 36|0x000000070f600000, 0x000000070f600000, 0x000000070f800000| 0%| F| |TAMS 0x000000070f600000| PB 0x000000070f600000| Untracked -| 37|0x000000070f800000, 0x000000070f800000, 0x000000070fa00000| 0%| F| |TAMS 0x000000070f800000| PB 0x000000070f800000| Untracked -| 38|0x000000070fa00000, 0x000000070fa00000, 0x000000070fc00000| 0%| F| |TAMS 0x000000070fa00000| PB 0x000000070fa00000| Untracked -| 39|0x000000070fc00000, 0x000000070fc00000, 0x000000070fe00000| 0%| F| |TAMS 0x000000070fc00000| PB 0x000000070fc00000| Untracked -| 40|0x000000070fe00000, 0x000000070fe00000, 0x0000000710000000| 0%| F| |TAMS 0x000000070fe00000| PB 0x000000070fe00000| Untracked -| 41|0x0000000710000000, 0x0000000710000000, 0x0000000710200000| 0%| F| |TAMS 0x0000000710000000| PB 0x0000000710000000| Untracked -| 42|0x0000000710200000, 0x0000000710200000, 0x0000000710400000| 0%| F| |TAMS 0x0000000710200000| PB 0x0000000710200000| Untracked -| 43|0x0000000710400000, 0x0000000710400000, 0x0000000710600000| 0%| F| |TAMS 0x0000000710400000| PB 0x0000000710400000| Untracked -| 44|0x0000000710600000, 0x0000000710600000, 0x0000000710800000| 0%| F| |TAMS 0x0000000710600000| PB 0x0000000710600000| Untracked -| 45|0x0000000710800000, 0x0000000710800000, 0x0000000710a00000| 0%| F| |TAMS 0x0000000710800000| PB 0x0000000710800000| Untracked -| 46|0x0000000710a00000, 0x0000000710a00000, 0x0000000710c00000| 0%| F| |TAMS 0x0000000710a00000| PB 0x0000000710a00000| Untracked -| 47|0x0000000710c00000, 0x0000000710c00000, 0x0000000710e00000| 0%| F| |TAMS 0x0000000710c00000| PB 0x0000000710c00000| Untracked -| 48|0x0000000710e00000, 0x0000000710e00000, 0x0000000711000000| 0%| F| |TAMS 0x0000000710e00000| PB 0x0000000710e00000| Untracked -| 49|0x0000000711000000, 0x0000000711000000, 0x0000000711200000| 0%| F| |TAMS 0x0000000711000000| PB 0x0000000711000000| Untracked -| 50|0x0000000711200000, 0x0000000711200000, 0x0000000711400000| 0%| F| |TAMS 0x0000000711200000| PB 0x0000000711200000| Untracked -| 51|0x0000000711400000, 0x0000000711400000, 0x0000000711600000| 0%| F| |TAMS 0x0000000711400000| PB 0x0000000711400000| Untracked -| 52|0x0000000711600000, 0x0000000711600000, 0x0000000711800000| 0%| F| |TAMS 0x0000000711600000| PB 0x0000000711600000| Untracked -| 53|0x0000000711800000, 0x0000000711800000, 0x0000000711a00000| 0%| F| |TAMS 0x0000000711800000| PB 0x0000000711800000| Untracked -| 54|0x0000000711a00000, 0x0000000711a00000, 0x0000000711c00000| 0%| F| |TAMS 0x0000000711a00000| PB 0x0000000711a00000| Untracked -| 55|0x0000000711c00000, 0x0000000711c00000, 0x0000000711e00000| 0%| F| |TAMS 0x0000000711c00000| PB 0x0000000711c00000| Untracked -| 56|0x0000000711e00000, 0x0000000711e00000, 0x0000000712000000| 0%| F| |TAMS 0x0000000711e00000| PB 0x0000000711e00000| Untracked -| 57|0x0000000712000000, 0x0000000712000000, 0x0000000712200000| 0%| F| |TAMS 0x0000000712000000| PB 0x0000000712000000| Untracked -| 58|0x0000000712200000, 0x0000000712200000, 0x0000000712400000| 0%| F| |TAMS 0x0000000712200000| PB 0x0000000712200000| Untracked -| 59|0x0000000712400000, 0x0000000712400000, 0x0000000712600000| 0%| F| |TAMS 0x0000000712400000| PB 0x0000000712400000| Untracked -| 60|0x0000000712600000, 0x0000000712600000, 0x0000000712800000| 0%| F| |TAMS 0x0000000712600000| PB 0x0000000712600000| Untracked -| 61|0x0000000712800000, 0x0000000712800000, 0x0000000712a00000| 0%| F| |TAMS 0x0000000712800000| PB 0x0000000712800000| Untracked -| 62|0x0000000712a00000, 0x0000000712a00000, 0x0000000712c00000| 0%| F| |TAMS 0x0000000712a00000| PB 0x0000000712a00000| Untracked -| 63|0x0000000712c00000, 0x0000000712c00000, 0x0000000712e00000| 0%| F| |TAMS 0x0000000712c00000| PB 0x0000000712c00000| Untracked -| 64|0x0000000712e00000, 0x0000000712e00000, 0x0000000713000000| 0%| F| |TAMS 0x0000000712e00000| PB 0x0000000712e00000| Untracked -| 65|0x0000000713000000, 0x0000000713000000, 0x0000000713200000| 0%| F| |TAMS 0x0000000713000000| PB 0x0000000713000000| Untracked -| 66|0x0000000713200000, 0x0000000713200000, 0x0000000713400000| 0%| F| |TAMS 0x0000000713200000| PB 0x0000000713200000| Untracked -| 67|0x0000000713400000, 0x0000000713453130, 0x0000000713600000| 16%| S|CS|TAMS 0x0000000713400000| PB 0x0000000713400000| Complete -|1960|0x00000007ffe00000, 0x00000007ffe3c780, 0x0000000800000000| 11%| O| |TAMS 0x00000007ffe00000| PB 0x00000007ffe00000| Untracked - -Card table byte_map: [0x0000023f6d590000,0x0000023f6dd40000] _byte_map_base: 0x0000023f69d39000 - -Marking Bits: (CMBitMap*) 0x0000023f6140e310 - Bits: [0x0000023f6dd40000, 0x0000023f71a88000) - -Polling page: 0x0000023f5f1d0000 - -Metaspace: - -Usage: - Non-class: 83.35 MB used. - Class: 13.75 MB used. - Both: 97.11 MB used. - -Virtual space: - Non-class space: 128.00 MB reserved, 84.31 MB ( 66%) committed, 2 nodes. - Class space: 1.00 GB reserved, 14.69 MB ( 1%) committed, 1 nodes. - Both: 1.12 GB reserved, 99.00 MB ( 9%) committed. - -Chunk freelists: - Non-Class: 11.60 MB - Class: 1.92 MB - Both: 13.52 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 171.25 MB -CDS: on - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 11. -num_arena_births: 3156. -num_arena_deaths: 2048. -num_vsnodes_births: 3. -num_vsnodes_deaths: 0. -num_space_committed: 1650. -num_space_uncommitted: 35. -num_chunks_returned_to_freelist: 3272. -num_chunks_taken_from_freelist: 8069. -num_chunk_merges: 556. -num_chunk_splits: 4544. -num_chunks_enlarged: 3414. -num_inconsistent_stats: 0. - -CodeCache: size=49152Kb used=25524Kb max_used=26752Kb free=23627Kb - bounds [0x0000023f69ab0000, 0x0000023f6b650000, 0x0000023f6cab0000] - total_blobs=12210, nmethods=11403, adapters=727, full_count=0 -Compilation: enabled, stopped_count=0, restarted_count=0 - -Compilation events (20 events): -Event: 18087.670 Thread 0x0000023f74724560 nmethod 45246 0x0000023f6b504c90 code [0x0000023f6b505140, 0x0000023f6b507328] -Event: 18087.670 Thread 0x0000023f7cf6dad0 45268 1 org.springframework.data.jpa.repository.query.HqlParser$Ql_statementContext::accept (26 bytes) -Event: 18087.670 Thread 0x0000023f7cf71150 45251 1 org.springframework.data.jpa.repository.query.HqlParser$FromClauseContext::accept (26 bytes) -Event: 18087.670 Thread 0x0000023f74724560 45252 1 org.springframework.data.jpa.repository.query.HqlParser$WhereClauseContext::accept (26 bytes) -Event: 18087.671 Thread 0x0000023f7cf6dad0 nmethod 45268 0x0000023f6b504790 code [0x0000023f6b504960, 0x0000023f6b504ba0] -Event: 18087.671 Thread 0x0000023f7cf71150 nmethod 45251 0x0000023f6b504290 code [0x0000023f6b504460, 0x0000023f6b5046a0] -Event: 18087.671 Thread 0x0000023f7cf6dad0 45253 1 org.springframework.data.jpa.repository.query.HqlParser$SelectQueryContext::groupByClause (11 bytes) -Event: 18087.671 Thread 0x0000023f7cf71150 45254 1 org.springframework.data.jpa.repository.query.HqlParser$SelectQueryContext::havingClause (11 bytes) -Event: 18087.671 Thread 0x0000023f74724560 nmethod 45252 0x0000023f6b503d90 code [0x0000023f6b503f60, 0x0000023f6b5041a0] -Event: 18087.671 Thread 0x0000023f7cf6dad0 nmethod 45253 0x0000023f6b503990 code [0x0000023f6b503b40, 0x0000023f6b503cb0] -Event: 18087.671 Thread 0x0000023f7cf71150 nmethod 45254 0x0000023f6b503590 code [0x0000023f6b503740, 0x0000023f6b5038b0] -Event: 18087.671 Thread 0x0000023f7cf6dad0 45274 1 org.hibernate.metamodel.model.domain.internal.AbstractAttribute::getName (5 bytes) -Event: 18087.671 Thread 0x0000023f74724560 45275 1 org.hibernate.metamodel.model.domain.internal.BasicSqmPathSource::isGeneric (5 bytes) -Event: 18087.671 Thread 0x0000023f7cf6fce0 nmethod 45273 0x0000023f6b502310 code [0x0000023f6b5025a0, 0x0000023f6b502e30] -Event: 18087.671 Thread 0x0000023f7cf6dad0 nmethod 45274 0x0000023f6a7a1690 code [0x0000023f6a7a1820, 0x0000023f6a7a18f0] -Event: 18087.671 Thread 0x0000023f74724560 nmethod 45275 0x0000023f6a7a5f10 code [0x0000023f6a7a60a0, 0x0000023f6a7a6170] -Event: 18087.671 Thread 0x0000023f7cf6dad0 45276 1 org.springframework.aop.support.AbstractPointcutAdvisor:: (5 bytes) -Event: 18087.671 Thread 0x0000023f7cf71150 45277 1 java.lang.reflect.Proxy$ProxyBuilder::validateProxyInterfaces (259 bytes) -Event: 18087.671 Thread 0x0000023f7cf6dad0 nmethod 45276 0x0000023f6a7a9490 code [0x0000023f6a7a9620, 0x0000023f6a7a96e8] -Event: 18087.673 Thread 0x0000023f7cf71150 nmethod 45277 0x0000023f6b500910 code [0x0000023f6b500d00, 0x0000023f6b501b10] - -GC Heap History (20 events): -Event: 18052.821 GC heap after -{Heap after GC invocations=180 (full 7): - garbage-first heap total 137216K, used 45023K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 3 survivors (6144K) - Metaspace used 99599K, committed 101568K, reserved 1179648K - class space used 14111K, committed 15040K, reserved 1048576K -} -Event: 18053.749 GC heap before -{Heap before GC invocations=180 (full 7): - garbage-first heap total 137216K, used 120799K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 40 young (81920K), 3 survivors (6144K) - Metaspace used 99963K, committed 101568K, reserved 1179648K - class space used 14144K, committed 15040K, reserved 1048576K -} -Event: 18053.757 GC heap after -{Heap after GC invocations=181 (full 7): - garbage-first heap total 137216K, used 47302K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 3 survivors (6144K) - Metaspace used 99963K, committed 101568K, reserved 1179648K - class space used 14144K, committed 15040K, reserved 1048576K -} -Event: 18062.510 GC heap before -{Heap before GC invocations=181 (full 7): - garbage-first heap total 137216K, used 112838K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 36 young (73728K), 3 survivors (6144K) - Metaspace used 100154K, committed 101568K, reserved 1179648K - class space used 14163K, committed 15040K, reserved 1048576K -} -Event: 18062.598 GC heap after -{Heap after GC invocations=182 (full 8): - garbage-first heap total 137216K, used 39256K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 0 young (0K), 0 survivors (0K) - Metaspace used 99204K, committed 101184K, reserved 1179648K - class space used 14068K, committed 15040K, reserved 1048576K -} -Event: 18063.968 GC heap before -{Heap before GC invocations=182 (full 8): - garbage-first heap total 137216K, used 119128K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 39 young (79872K), 0 survivors (0K) - Metaspace used 99385K, committed 101184K, reserved 1179648K - class space used 14090K, committed 15040K, reserved 1048576K -} -Event: 18063.972 GC heap after -{Heap after GC invocations=183 (full 8): - garbage-first heap total 137216K, used 43776K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 3 survivors (6144K) - Metaspace used 99385K, committed 101184K, reserved 1179648K - class space used 14090K, committed 15040K, reserved 1048576K -} -Event: 18064.386 GC heap before -{Heap before GC invocations=184 (full 8): - garbage-first heap total 137216K, used 119552K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 40 young (81920K), 3 survivors (6144K) - Metaspace used 99385K, committed 101184K, reserved 1179648K - class space used 14090K, committed 15040K, reserved 1048576K -} -Event: 18064.392 GC heap after -{Heap after GC invocations=185 (full 8): - garbage-first heap total 137216K, used 45178K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 3 survivors (6144K) - Metaspace used 99385K, committed 101184K, reserved 1179648K - class space used 14090K, committed 15040K, reserved 1048576K -} -Event: 18065.219 GC heap before -{Heap before GC invocations=185 (full 8): - garbage-first heap total 137216K, used 118906K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 40 young (81920K), 3 survivors (6144K) - Metaspace used 99755K, committed 101248K, reserved 1179648K - class space used 14124K, committed 15040K, reserved 1048576K -} -Event: 18065.226 GC heap after -{Heap after GC invocations=186 (full 8): - garbage-first heap total 137216K, used 47642K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 3 survivors (6144K) - Metaspace used 99755K, committed 101248K, reserved 1179648K - class space used 14124K, committed 15040K, reserved 1048576K -} -Event: 18084.430 GC heap before -{Heap before GC invocations=186 (full 8): - garbage-first heap total 137216K, used 121370K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 39 young (79872K), 3 survivors (6144K) - Metaspace used 99948K, committed 101376K, reserved 1179648K - class space used 14144K, committed 15040K, reserved 1048576K -} -Event: 18084.440 GC heap after -{Heap after GC invocations=187 (full 8): - garbage-first heap total 137216K, used 48590K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 3 survivors (6144K) - Metaspace used 99948K, committed 101376K, reserved 1179648K - class space used 14144K, committed 15040K, reserved 1048576K -} -Event: 18084.560 GC heap before -{Heap before GC invocations=187 (full 8): - garbage-first heap total 137216K, used 48590K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 4 young (8192K), 3 survivors (6144K) - Metaspace used 99830K, committed 101376K, reserved 1179648K - class space used 14112K, committed 15040K, reserved 1048576K -} -Event: 18084.660 GC heap after -{Heap after GC invocations=188 (full 9): - garbage-first heap total 137216K, used 39330K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 0 young (0K), 0 survivors (0K) - Metaspace used 98887K, committed 101376K, reserved 1179648K - class space used 14024K, committed 15040K, reserved 1048576K -} -Event: 18086.508 GC heap before -{Heap before GC invocations=188 (full 9): - garbage-first heap total 137216K, used 117154K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 39 young (79872K), 0 survivors (0K) - Metaspace used 99072K, committed 101376K, reserved 1179648K - class space used 14047K, committed 15040K, reserved 1048576K -} -Event: 18086.512 GC heap after -{Heap after GC invocations=189 (full 9): - garbage-first heap total 137216K, used 44217K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 3 young (6144K), 3 survivors (6144K) - Metaspace used 99072K, committed 101376K, reserved 1179648K - class space used 14047K, committed 15040K, reserved 1048576K -} -Event: 18086.928 GC heap before -{Heap before GC invocations=189 (full 9): - garbage-first heap total 137216K, used 117945K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 39 young (79872K), 3 survivors (6144K) - Metaspace used 99074K, committed 101376K, reserved 1179648K - class space used 14047K, committed 15040K, reserved 1048576K -} -Event: 18086.933 GC heap after -{Heap after GC invocations=190 (full 9): - garbage-first heap total 137216K, used 45924K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 4 young (8192K), 4 survivors (8192K) - Metaspace used 99074K, committed 101376K, reserved 1179648K - class space used 14047K, committed 15040K, reserved 1048576K -} -Event: 18087.705 GC heap before -{Heap before GC invocations=191 (full 9): - garbage-first heap total 137216K, used 119652K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 40 young (81920K), 4 survivors (8192K) - Metaspace used 99436K, committed 101376K, reserved 1179648K - class space used 14081K, committed 15040K, reserved 1048576K -} - -Dll operation events (10 events): -Event: 0.018 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll -Event: 0.257 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\net.dll -Event: 0.262 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\nio.dll -Event: 0.271 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\zip.dll -Event: 0.499 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jimage.dll -Event: 1.188 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\management.dll -Event: 1.198 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\management_ext.dll -Event: 3.183 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\sunmscapi.dll -Event: 3.321 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\extnet.dll -Event: 11.745 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\verify.dll - -Deoptimization events (12 events): -Event: 2.514 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f69f8fff4 sp=0x000000b5d34fe590 -Event: 2.514 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fda58 mode 0 -Event: 13.839 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f6a7d36dc sp=0x000000b5d34fce80 -Event: 13.839 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fc308 mode 0 -Event: 14.705 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f6a042979 sp=0x000000b5d34fcb40 -Event: 14.705 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fc048 mode 3 -Event: 14.705 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f6a03963a sp=0x000000b5d34fcb00 -Event: 14.705 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fc048 mode 3 -Event: 14.899 Thread 0x0000023f79675f30 DEOPT PACKING pc=0x0000023f69f813bc sp=0x000000b5d34fd140 -Event: 14.899 Thread 0x0000023f79675f30 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d34fc698 mode 0 -Event: 25.264 Thread 0x0000023f7b043a80 DEOPT PACKING pc=0x0000023f69f317ac sp=0x000000b5d47fa5b0 -Event: 25.264 Thread 0x0000023f7b043a80 DEOPT UNPACKING pc=0x0000023f69b04bc2 sp=0x000000b5d47f9a70 mode 0 - -Classes loaded (20 events): -Event: 18052.405 Loading class java/lang/ObjectCustomizer -Event: 18052.406 Loading class java/lang/ObjectCustomizer done -Event: 18052.406 Loading class java/lang/ObjectCustomizer -Event: 18052.406 Loading class java/lang/ObjectCustomizer done -Event: 18064.043 Loading class java/lang/ObjectBeanInfo -Event: 18064.043 Loading class java/lang/ObjectBeanInfo done -Event: 18064.043 Loading class java/lang/ObjectBeanInfo -Event: 18064.043 Loading class java/lang/ObjectBeanInfo done -Event: 18064.044 Loading class java/lang/ObjectCustomizer -Event: 18064.044 Loading class java/lang/ObjectCustomizer done -Event: 18064.044 Loading class java/lang/ObjectCustomizer -Event: 18064.044 Loading class java/lang/ObjectCustomizer done -Event: 18086.602 Loading class java/lang/ObjectBeanInfo -Event: 18086.602 Loading class java/lang/ObjectBeanInfo done -Event: 18086.602 Loading class java/lang/ObjectBeanInfo -Event: 18086.602 Loading class java/lang/ObjectBeanInfo done -Event: 18086.603 Loading class java/lang/ObjectCustomizer -Event: 18086.603 Loading class java/lang/ObjectCustomizer done -Event: 18086.603 Loading class java/lang/ObjectCustomizer -Event: 18086.603 Loading class java/lang/ObjectCustomizer done - -Classes unloaded (20 events): -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a8d0 'fr/codecake/airbnbclone/user/application/UserService' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a6b8 'fr/codecake/airbnbclone/user/application/Auth0Service' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a490 'fr/codecake/airbnbclone/listing/presentation/TenantResource' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a268 'fr/codecake/airbnbclone/listing/presentation/LandlordResource' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e1a000 'fr/codecake/airbnbclone/listing/mapper/ListingPictureMapperImpl' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0d80 'fr/codecake/airbnbclone/listing/mapper/ListingPictureMapper' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0aa0 'fr/codecake/airbnbclone/listing/mapper/ListingMapperImpl' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb08a0 'fr/codecake/airbnbclone/listing/mapper/ListingMapper' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0678 'fr/codecake/airbnbclone/listing/application/TenantService' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0460 'fr/codecake/airbnbclone/listing/application/PictureService' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0220 'fr/codecake/airbnbclone/listing/application/LandlordService' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01bb0000 'fr/codecake/airbnbclone/infrastructure/config/SecurityConfiguration' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f011dcc70 'fr/codecake/airbnbclone/infrastructure/config/DatabaseConfiguration' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f011dca38 'fr/codecake/airbnbclone/booking/presentation/BookingResource' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f011dc800 'fr/codecake/airbnbclone/booking/mapper/BookingMapperImpl' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01eb1c48 'fr/codecake/airbnbclone/booking/mapper/BookingMapper' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01eb1a08 'fr/codecake/airbnbclone/booking/application/BookingService' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01eb1800 'fr/codecake/airbnbclone/NbatCloneBackApplication' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f014b0000 'java/lang/invoke/LambdaForm$MH+0x0000023f014b0000' -Event: 18084.587 Thread 0x0000023f746dfda0 Unloading class 0x0000023f01e63800 'java/lang/invoke/LambdaForm$MH+0x0000023f01e63800' - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 18086.664 Thread 0x0000023f7c8c31c0 Exception (0x0000000712835348) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.664 Thread 0x0000023f7c8c31c0 Exception (0x000000071283b8c8) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.665 Thread 0x0000023f7c8c31c0 Exception (0x0000000712851f40) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.666 Thread 0x0000023f7c8c31c0 Exception (0x0000000712858468) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.667 Thread 0x0000023f7c8c31c0 Exception (0x000000071286eff8) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.667 Thread 0x0000023f7c8c31c0 Exception (0x00000007128754c8) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.668 Thread 0x0000023f7c8c31c0 Exception (0x000000071288bf58) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.668 Thread 0x0000023f7c8c31c0 Exception (0x0000000712892178) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.669 Thread 0x0000023f7c8c31c0 Exception (0x00000007128b2820) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.670 Thread 0x0000023f7c8c31c0 Exception (0x00000007128b8e88) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.670 Thread 0x0000023f7c8c31c0 Exception (0x00000007128d5b70) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.671 Thread 0x0000023f7c8c31c0 Exception (0x00000007128dc108) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.671 Thread 0x0000023f7c8c31c0 Exception (0x00000007128f29e8) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.672 Thread 0x0000023f7c8c31c0 Exception (0x00000007128f8bb0) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.673 Thread 0x0000023f7c8c31c0 Exception (0x0000000712909750) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.673 Thread 0x0000023f7c8c31c0 Exception (0x000000071290fc78) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.674 Thread 0x0000023f7c8c31c0 Exception (0x0000000712920750) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.674 Thread 0x0000023f7c8c31c0 Exception (0x0000000712926c20) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.675 Thread 0x0000023f7c8c31c0 Exception (0x000000071293e848) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] -Event: 18086.676 Thread 0x0000023f7c8c31c0 Exception (0x0000000712944de0) -thrown [s\src\hotspot\share\classfile\systemDictionary.cpp, line 312] - -ZGC Phase Switch (0 events): -No events - -VM Operations (20 events): -Event: 18066.236 Executing VM operation: Cleanup done -Event: 18071.273 Executing VM operation: Cleanup -Event: 18071.273 Executing VM operation: Cleanup done -Event: 18084.429 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) -Event: 18084.440 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done -Event: 18084.506 Executing VM operation: G1PauseRemark -Event: 18084.544 Executing VM operation: G1PauseRemark done -Event: 18084.560 Executing VM operation: G1CollectFull (System.gc()) -Event: 18084.660 Executing VM operation: G1CollectFull (System.gc()) done -Event: 18085.670 Executing VM operation: Cleanup -Event: 18085.670 Executing VM operation: Cleanup done -Event: 18086.508 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) -Event: 18086.512 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done -Event: 18086.928 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) -Event: 18086.933 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) done -Event: 18086.974 Executing VM operation: G1PauseRemark -Event: 18086.987 Executing VM operation: G1PauseRemark done -Event: 18087.002 Executing VM operation: G1PauseCleanup -Event: 18087.002 Executing VM operation: G1PauseCleanup done -Event: 18087.705 Executing VM operation: G1CollectForAllocation (G1 Evacuation Pause) - -Memory protections (0 events): -No events - -Nmethod flushes (20 events): -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b38b390 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b38b710 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b38c010 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b38d510 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3b0510 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3b0910 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3b0c10 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3b4090 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3cfb90 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3d5b10 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3d5e10 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3ed190 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3eda90 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3edf10 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3ee210 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3ef890 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3efc10 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3eff10 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b3f0a90 -Event: 18086.986 Thread 0x0000023f746dfda0 flushing nmethod 0x0000023f6b486c90 - -Events (20 events): -Event: 18084.456 Thread 0x0000023f7c8c4570 Thread exited: 0x0000023f7c8c4570 -Event: 18084.559 Thread 0x0000023f7c69e7e0 Thread exited: 0x0000023f7c69e7e0 -Event: 18084.660 Thread 0x0000023f7c8c3ee0 Thread added: 0x0000023f7c8c31c0 -Event: 18084.661 Thread 0x0000023f7c69dac0 Thread exited: 0x0000023f7c69dac0 -Event: 18084.661 Thread 0x0000023f7c8c31c0 Thread exited: 0x0000023f7c8c31c0 -Event: 18084.662 Thread 0x0000023f7c8c3ee0 Thread added: 0x0000023f7c8c31c0 -Event: 18084.665 Thread 0x0000023f7c69e150 Thread exited: 0x0000023f7c69e150 -Event: 18084.736 Thread 0x0000023f74724560 Thread added: 0x0000023f7cf71150 -Event: 18084.891 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c4570 -Event: 18084.892 Thread 0x0000023f7c8c4570 Thread exited: 0x0000023f7c8c4570 -Event: 18085.171 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c4570 -Event: 18085.364 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c10f0 -Event: 18085.410 Thread 0x0000023f7c8c10f0 Thread exited: 0x0000023f7c8c10f0 -Event: 18086.339 Thread 0x0000023f74724560 Thread added: 0x0000023f7cf6fce0 -Event: 18086.339 Thread 0x0000023f74724560 Thread added: 0x0000023f7cf6dad0 -Event: 18086.403 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c10f0 -Event: 18086.404 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c5920 -Event: 18086.404 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c7360 -Event: 18086.542 Thread 0x0000023f7c8c31c0 Thread added: 0x0000023f7c8c8710 -Event: 18086.651 Thread 0x0000023f7c8c8710 Thread added: 0x0000023f7c8c5fb0 - - -Dynamic libraries: -0x00007ff6b0be0000 - 0x00007ff6b0bee000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.exe -0x00007ffe815a0000 - 0x00007ffe81807000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ffe80de0000 - 0x00007ffe80ea9000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ffe7ed40000 - 0x00007ffe7f12f000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ffe7f1f0000 - 0x00007ffe7f33b000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffe25b90000 - 0x00007ffe25bae000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\VCRUNTIME140.dll -0x00007ffe00530000 - 0x00007ffe00548000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jli.dll -0x00007ffe80490000 - 0x00007ffe80655000 C:\WINDOWS\System32\USER32.dll -0x00007ffe7ed10000 - 0x00007ffe7ed37000 C:\WINDOWS\System32\win32u.dll -0x00007ffe64700000 - 0x00007ffe64993000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll -0x00007ffe7fe30000 - 0x00007ffe7fe5b000 C:\WINDOWS\System32\GDI32.dll -0x00007ffe80f50000 - 0x00007ffe80ff9000 C:\WINDOWS\System32\msvcrt.dll -0x00007ffe7e780000 - 0x00007ffe7e8ac000 C:\WINDOWS\System32\gdi32full.dll -0x00007ffe7f140000 - 0x00007ffe7f1e3000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ffe81520000 - 0x00007ffe81551000 C:\WINDOWS\System32\IMM32.DLL -0x00007ffe74950000 - 0x00007ffe7495c000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\vcruntime140_1.dll -0x00007ffdfdf60000 - 0x00007ffdfdfe9000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\msvcp140.dll -0x00007ffdfd1b0000 - 0x00007ffdfdf5d000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server\jvm.dll -0x00007ffe7ff40000 - 0x00007ffe7fff4000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ffe80d30000 - 0x00007ffe80dd6000 C:\WINDOWS\System32\sechost.dll -0x00007ffe81260000 - 0x00007ffe81378000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ffe7fb10000 - 0x00007ffe7fb84000 C:\WINDOWS\System32\WS2_32.dll -0x00007ffe7e550000 - 0x00007ffe7e5ae000 C:\WINDOWS\SYSTEM32\POWRPROF.dll -0x00007ffe772f0000 - 0x00007ffe772fb000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ffe77270000 - 0x00007ffe772a5000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ffe7e530000 - 0x00007ffe7e544000 C:\WINDOWS\SYSTEM32\UMPDC.dll -0x00007ffe7d460000 - 0x00007ffe7d47b000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll -0x00007ffe74530000 - 0x00007ffe7453a000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jimage.dll -0x00007ffe71870000 - 0x00007ffe71ab2000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL -0x00007ffe809a0000 - 0x00007ffe80d26000 C:\WINDOWS\System32\combase.dll -0x00007ffe7fe60000 - 0x00007ffe7ff36000 C:\WINDOWS\System32\OLEAUT32.dll -0x00007ffe66620000 - 0x00007ffe6665c000 C:\WINDOWS\SYSTEM32\dbgcore.DLL -0x00007ffe7e8b0000 - 0x00007ffe7e955000 C:\WINDOWS\System32\bcryptPrimitives.dll -0x00007ffdffd70000 - 0x00007ffdffd91000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll -0x00007ffe7f340000 - 0x00007ffe7fa93000 C:\WINDOWS\System32\SHELL32.dll -0x00007ffe7e960000 - 0x00007ffe7eaca000 C:\WINDOWS\System32\wintypes.dll -0x00007ffe7c2b0000 - 0x00007ffe7cb0e000 C:\WINDOWS\SYSTEM32\windows.storage.dll -0x00007ffe7fd30000 - 0x00007ffe7fe25000 C:\WINDOWS\System32\SHCORE.dll -0x00007ffe7faa0000 - 0x00007ffe7fb06000 C:\WINDOWS\System32\shlwapi.dll -0x00007ffe7e610000 - 0x00007ffe7e639000 C:\WINDOWS\SYSTEM32\profapi.dll -0x00007ffdffee0000 - 0x00007ffdffef1000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\net.dll -0x00007ffe782a0000 - 0x00007ffe783c8000 C:\WINDOWS\SYSTEM32\WINHTTP.dll -0x00007ffe7d9b0000 - 0x00007ffe7da1b000 C:\WINDOWS\system32\mswsock.dll -0x00007ffdffd50000 - 0x00007ffdffd66000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\nio.dll -0x00007ffdffd30000 - 0x00007ffdffd48000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\zip.dll -0x00007ffe79700000 - 0x00007ffe7970a000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\management.dll -0x00007ffe796f0000 - 0x00007ffe796fc000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\management_ext.dll -0x00007ffe80f40000 - 0x00007ffe80f48000 C:\WINDOWS\System32\PSAPI.DLL -0x00007ffe7dda0000 - 0x00007ffe7ddbb000 C:\WINDOWS\SYSTEM32\CRYPTSP.dll -0x00007ffe7d3c0000 - 0x00007ffe7d3fa000 C:\WINDOWS\system32\rsaenh.dll -0x00007ffe7da60000 - 0x00007ffe7da8b000 C:\WINDOWS\SYSTEM32\USERENV.dll -0x00007ffe7e5e0000 - 0x00007ffe7e60a000 C:\WINDOWS\SYSTEM32\bcrypt.dll -0x00007ffe7dc00000 - 0x00007ffe7dc0c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll -0x00007ffe7cea0000 - 0x00007ffe7ced4000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL -0x00007ffe81000000 - 0x00007ffe8100a000 C:\WINDOWS\System32\NSI.dll -0x00007ffe796e0000 - 0x00007ffe796ee000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\sunmscapi.dll -0x00007ffe7ead0000 - 0x00007ffe7ec47000 C:\WINDOWS\System32\CRYPT32.dll -0x00007ffe7def0000 - 0x00007ffe7df20000 C:\WINDOWS\SYSTEM32\ncrypt.dll -0x00007ffe7dea0000 - 0x00007ffe7dedf000 C:\WINDOWS\SYSTEM32\NTASN1.dll -0x00007ffe7cf40000 - 0x00007ffe7d06c000 C:\WINDOWS\SYSTEM32\DNSAPI.dll -0x00007ffe77200000 - 0x00007ffe7720b000 C:\Windows\System32\rasadhlp.dll -0x00007ffe78e30000 - 0x00007ffe78eb6000 C:\WINDOWS\System32\fwpuclnt.dll -0x00007ffe74970000 - 0x00007ffe74979000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\extnet.dll -0x00007ffe61140000 - 0x00007ffe61158000 C:\WINDOWS\system32\napinsp.dll -0x00007ffe60da0000 - 0x00007ffe60db2000 C:\WINDOWS\System32\winrnr.dll -0x00007ffe2dfc0000 - 0x00007ffe2dfe2000 C:\WINDOWS\system32\nlansp_c.dll -0x00007ffe7b520000 - 0x00007ffe7b536000 C:\WINDOWS\system32\wshbth.dll -0x00007ffe73120000 - 0x00007ffe73130000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\verify.dll -0x00007ffe66200000 - 0x00007ffe66208000 C:\WINDOWS\system32\wshunix.dll - -JVMTI agents: none - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server - -VM Arguments: -jvm_args: -XX:TieredStopAtLevel=1 -java_command: fr.codecake.airbnbclone.NbatCloneBackApplication -java_class_path (initial): C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend\target\classes;C:\Users\Mustapha\.m2\repository\org\aspectj\aspectjweaver\1.9.21\aspectjweaver-1.9.21.jar;C:\Users\Mustapha\.m2\repository\com\zaxxer\HikariCP\5.0.1\HikariCP-5.0.1.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-jdbc\6.1.5\spring-jdbc-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\orm\hibernate-core\6.4.4.Final\hibernate-core-6.4.4.Final.jar;C:\Users\Mustapha\.m2\repository\jakarta\persistence\jakarta.persistence-api\3.1.0\jakarta.persistence-api-3.1.0.jar;C:\Users\Mustapha\.m2\repository\jakarta\transaction\jakarta.transaction-api\2.0.1\jakarta.transaction-api-2.0.1.jar;C:\Users\Mustapha\.m2\repository\org\jboss\logging\jboss-logging\3.5.3.Final\jboss-logging-3.5.3.Final.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\common\hibernate-commons-annotations\6.0.6.Final\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\Mustapha\.m2\repository\io\smallrye\jandex\3.1.2\jandex-3.1.2.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\classmate\1.6.0\classmate-1.6.0.jar;C:\Users\Mustapha\.m2\repository\net\bytebuddy\byte-buddy\1.14.12\byte-buddy-1.14.12.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\jaxb-runtime\4.0.5\jaxb-runtime-4.0.5.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\jaxb-core\4.0.5\jaxb-core-4.0.5.jar;C:\Users\Mustapha\.m2\repository\org\eclipse\angus\angus-activation\2.0.2\angus-activation-2.0.2.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\txw2\4.0.5\txw2-4.0.5.jar;C:\Users\Mustapha\.m2\repository\com\sun\istack\istack-commons-runtime\4.1.2\istack-commons-runtime-4.1.2.jar;C:\Users\Mustapha\.m2\repository\jakarta\inject\jakarta.inject-api\2.0.1\jakarta.inject-api-2.0.1.jar;C:\Users\Mustapha\.m2\repository\org\antlr\antlr4-runtime\4.13.0\antlr4-runtime-4.13.0.jar;C:\Users\Mustapha\.m2\repository\org\springframework\data\spring-data-jpa\3.2.4\spring-data-jpa-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\data\spring-data-commons\3.2.4\spring-data-commons-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-orm\6.1.5\spring-orm-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-context\6.1.5\spring-context-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-tx\6.1.5\spring-tx-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-beans\6.1.5\spring-beans-6.1.5.jar;C:\Users\Mustapha\.m2\repository\jakarta\annotation\jakarta.annotation-api\2.1.1\jakarta.annotation-api-2.1.1.jar;C:\Users\Mustapha\.m2\repository\org\slf4j\slf4j-api\2.0.12\slf4j-api-2.0.12.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-aspects\6.1.5\spring-aspects-6.1.5.jar;C:\Users\Mustapha\.m2\repository\ch\qos\logback\logback-classic\1.4.14\logback-classic-1.4.14.jar;C:\Users\Mustapha\.m2\repository\ch\qos\logback\logback-core\1.4.14\logback-core-1.4.14.jar;C:\Users\Mustapha\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.21.1\log4j-to-slf4j-2.21.1.jar;C:\Users\Mustapha\.m2\repository\org\apache\logging\log4j\log4j-api\2.21.1\log4j-api-2.21.1.jar;C:\Users\Mustapha\.m2\repository\org\slf4j\jul-to-slf4j\2.0.12\jul-to-slf4j-2.0.12.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-config\6.2.3\spring-security-config-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-core\6.2.3\spring-security-core-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-crypto\6.2.3\spring-security-crypto-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-expression\6.1.5\spring-expression-6.1.5.jar;C:\Users\Mustapha\.m2\repository\io\micrometer\micrometer-observation\1.12.4\micrometer-observation-1.12.4.jar;C:\Users\Mustapha\.m2\repository\io\micrometer\micrometer-commons\1.12.4\micrometer-commons-1.12.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-client\6.2.3\spring-security-oauth2-client-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-core\6.2.3\spring-security-oauth2-core-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\oauth2-oidc-sdk\9.43.3\oauth2-oidc-sdk-9.43.3.jar;C:\Users\Mustapha\.m2\repository\com\github\stephenc\jcip\jcip-annotations\1.0-1\jcip-annotations-1.0-1.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\content-type\2.2\content-type-2.2.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\lang-tag\1.7\lang-tag-1.7.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-jose\6.2.3\spring-security-oauth2-jose-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\nimbus-jose-jwt\9.24.4\nimbus-jose-jwt-9.24.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-aop\6.1.5\spring-aop-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-web\6.2.3\spring-security-web-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\10.1.19\tomcat-embed-el-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\validator\hibernate-validator\8.0.1.Final\hibernate-validator-8.0.1.Final.jar;C:\Users\Mustapha\.m2\repository\jakarta\validation\jakarta.validation-api\3.0.2\jakarta.validation-api-3.0.2.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.15.4\jackson-datatype-jdk8-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.15.4\jackson-datatype-jsr310-2.15.4.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\10.1.19\tomcat-embed-core-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\10.1.19\tomcat-embed-websocket-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-web\6.1.5\spring-web-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-webmvc\6.1.5\spring-webmvc-6.1.5.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-boot-starter\3.0.6\okta-spring-boot-starter-3.0.6.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-security-oauth2\3.0.6\okta-spring-security-oauth2-3.0.6.jar;C:\Users\Mustapha\.m2\repository\com\okta\commons\okta-config-check\1.3.3\okta-config-check-1.3.3.jar;C:\Users\Mustapha\.m2\repository\com\okta\commons\okta-commons-lang\1.3.3\okta-commons-lang-1.3.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-resource-server\6.2.3\spring-security-oauth2-resource-server-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-sdk\3.0.6\okta-spring-sdk-3.0.6.jar;C:\Users\Mustapha\.m2\repository\org\liquibase\liquibase-core\4.24.0\liquibase-core-4.24.0.jar;C:\Users\Mustapha\.m2\repository\com\opencsv\opencsv\5.8\opencsv-5.8.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-lang3\3.13.0\commons-lang3-3.13.0.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-text\1.10.0\commons-text-1.10.0.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar;C:\Users\Mustapha\.m2\repository\org\yaml\snakeyaml\2.2\snakeyaml-2.2.jar;C:\Users\Mustapha\.m2\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;C:\Users\Mustapha\.m2\repository\org\mapstruct\mapstruct\1.5.5.Final\mapstruct-1.5.5.Final.jar;C:\Users\Mustapha\.m2\repository\com\auth0\auth0\2.10.1\auth0-2.10.1.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okhttp3\okhttp\4.12.0\okhttp-4.12.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk8\1.9.23\kotlin-stdlib-jdk8-1.9.23.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib\1.9.23\kotlin-stdlib-1.9.23.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\annotations\13.0\annotations-13.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk7\1.9.23\kotlin-stdlib-jdk7-1.9.23.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okio\okio\3.5.0\okio-3.5.0.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okio\okio-jvm\3.5.0\okio-jvm-3.5.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-common\1.9.23\kotlin-stdlib-common-1.9.23.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okhttp3\logging-interceptor\4.12.0\logging-interceptor-4.12.0.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.15.4\jackson-databind-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.15.4\jackson-annotations-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.15.4\jackson-core-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\auth0\java-jwt\4.4.0\java-jwt-4.4.0.jar;C:\Users\Mustapha\.m2\repository\net\jodah\failsafe\2.4.4\failsafe-2.4.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-devtools\3.2.4\spring-boot-devtools-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot\3.2.4\spring-boot-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\3.2.4\spring-boot-autoconfigure-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-docker-compose\3.2.4\spring-boot-docker-compose-3.2.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.15.4\jackson-module-parameter-names-2.15.4.jar;C:\Users\Mustapha\.m2\repository\org\postgresql\postgresql\42.6.2\postgresql-42.6.2.jar;C:\Users\Mustapha\.m2\repository\org\checkerframework\checker-qual\3.31.0\checker-qual-3.31.0.jar;C:\Users\Mustapha\.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\4.0.2\jakarta.xml.bind-api-4.0.2.jar;C:\Users\Mustapha\.m2\repository\jakarta\activation\jakarta.activation-api\2.1.3\jakarta.activation-api-2.1.3.jar;C:\Users\Mustapha\.m2\repository\net\minidev\json-smart\2.5.0\json-smart-2.5.0.jar;C:\Users\Mustapha\.m2\repository\net\minidev\accessors-smart\2.5.0\accessors-smart-2.5.0.jar;C:\Users\Mustapha\.m2\repository\org\ow2\asm\asm\9.3\asm-9.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-core\6.1.5\spring-core-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-jcl\6.1.5\spring-jcl-6.1.5.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 3 {product} {ergonomic} - uint G1ConcRefinementThreads = 10 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 257949696 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4112515072 {product} {ergonomic} - size_t MaxNewSize = 2466250752 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 4096 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 0 {pd product} {ergonomic} - bool ProfileInterpreter = false {pd product} {command line} - uintx ProfiledCodeHeapSize = 0 {pd product} {ergonomic} - size_t SoftMaxHeapSize = 4112515072 {manageable} {ergonomic} - intx TieredStopAtLevel = 1 {product} {command line} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Release file: -IMPLEMENTOR="Microsoft" -IMPLEMENTOR_VERSION="Microsoft-12574459" -JAVA_RUNTIME_VERSION="21.0.9+10-LTS" -JAVA_VERSION="21.0.9" -JAVA_VERSION_DATE="2025-10-21" -LIBC="default" -MODULES="java.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.jvmstat jdk.attach jdk.charsets jdk.internal.opt jdk.zipfs jdk.compiler jdk.crypto.ec jdk.crypto.cryptoki jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.hotspot.agent jdk.httpserver jdk.incubator.vector jdk.internal.le jdk.internal.vm.ci jdk.internal.vm.compiler jdk.internal.vm.compiler.management jdk.jartool jdk.javadoc jdk.jcmd jdk.management jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jlink jdk.jpackage jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.nio.mapmode jdk.random jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported jdk.unsupported.desktop jdk.xml.dom" -OS_ARCH="x86_64" -OS_NAME="Windows" -SOURCE=".:git:e0bc49609000" - -Environment Variables: -JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 -PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm;c:\Users\Mustapha\.vscode\extensions\vscjava.vscode-java-debug-0.58.5\bundled\scripts\noConfigScripts -USERNAME=Mustapha -LANG=en_US.UTF-8 -OS=Windows_NT -PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD -TMP=C:\Users\Mustapha\AppData\Local\Temp -TEMP=C:\Users\Mustapha\AppData\Local\Temp - - - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: - Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -OS uptime: 0 days 5:03 hours -Hyper-V role detected - -CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss -Processor Information for the first 12 processors : - Max Mhz: 2301, Current Mhz: 1913, Mhz Limit: 2301 - -Memory: 4k page, system-wide physical 15681M (5332M free) -TotalPageFile size 23873M (AvailPageFile size 85M) -current process WorkingSet (physical memory assigned to process): 335M, peak: 405M -current process commit charge ("private bytes"): 412M, peak: 638M - -vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-13T22:04:36Z by "MicrosoftCorporation" with unknown MS VC++:1944 - -END. diff --git a/hs_err_pid3656.log b/hs_err_pid3656.log deleted file mode 100644 index adddb16..0000000 --- a/hs_err_pid3656.log +++ /dev/null @@ -1,244 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (mmap) failed to map 257949696 bytes. Error detail: G1 virtual space -# Possible reasons: -# The system is out of physical RAM or swap space -# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Zero Based Compressed Oops mode in which the Java heap is -# placed in the first 32GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 32GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (os_windows.cpp:3716), pid=3656, tid=6248 -# -# JRE version: (21.0.9+10) (build ) -# Java VM: OpenJDK 64-Bit Server VM (21.0.9+10-LTS, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: -XX:TieredStopAtLevel=1 fr.codecake.airbnbclone.NbatCloneBackApplication - -Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -Time: Wed Jan 28 10:43:58 2026 Morocco Daylight Time elapsed time: 1.195295 seconds (0d 0h 0m 1s) - ---------------- T H R E A D --------------- - -Current thread (0x000001be65a2b890): JavaThread "Unknown thread" [_thread_in_vm, id=6248, stack(0x0000001161f00000,0x0000001162000000) (1024K)] - -Stack: [0x0000001161f00000,0x0000001162000000] -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6df259] (no source info available) -V [jvm.dll+0x8bfe4b] (no source info available) -V [jvm.dll+0x8c23da] (no source info available) -V [jvm.dll+0x8c2ab3] (no source info available) -V [jvm.dll+0x28a416] (no source info available) -V [jvm.dll+0x6de705] (no source info available) -V [jvm.dll+0x6d264a] (no source info available) -V [jvm.dll+0x36742e] (no source info available) -V [jvm.dll+0x36f2fb] (no source info available) -V [jvm.dll+0x3c0c99] (no source info available) -V [jvm.dll+0x3c0f3b] (no source info available) -V [jvm.dll+0x33ace7] (no source info available) -V [jvm.dll+0x33b82b] (no source info available) -V [jvm.dll+0x88976e] (no source info available) -V [jvm.dll+0x3cdbf1] (no source info available) -V [jvm.dll+0x87267c] (no source info available) -V [jvm.dll+0x461751] (no source info available) -V [jvm.dll+0x463391] (no source info available) -C [jli.dll+0x52f0] (no source info available) -C [ucrtbase.dll+0x37b0] (no source info available) -C [KERNEL32.DLL+0x2e8d7] (no source info available) -C [ntdll.dll+0x8c53c] (no source info available) - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00007ffb364c7288, length=0, elements={ -} - -Java Threads: ( => current thread ) -Total: 0 - -Other Threads: - 0x000001be65a8e0f0 WorkerThread "GC Thread#0" [id=3160, stack(0x0000001162000000,0x0000001162100000) (1024K)] - 0x000001be65aa0650 ConcurrentGCThread "G1 Main Marker" [id=3204, stack(0x0000001162100000,0x0000001162200000) (1024K)] - 0x000001be65aa1d70 WorkerThread "G1 Conc#0" [id=16088, stack(0x0000001162200000,0x0000001162300000) (1024K)] - -[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffb35bbd7a7] -VM state: not at safepoint (not fully initialized) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00007ffb3653b9b0] Heap_lock - owner thread: 0x000001be65a2b890 - -Heap address: 0x000000070ae00000, size: 3922 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. -Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - -Heap: - garbage-first heap total 0K, used 0K [0x000000070ae00000, 0x0000000800000000) - region size 2048K, 0 young (0K), 0 survivors (0K) - -[error occurred during error reporting (printing heap information), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffb35fac219] -GC Heap History (0 events): -No events - -Dll operation events (1 events): -Event: 0.025 Loaded shared library C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll - -Deoptimization events (0 events): -No events - -Classes loaded (0 events): -No events - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (0 events): -No events - -ZGC Phase Switch (0 events): -No events - -VM Operations (0 events): -No events - -Memory protections (0 events): -No events - -Nmethod flushes (0 events): -No events - -Events (0 events): -No events - - -Dynamic libraries: -0x00007ff612cd0000 - 0x00007ff612cde000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.exe -0x00007ffbe2be0000 - 0x00007ffbe2e47000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ffbe17e0000 - 0x00007ffbe18a9000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ffbe0170000 - 0x00007ffbe055f000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ffbe05a0000 - 0x00007ffbe06eb000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffbdca30000 - 0x00007ffbdca48000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jli.dll -0x00007ffbd5640000 - 0x00007ffbd565e000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\VCRUNTIME140.dll -0x00007ffbe14d0000 - 0x00007ffbe1695000 C:\WINDOWS\System32\USER32.dll -0x00007ffbe0570000 - 0x00007ffbe0597000 C:\WINDOWS\System32\win32u.dll -0x00007ffbe1370000 - 0x00007ffbe139b000 C:\WINDOWS\System32\GDI32.dll -0x00007ffbbd980000 - 0x00007ffbbdc13000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll -0x00007ffbe06f0000 - 0x00007ffbe081c000 C:\WINDOWS\System32\gdi32full.dll -0x00007ffbe1420000 - 0x00007ffbe14c9000 C:\WINDOWS\System32\msvcrt.dll -0x00007ffbe0820000 - 0x00007ffbe08c3000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ffbe16a0000 - 0x00007ffbe16d1000 C:\WINDOWS\System32\IMM32.DLL -0x00007ffbdac80000 - 0x00007ffbdac8c000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\vcruntime140_1.dll -0x00007ffbc7490000 - 0x00007ffbc7519000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\msvcp140.dll -0x00007ffb35870000 - 0x00007ffb3661d000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server\jvm.dll -0x00007ffbe19f0000 - 0x00007ffbe1aa4000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ffbe1940000 - 0x00007ffbe19e6000 C:\WINDOWS\System32\sechost.dll -0x00007ffbe1150000 - 0x00007ffbe1268000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ffbe13a0000 - 0x00007ffbe1414000 C:\WINDOWS\System32\WS2_32.dll -0x00007ffbdfb90000 - 0x00007ffbdfbee000 C:\WINDOWS\SYSTEM32\POWRPROF.dll -0x00007ffbd8940000 - 0x00007ffbd8975000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ffbd8980000 - 0x00007ffbd898b000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ffbdfb70000 - 0x00007ffbdfb84000 C:\WINDOWS\SYSTEM32\UMPDC.dll -0x00007ffbdeaa0000 - 0x00007ffbdeabb000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll -0x00007ffbd5720000 - 0x00007ffbd572a000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\jimage.dll -0x00007ffbd1710000 - 0x00007ffbd1952000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL -0x00007ffbe2690000 - 0x00007ffbe2a16000 C:\WINDOWS\System32\combase.dll -0x00007ffbe0fc0000 - 0x00007ffbe1096000 C:\WINDOWS\System32\OLEAUT32.dll -0x00007ffbc4b30000 - 0x00007ffbc4b6c000 C:\WINDOWS\SYSTEM32\dbgcore.DLL -0x00007ffbe08d0000 - 0x00007ffbe0975000 C:\WINDOWS\System32\bcryptPrimitives.dll -0x00007ffbd38c0000 - 0x00007ffbd38e1000 C:\Users\Mustapha\.jdks\ms-21.0.9\bin\java.dll - -JVMTI agents: none - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;C:\Users\Mustapha\.jdks\ms-21.0.9\bin\server - -VM Arguments: -jvm_args: -XX:TieredStopAtLevel=1 -java_command: fr.codecake.airbnbclone.NbatCloneBackApplication -java_class_path (initial): C:\Users\Mustapha\Documents\Nbat\Nbat-project-backend\target\classes;C:\Users\Mustapha\.m2\repository\org\aspectj\aspectjweaver\1.9.21\aspectjweaver-1.9.21.jar;C:\Users\Mustapha\.m2\repository\com\zaxxer\HikariCP\5.0.1\HikariCP-5.0.1.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-jdbc\6.1.5\spring-jdbc-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\orm\hibernate-core\6.4.4.Final\hibernate-core-6.4.4.Final.jar;C:\Users\Mustapha\.m2\repository\jakarta\persistence\jakarta.persistence-api\3.1.0\jakarta.persistence-api-3.1.0.jar;C:\Users\Mustapha\.m2\repository\jakarta\transaction\jakarta.transaction-api\2.0.1\jakarta.transaction-api-2.0.1.jar;C:\Users\Mustapha\.m2\repository\org\jboss\logging\jboss-logging\3.5.3.Final\jboss-logging-3.5.3.Final.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\common\hibernate-commons-annotations\6.0.6.Final\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\Mustapha\.m2\repository\io\smallrye\jandex\3.1.2\jandex-3.1.2.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\classmate\1.6.0\classmate-1.6.0.jar;C:\Users\Mustapha\.m2\repository\net\bytebuddy\byte-buddy\1.14.12\byte-buddy-1.14.12.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\jaxb-runtime\4.0.5\jaxb-runtime-4.0.5.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\jaxb-core\4.0.5\jaxb-core-4.0.5.jar;C:\Users\Mustapha\.m2\repository\org\eclipse\angus\angus-activation\2.0.2\angus-activation-2.0.2.jar;C:\Users\Mustapha\.m2\repository\org\glassfish\jaxb\txw2\4.0.5\txw2-4.0.5.jar;C:\Users\Mustapha\.m2\repository\com\sun\istack\istack-commons-runtime\4.1.2\istack-commons-runtime-4.1.2.jar;C:\Users\Mustapha\.m2\repository\jakarta\inject\jakarta.inject-api\2.0.1\jakarta.inject-api-2.0.1.jar;C:\Users\Mustapha\.m2\repository\org\antlr\antlr4-runtime\4.13.0\antlr4-runtime-4.13.0.jar;C:\Users\Mustapha\.m2\repository\org\springframework\data\spring-data-jpa\3.2.4\spring-data-jpa-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\data\spring-data-commons\3.2.4\spring-data-commons-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-orm\6.1.5\spring-orm-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-context\6.1.5\spring-context-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-tx\6.1.5\spring-tx-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-beans\6.1.5\spring-beans-6.1.5.jar;C:\Users\Mustapha\.m2\repository\jakarta\annotation\jakarta.annotation-api\2.1.1\jakarta.annotation-api-2.1.1.jar;C:\Users\Mustapha\.m2\repository\org\slf4j\slf4j-api\2.0.12\slf4j-api-2.0.12.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-aspects\6.1.5\spring-aspects-6.1.5.jar;C:\Users\Mustapha\.m2\repository\ch\qos\logback\logback-classic\1.4.14\logback-classic-1.4.14.jar;C:\Users\Mustapha\.m2\repository\ch\qos\logback\logback-core\1.4.14\logback-core-1.4.14.jar;C:\Users\Mustapha\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.21.1\log4j-to-slf4j-2.21.1.jar;C:\Users\Mustapha\.m2\repository\org\apache\logging\log4j\log4j-api\2.21.1\log4j-api-2.21.1.jar;C:\Users\Mustapha\.m2\repository\org\slf4j\jul-to-slf4j\2.0.12\jul-to-slf4j-2.0.12.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-config\6.2.3\spring-security-config-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-core\6.2.3\spring-security-core-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-crypto\6.2.3\spring-security-crypto-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-expression\6.1.5\spring-expression-6.1.5.jar;C:\Users\Mustapha\.m2\repository\io\micrometer\micrometer-observation\1.12.4\micrometer-observation-1.12.4.jar;C:\Users\Mustapha\.m2\repository\io\micrometer\micrometer-commons\1.12.4\micrometer-commons-1.12.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-client\6.2.3\spring-security-oauth2-client-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-core\6.2.3\spring-security-oauth2-core-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\oauth2-oidc-sdk\9.43.3\oauth2-oidc-sdk-9.43.3.jar;C:\Users\Mustapha\.m2\repository\com\github\stephenc\jcip\jcip-annotations\1.0-1\jcip-annotations-1.0-1.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\content-type\2.2\content-type-2.2.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\lang-tag\1.7\lang-tag-1.7.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-jose\6.2.3\spring-security-oauth2-jose-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\nimbusds\nimbus-jose-jwt\9.24.4\nimbus-jose-jwt-9.24.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-aop\6.1.5\spring-aop-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-web\6.2.3\spring-security-web-6.2.3.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\10.1.19\tomcat-embed-el-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\hibernate\validator\hibernate-validator\8.0.1.Final\hibernate-validator-8.0.1.Final.jar;C:\Users\Mustapha\.m2\repository\jakarta\validation\jakarta.validation-api\3.0.2\jakarta.validation-api-3.0.2.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.15.4\jackson-datatype-jdk8-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.15.4\jackson-datatype-jsr310-2.15.4.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\10.1.19\tomcat-embed-core-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\10.1.19\tomcat-embed-websocket-10.1.19.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-web\6.1.5\spring-web-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-webmvc\6.1.5\spring-webmvc-6.1.5.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-boot-starter\3.0.6\okta-spring-boot-starter-3.0.6.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-security-oauth2\3.0.6\okta-spring-security-oauth2-3.0.6.jar;C:\Users\Mustapha\.m2\repository\com\okta\commons\okta-config-check\1.3.3\okta-config-check-1.3.3.jar;C:\Users\Mustapha\.m2\repository\com\okta\commons\okta-commons-lang\1.3.3\okta-commons-lang-1.3.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\security\spring-security-oauth2-resource-server\6.2.3\spring-security-oauth2-resource-server-6.2.3.jar;C:\Users\Mustapha\.m2\repository\com\okta\spring\okta-spring-sdk\3.0.6\okta-spring-sdk-3.0.6.jar;C:\Users\Mustapha\.m2\repository\org\liquibase\liquibase-core\4.24.0\liquibase-core-4.24.0.jar;C:\Users\Mustapha\.m2\repository\com\opencsv\opencsv\5.8\opencsv-5.8.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-lang3\3.13.0\commons-lang3-3.13.0.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-text\1.10.0\commons-text-1.10.0.jar;C:\Users\Mustapha\.m2\repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar;C:\Users\Mustapha\.m2\repository\org\yaml\snakeyaml\2.2\snakeyaml-2.2.jar;C:\Users\Mustapha\.m2\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;C:\Users\Mustapha\.m2\repository\org\mapstruct\mapstruct\1.5.5.Final\mapstruct-1.5.5.Final.jar;C:\Users\Mustapha\.m2\repository\com\auth0\auth0\2.10.1\auth0-2.10.1.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okhttp3\okhttp\4.12.0\okhttp-4.12.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk8\1.9.23\kotlin-stdlib-jdk8-1.9.23.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib\1.9.23\kotlin-stdlib-1.9.23.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\annotations\13.0\annotations-13.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk7\1.9.23\kotlin-stdlib-jdk7-1.9.23.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okio\okio\3.5.0\okio-3.5.0.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okio\okio-jvm\3.5.0\okio-jvm-3.5.0.jar;C:\Users\Mustapha\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib-common\1.9.23\kotlin-stdlib-common-1.9.23.jar;C:\Users\Mustapha\.m2\repository\com\squareup\okhttp3\logging-interceptor\4.12.0\logging-interceptor-4.12.0.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.15.4\jackson-databind-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.15.4\jackson-annotations-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.15.4\jackson-core-2.15.4.jar;C:\Users\Mustapha\.m2\repository\com\auth0\java-jwt\4.4.0\java-jwt-4.4.0.jar;C:\Users\Mustapha\.m2\repository\net\jodah\failsafe\2.4.4\failsafe-2.4.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-devtools\3.2.4\spring-boot-devtools-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot\3.2.4\spring-boot-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\3.2.4\spring-boot-autoconfigure-3.2.4.jar;C:\Users\Mustapha\.m2\repository\org\springframework\boot\spring-boot-docker-compose\3.2.4\spring-boot-docker-compose-3.2.4.jar;C:\Users\Mustapha\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.15.4\jackson-module-parameter-names-2.15.4.jar;C:\Users\Mustapha\.m2\repository\org\postgresql\postgresql\42.6.2\postgresql-42.6.2.jar;C:\Users\Mustapha\.m2\repository\org\checkerframework\checker-qual\3.31.0\checker-qual-3.31.0.jar;C:\Users\Mustapha\.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\4.0.2\jakarta.xml.bind-api-4.0.2.jar;C:\Users\Mustapha\.m2\repository\jakarta\activation\jakarta.activation-api\2.1.3\jakarta.activation-api-2.1.3.jar;C:\Users\Mustapha\.m2\repository\net\minidev\json-smart\2.5.0\json-smart-2.5.0.jar;C:\Users\Mustapha\.m2\repository\net\minidev\accessors-smart\2.5.0\accessors-smart-2.5.0.jar;C:\Users\Mustapha\.m2\repository\org\ow2\asm\asm\9.3\asm-9.3.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-core\6.1.5\spring-core-6.1.5.jar;C:\Users\Mustapha\.m2\repository\org\springframework\spring-jcl\6.1.5\spring-jcl-6.1.5.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 4 {product} {ergonomic} - uint ConcGCThreads = 3 {product} {ergonomic} - uint G1ConcRefinementThreads = 10 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 257949696 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 4112515072 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 4096 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 0 {pd product} {ergonomic} - bool ProfileInterpreter = false {pd product} {command line} - uintx ProfiledCodeHeapSize = 0 {pd product} {ergonomic} - size_t SoftMaxHeapSize = 4112515072 {manageable} {ergonomic} - intx TieredStopAtLevel = 1 {product} {command line} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Release file: - -Environment Variables: -JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 -PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm;c:\Users\Mustapha\.vscode\extensions\vscjava.vscode-java-debug-0.58.5\bundled\scripts\noConfigScripts -USERNAME=Mustapha -LANG=en_US.UTF-8 -OS=Windows_NT -PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD -TMP=C:\Users\Mustapha\AppData\Local\Temp -TEMP=C:\Users\Mustapha\AppData\Local\Temp - - - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: - Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -OS uptime: 0 days 1:36 hours -Hyper-V role detected - -CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss -Processor Information for the first 12 processors : - Max Mhz: 2301, Current Mhz: 1990, Mhz Limit: 2301 - -Memory: 4k page, system-wide physical 15681M (7562M free) -TotalPageFile size 23873M (AvailPageFile size 201M) -current process WorkingSet (physical memory assigned to process): 12M, peak: 12M -current process commit charge ("private bytes"): 59M, peak: 305M - -vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-13T22:04:36Z by "MicrosoftCorporation" with unknown MS VC++:1944 - -END. diff --git a/hs_err_pid4644.log b/hs_err_pid4644.log deleted file mode 100644 index 5c8f42e..0000000 --- a/hs_err_pid4644.log +++ /dev/null @@ -1,328 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (malloc) failed to allocate 1048576 bytes. Error detail: AllocateHeap -# Possible reasons: -# The system is out of physical RAM or swap space -# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Unscaled Compressed Oops mode in which the Java heap is -# placed in the first 4GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 4GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (allocation.cpp:44), pid=4644, tid=17564 -# -# JRE version: (21.0.9+10) (build ) -# Java VM: OpenJDK 64-Bit Server VM (21.0.9+10-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, parallel gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: --add-modules=ALL-SYSTEM --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -javaagent:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java -Daether.dependencyCollector.impl=bf c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -configuration c:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win -data c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java\jdt_ws --pipe=\\.\pipe\lsp-301b0667ee99336b0b4fd8eba72a3d13-sock - -Host: AMD Ryzen 5 5600U with Radeon Graphics , 12 cores, 15G, Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -Time: Tue Jan 27 23:16:22 2026 Morocco Daylight Time elapsed time: 0.108161 seconds (0d 0h 0m 0s) - ---------------- T H R E A D --------------- - -Current thread (0x00000206ed99dc50): JavaThread "Unknown thread" [_thread_in_vm, id=17564, stack(0x0000003d14b00000,0x0000003d14c00000) (1024K)] - -Stack: [0x0000003d14b00000,0x0000003d14c00000] -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6d6e29] -V [jvm.dll+0x8b4b76] -V [jvm.dll+0x8b712e] -V [jvm.dll+0x8b7813] -V [jvm.dll+0x283d86] -V [jvm.dll+0xc1277] -V [jvm.dll+0x71457d] -V [jvm.dll+0x714c3c] -V [jvm.dll+0x6e59c8] -V [jvm.dll+0x87e58c] -V [jvm.dll+0x3c42fc] -V [jvm.dll+0x86727b] -V [jvm.dll+0x457391] -V [jvm.dll+0x458f81] -C [jli.dll+0x52d0] -C [ucrtbase.dll+0x37b0] -C [KERNEL32.DLL+0x2e8d7] -C [ntdll.dll+0x8c53c] - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00000206eda0a050, length=1, elements={ -0x00000206ed99dc50 -} - -Java Threads: ( => current thread ) -=>0x00000206ed99dc50 JavaThread "Unknown thread" [_thread_in_vm, id=17564, stack(0x0000003d14b00000,0x0000003d14c00000) (1024K)] -Total: 1 - -Other Threads: - 0x00000206844dcb20 WatcherThread "VM Periodic Task Thread" [id=13288, stack(0x0000003d14d00000,0x0000003d14e00000) (1024K)] - 0x00000206ed9bbe20 WorkerThread "GC Thread#0" [id=20208, stack(0x0000003d14c00000,0x0000003d14d00000) (1024K)] -Total: 2 - -Threads with active compile tasks: -Total: 0 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap address: 0x0000000080000000, size: 2048 MB, Compressed Oops mode: 32-bit - -CDS archive(s) mapped at: [0x0000020685000000-0x0000020685ba0000-0x0000020685ba0000), size 12189696, SharedBaseAddress: 0x0000020685000000, ArchiveRelocationMode: 1. -Compressed class space mapped at: 0x0000020686000000-0x00000206c6000000, reserved size: 1073741824 -Narrow klass base: 0x0000020685000000, Narrow klass shift: 0, Narrow klass range: 0x100000000 - -GC Precious Log: - CardTable entry size: 512 - CPUs: 12 total, 12 available - Memory: 15681M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (32-bit) - Alignments: Space 512K, Generation 512K, Heap 2M - Heap Min Capacity: 100M - Heap Initial Capacity: 100M - Heap Max Capacity: 2G - Pre-touch: Disabled - Parallel Workers: 10 - -Heap: - PSYoungGen total 29696K, used 512K [0x00000000d5580000, 0x00000000d7680000, 0x0000000100000000) - eden space 25600K, 2% used [0x00000000d5580000,0x00000000d5600020,0x00000000d6e80000) - from space 4096K, 0% used [0x00000000d7280000,0x00000000d7280000,0x00000000d7680000) - to space 4096K, 0% used [0x00000000d6e80000,0x00000000d6e80000,0x00000000d7280000) - ParOldGen total 68608K, used 0K [0x0000000080000000, 0x0000000084300000, 0x00000000d5580000) - object space 68608K, 0% used [0x0000000080000000,0x0000000080000000,0x0000000084300000) - Metaspace used 0K, committed 0K, reserved 1048576K - class space used 0K, committed 0K, reserved 1048576K - -Card table byte_map: [0x00000206ed340000,0x00000206ed750000] _byte_map_base: 0x00000206ecf40000 - -Marking Bits: (ParMarkBitMap*) 0x00007ffc71d92460 - Begin Bits: [0x0000020680000000, 0x0000020682000000) - End Bits: [0x0000020682000000, 0x0000020684000000) - -Polling page: 0x00000206eb800000 - -Metaspace: - -Usage: - Non-class: 0 bytes used. - Class: 0 bytes used. - Both: 0 bytes used. - -Virtual space: - Non-class space: 0 bytes reserved, 0 bytes ( ?%) committed, 0 nodes. - Class space: 1.00 GB reserved, 0 bytes ( 0%) committed, 1 nodes. - Both: 1.00 GB reserved, 0 bytes ( 0%) committed. - -Chunk freelists: - Non-Class: 0 bytes - Class: 16.00 MB - Both: 16.00 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 17179869184.00 GB -CDS: on - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 0. -num_arena_births: 0. -num_arena_deaths: 0. -num_vsnodes_births: 1. -num_vsnodes_deaths: 0. -num_space_committed: 0. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 0. -num_chunks_taken_from_freelist: 1. -num_chunk_merges: 0. -num_chunk_splits: 1. -num_chunks_enlarged: 0. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=120000Kb used=0Kb max_used=0Kb free=120000Kb - bounds [0x00000206f8670000, 0x00000206f88e0000, 0x00000206ffba0000] -CodeHeap 'profiled nmethods': size=120000Kb used=0Kb max_used=0Kb free=120000Kb - bounds [0x00000206f0ba0000, 0x00000206f0e10000, 0x00000206f80d0000] -CodeHeap 'non-nmethods': size=5760Kb used=194Kb max_used=342Kb free=5565Kb - bounds [0x00000206f80d0000, 0x00000206f8340000, 0x00000206f8670000] -CodeCache: size=245760Kb, used=194Kb, max_used=342Kb, free=245565Kb - total_blobs=70, nmethods=0, adapters=48, full_count=0 -Compilation: enabled, stopped_count=0, restarted_count=0 - -Compilation events (0 events): -No events - -GC Heap History (0 events): -No events - -Dll operation events (1 events): -Event: 0.021 Loaded shared library c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.dll - -Deoptimization events (0 events): -No events - -Classes loaded (0 events): -No events - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (0 events): -No events - -ZGC Phase Switch (0 events): -No events - -VM Operations (0 events): -No events - -Memory protections (0 events): -No events - -Nmethod flushes (0 events): -No events - -Events (1 events): -Event: 0.043 Thread 0x00000206ed99dc50 Thread added: 0x00000206ed99dc50 - - -Dynamic libraries: -0x00007ff6d7220000 - 0x00007ff6d722e000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.exe -0x00007ffd14000000 - 0x00007ffd14267000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ffd13130000 - 0x00007ffd131f9000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ffd11820000 - 0x00007ffd11c0f000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ffd11c50000 - 0x00007ffd11d9b000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffcf6520000 - 0x00007ffcf653e000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\VCRUNTIME140.dll -0x00007ffd07170000 - 0x00007ffd07188000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jli.dll -0x00007ffd12500000 - 0x00007ffd126c5000 C:\WINDOWS\System32\USER32.dll -0x00007ffd11c20000 - 0x00007ffd11c47000 C:\WINDOWS\System32\win32u.dll -0x00007ffcebfd0000 - 0x00007ffcec263000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044\COMCTL32.dll -0x00007ffd13be0000 - 0x00007ffd13c0b000 C:\WINDOWS\System32\GDI32.dll -0x00007ffd13b20000 - 0x00007ffd13bc9000 C:\WINDOWS\System32\msvcrt.dll -0x00007ffd11200000 - 0x00007ffd1132c000 C:\WINDOWS\System32\gdi32full.dll -0x00007ffd11480000 - 0x00007ffd11523000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ffd13ae0000 - 0x00007ffd13b11000 C:\WINDOWS\System32\IMM32.DLL -0x00007ffcfac30000 - 0x00007ffcfac3c000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\vcruntime140_1.dll -0x00007ffcf52e0000 - 0x00007ffcf536d000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\msvcp140.dll -0x00007ffc710d0000 - 0x00007ffc71e70000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\server\jvm.dll -0x00007ffd12bc0000 - 0x00007ffd12c74000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ffd12a10000 - 0x00007ffd12ab6000 C:\WINDOWS\System32\sechost.dll -0x00007ffd139c0000 - 0x00007ffd13ad8000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ffd13c90000 - 0x00007ffd13d04000 C:\WINDOWS\System32\WS2_32.dll -0x00007ffd10fb0000 - 0x00007ffd1100e000 C:\WINDOWS\SYSTEM32\POWRPROF.dll -0x00007ffd0aa50000 - 0x00007ffd0aa5b000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ffd0aa10000 - 0x00007ffd0aa45000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ffd10f90000 - 0x00007ffd10fa4000 C:\WINDOWS\SYSTEM32\UMPDC.dll -0x00007ffd0fec0000 - 0x00007ffd0fedb000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll -0x00007ffcf9670000 - 0x00007ffcf967a000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\jimage.dll -0x00007ffd04120000 - 0x00007ffd04362000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL -0x00007ffd13600000 - 0x00007ffd13986000 C:\WINDOWS\System32\combase.dll -0x00007ffd126d0000 - 0x00007ffd127a6000 C:\WINDOWS\System32\OLEAUT32.dll -0x00007ffcf6ec0000 - 0x00007ffcf6efc000 C:\WINDOWS\SYSTEM32\dbgcore.DLL -0x00007ffd11150000 - 0x00007ffd111f5000 C:\WINDOWS\System32\bcryptPrimitives.dll -0x00007ffcf8ba0000 - 0x00007ffcf8baf000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\instrument.dll -0x00007ffcf3990000 - 0x00007ffcf39b0000 c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\java.dll - -JVMTI agents: -c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar path:none, loaded, not initialized, instrumentlib options:none - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.26100.7309_none_3e05feeae336a044;c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\jre\21.0.9-win32-x86_64\bin\server - -VM Arguments: -jvm_args: --add-modules=ALL-SYSTEM --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -javaagent:c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\lombok\lombok-1.18.39-4050.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java -Daether.dependencyCollector.impl=bf -java_command: c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -configuration c:\Users\Mustapha\AppData\Roaming\Code\User\globalStorage\redhat.java\1.51.0\config_win -data c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java\jdt_ws --pipe=\\.\pipe\lsp-301b0667ee99336b0b4fd8eba72a3d13-sock -java_class_path (initial): c:\Users\Mustapha\.vscode\extensions\redhat.java-1.51.0-win32-x64\server\plugins\org.eclipse.equinox.launcher_1.7.100.v20251111-0406.jar -Launcher Type: SUN_STANDARD - -[Global flags] - uintx AdaptiveSizePolicyWeight = 90 {product} {command line} - intx CICompilerCount = 4 {product} {ergonomic} - uintx GCTimeRatio = 4 {product} {command line} - bool HeapDumpOnOutOfMemoryError = true {manageable} {command line} - ccstr HeapDumpPath = c:\Users\Mustapha\AppData\Roaming\Code\User\workspaceStorage\002b2a608965fa8a281d5bbb1ab2b887\redhat.java {manageable} {command line} - size_t InitialHeapSize = 104857600 {product} {command line} - size_t MaxHeapSize = 2147483648 {product} {command line} - size_t MaxNewSize = 715653120 {product} {ergonomic} - size_t MinHeapDeltaBytes = 524288 {product} {ergonomic} - size_t MinHeapSize = 104857600 {product} {command line} - size_t NewSize = 34603008 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5839372 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} - size_t OldSize = 70254592 {product} {ergonomic} - uintx ProfiledCodeHeapSize = 122909434 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 2147483648 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - bool UseParallelGC = true {product} {command line} - -Logging: -Log output configuration: - #0: stdout all=off uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Release file: - -Environment Variables: -JAVA_HOME=C:\Users\Mustapha\.jdks\ms-21.0.9 -PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Mustapha\.jdks\ms-21.0.9\bin;C:\laragon\bin\php\php-8.3.28-Win32-vs16-x64;C:\Program Files\Docker\Docker\resources\bin;C:\Users\Mustapha\AppData\Local\Microsoft\WindowsApps;C:\Users\Mustapha\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Mustapha\AppData\Roaming\npm -USERNAME=Mustapha -OS=Windows_NT -PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD -TMP=C:\Users\Mustapha\AppData\Local\Temp -TEMP=C:\Users\Mustapha\AppData\Local\Temp - - - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: - Windows 11 , 64 bit Build 26100 (10.0.26100.7623) -OS uptime: 0 days 1:07 hours -Hyper-V role detected - -CPU: total 12 (initial active 12) (12 cores per cpu, 2 threads per core) family 25 model 80 stepping 0 microcode 0xa500014, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, hv, rdtscp, rdpid, fsrm, f16c, cet_ss -Processor Information for the first 12 processors : - Max Mhz: 2301, Current Mhz: 1990, Mhz Limit: 2301 - -Memory: 4k page, system-wide physical 15681M (5955M free) -TotalPageFile size 23873M (AvailPageFile size 2M) -current process WorkingSet (physical memory assigned to process): 26M, peak: 26M -current process commit charge ("private bytes"): 218M, peak: 219M - -vm_info: OpenJDK 64-Bit Server VM (21.0.9+10-LTS) for windows-amd64 JRE (21.0.9+10-LTS), built on 2025-10-21T00:00:00Z by "admin" with unknown MS VC++:1942 - -END. diff --git a/init.sql b/init.sql index dec10d4..8914282 100644 --- a/init.sql +++ b/init.sql @@ -1 +1,2 @@ +-- Initialize empty schema for NBAT (tables created by Hibernate on first run) CREATE SCHEMA IF NOT EXISTS nbat_schema; \ No newline at end of file diff --git a/pom.xml b/pom.xml index f5bcf70..4857ef4 100644 --- a/pom.xml +++ b/pom.xml @@ -9,10 +9,10 @@ fr.codecake - airbnb-clone-back + nbat-back 0.0.1-SNAPSHOT - airbnb-clone-back - Airbnb Clone API + nbat-back + nbat API 21 1.5.5.Final @@ -43,10 +43,6 @@ okta-spring-boot-starter 3.0.6 - - org.liquibase - liquibase-core - org.mapstruct mapstruct @@ -87,6 +83,11 @@ spring-security-test test + + + org.springframework.boot + spring-boot-starter-websocket + @@ -115,14 +116,6 @@ - - org.liquibase - liquibase-maven-plugin - 4.24.0 - - src/main/resources/liquibase.properties - - diff --git a/src/main/java/fr/codecake/airbnbclone/infrastructure/config/SecurityConfiguration.java b/src/main/java/fr/codecake/airbnbclone/infrastructure/config/SecurityConfiguration.java deleted file mode 100644 index de2d36a..0000000 --- a/src/main/java/fr/codecake/airbnbclone/infrastructure/config/SecurityConfiguration.java +++ /dev/null @@ -1,71 +0,0 @@ -package fr.codecake.airbnbclone.infrastructure.config; - -import java.util.HashSet; -import java.util.Set; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpMethod; -import org.springframework.security.config.Customizer; -import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; -import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; -import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; -import org.springframework.security.web.SecurityFilterChain; -import org.springframework.security.web.csrf.CookieCsrfTokenRepository; -import org.springframework.security.web.csrf.CsrfTokenRequestAttributeHandler; - -@Configuration -@EnableMethodSecurity -public class SecurityConfiguration { - - private final ClientRegistrationRepository clientRegistrationRepository; - - public SecurityConfiguration(ClientRegistrationRepository clientRegistrationRepository) { - this.clientRegistrationRepository = clientRegistrationRepository; - } - - @Bean - public SecurityFilterChain configure(HttpSecurity http) throws Exception { - CsrfTokenRequestAttributeHandler requestHandler = new CsrfTokenRequestAttributeHandler(); - requestHandler.setCsrfRequestAttributeName(null); - http.authorizeHttpRequests(authorize -> authorize - .requestMatchers(HttpMethod.GET, "api/tenant-listing/get-all-by-category").permitAll() - .requestMatchers(HttpMethod.GET, "api/tenant-listing/get-one").permitAll() - .requestMatchers(HttpMethod.POST, "api/tenant-listing/search").permitAll() - .requestMatchers(HttpMethod.GET, "api/booking/check-availability").permitAll() - .requestMatchers(HttpMethod.GET, "assets/*").permitAll() - .anyRequest() - .authenticated()) - .csrf(csrf -> csrf.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) - .csrfTokenRequestHandler(requestHandler)) - .oauth2Login(oauth2 -> oauth2 - .authorizationEndpoint(authorization -> authorization - .authorizationRequestResolver( - new CustomAuthorizationRequestResolver(clientRegistrationRepository) - ) - ) - ) - .oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())) - .oauth2Client(Customizer.withDefaults()); - - return http.build(); - } - - @Bean - public GrantedAuthoritiesMapper userAuthoritiesMapper() { - return authorities -> { - Set grantedAuthorities = new HashSet<>(); - - authorities.forEach(grantedAuthority -> { - if (grantedAuthority instanceof OidcUserAuthority oidcUserAuthority) { - grantedAuthorities - .addAll(SecurityUtils.extractAuthorityFromClaims(oidcUserAuthority.getUserInfo().getClaims())); - } - }); - return grantedAuthorities; - }; - } -} \ No newline at end of file diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/LandlordService.java b/src/main/java/fr/codecake/airbnbclone/listing/application/LandlordService.java deleted file mode 100644 index 1929121..0000000 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/LandlordService.java +++ /dev/null @@ -1,86 +0,0 @@ -package fr.codecake.airbnbclone.listing.application; - -import fr.codecake.airbnbclone.listing.application.dto.CreatedListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.DisplayCardListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.ListingCreateBookingDTO; -import fr.codecake.airbnbclone.listing.application.dto.SaveListingDTO; -import fr.codecake.airbnbclone.listing.domain.Listing; -import fr.codecake.airbnbclone.listing.mapper.ListingMapper; -import fr.codecake.airbnbclone.listing.repository.ListingRepository; -import fr.codecake.airbnbclone.sharedkernel.service.State; -import fr.codecake.airbnbclone.user.application.Auth0Service; -import fr.codecake.airbnbclone.user.application.UserService; -import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; -import java.util.Optional; -import java.util.UUID; - -@Service -public class LandlordService { - - private final ListingRepository listingRepository; - - private final ListingMapper listingMapper; - private final UserService userService; - private final Auth0Service auth0Service; - private final PictureService pictureService; - - public LandlordService(ListingRepository listingRepository, ListingMapper listingMapper, UserService userService, Auth0Service auth0Service, PictureService pictureService) { - this.listingRepository = listingRepository; - this.listingMapper = listingMapper; - this.userService = userService; - this.auth0Service = auth0Service; - this.pictureService = pictureService; - } - - public CreatedListingDTO create(SaveListingDTO saveListingDTO) { - Listing newListing = listingMapper.saveListingDTOToListing(saveListingDTO); - - ReadUserDTO userConnected = userService.getAuthenticatedUserFromSecurityContext(); - newListing.setLandlordPublicId(userConnected.publicId()); - - Listing savedListing = listingRepository.saveAndFlush(newListing); - - pictureService.saveAll(saveListingDTO.getPictures(), savedListing); - - auth0Service.addLandlordRoleToUser(userConnected); - - return listingMapper.listingToCreatedListingDTO(savedListing); - } - - @Transactional(readOnly = true) - public List getAllProperties(ReadUserDTO landlord) { - List properties = listingRepository.findAllByLandlordPublicIdFetchCoverPicture(landlord.publicId()); - return listingMapper.listingToDisplayCardListingDTOs(properties); - } - - @Transactional - public State delete(UUID publicId, ReadUserDTO landlord) { - long deletedSuccessfuly = listingRepository.deleteByPublicIdAndLandlordPublicId(publicId, landlord.publicId()); - if (deletedSuccessfuly > 0) { - return State.builder().forSuccess(publicId); - } else { - return State.builder().forUnauthorized("User not authorized to delete this listing"); - } - } - - public Optional getByListingPublicId(UUID publicId) { - return listingRepository.findByPublicId(publicId).map(listingMapper::mapListingToListingCreateBookingDTO); - } - - public List getCardDisplayByListingPublicId(List allListingPublicIDs) { - return listingRepository.findAllByPublicIdIn(allListingPublicIDs) - .stream() - .map(listingMapper::listingToDisplayCardListingDTO) - .toList(); - } - - @Transactional(readOnly = true) - public Optional getByPublicIdAndLandlordPublicId(UUID listingPublicId, UUID landlordPublicId) { - return listingRepository.findOneByPublicIdAndLandlordPublicId(listingPublicId, landlordPublicId) - .map(listingMapper::listingToDisplayCardListingDTO); - } -} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/CreatedListingDTO.java b/src/main/java/fr/codecake/airbnbclone/listing/application/dto/CreatedListingDTO.java deleted file mode 100644 index e9eb02c..0000000 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/CreatedListingDTO.java +++ /dev/null @@ -1,4 +0,0 @@ -package fr.codecake.airbnbclone.listing.application.dto; - -public record CreatedListingDTO(String publicId) { -} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/ListingCreateBookingDTO.java b/src/main/java/fr/codecake/airbnbclone/listing/application/dto/ListingCreateBookingDTO.java deleted file mode 100644 index 56863ad..0000000 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/ListingCreateBookingDTO.java +++ /dev/null @@ -1,9 +0,0 @@ -package fr.codecake.airbnbclone.listing.application.dto; - -import fr.codecake.airbnbclone.listing.application.dto.vo.PriceVO; - -import java.util.UUID; - -public record ListingCreateBookingDTO( - UUID listingPublicId, PriceVO price) { -} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/DescriptionDTO.java b/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/DescriptionDTO.java deleted file mode 100644 index 5e83ccd..0000000 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/DescriptionDTO.java +++ /dev/null @@ -1,11 +0,0 @@ -package fr.codecake.airbnbclone.listing.application.dto.sub; - -import fr.codecake.airbnbclone.listing.application.dto.vo.DescriptionVO; -import fr.codecake.airbnbclone.listing.application.dto.vo.TitleVO; -import jakarta.validation.constraints.NotNull; - -public record DescriptionDTO( - @NotNull TitleVO title, - @NotNull DescriptionVO description - ) { -} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/ListingInfoDTO.java b/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/ListingInfoDTO.java deleted file mode 100644 index 4413140..0000000 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/ListingInfoDTO.java +++ /dev/null @@ -1,15 +0,0 @@ -package fr.codecake.airbnbclone.listing.application.dto.sub; - -import fr.codecake.airbnbclone.listing.application.dto.vo.BathsVO; -import fr.codecake.airbnbclone.listing.application.dto.vo.BedroomsVO; -import fr.codecake.airbnbclone.listing.application.dto.vo.BedsVO; -import fr.codecake.airbnbclone.listing.application.dto.vo.GuestsVO; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; - -public record ListingInfoDTO( - @NotNull @Valid GuestsVO guests, - @NotNull @Valid BedroomsVO bedrooms, - @NotNull @Valid BedsVO beds, - @NotNull @Valid BathsVO baths) { -} diff --git a/src/main/java/fr/codecake/airbnbclone/user/application/Auth0Service.java b/src/main/java/fr/codecake/airbnbclone/user/application/Auth0Service.java deleted file mode 100644 index 60383bb..0000000 --- a/src/main/java/fr/codecake/airbnbclone/user/application/Auth0Service.java +++ /dev/null @@ -1,71 +0,0 @@ -package fr.codecake.airbnbclone.user.application; - -import com.auth0.client.auth.AuthAPI; -import com.auth0.client.mgmt.ManagementAPI; -import com.auth0.client.mgmt.filter.FieldsFilter; -import com.auth0.exception.APIException; -import com.auth0.exception.Auth0Exception; -import com.auth0.json.auth.TokenHolder; -import com.auth0.json.mgmt.users.User; -import com.auth0.net.Response; -import com.auth0.net.TokenRequest; -import fr.codecake.airbnbclone.infrastructure.config.SecurityUtils; -import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.UUID; - -@Service -public class Auth0Service { - - @Value("${okta.oauth2.client-id}") - private String clientId; - - @Value("${okta.oauth2.client-secret}") - private String clientSecret; - - @Value("${okta.oauth2.issuer}") - private String domain; - - @Value("${application.auth0.management-client-id}") - private String managementClientId; - - @Value("${application.auth0.management-client-secret}") - private String managementClientSecret; - - @Value("${application.auth0.role-landlord-id}") - private String roleLandlordId; - - public void addLandlordRoleToUser(ReadUserDTO readUserDTO, String auth0UserId) { - if (readUserDTO.authorities().stream().noneMatch(role -> role.equals(SecurityUtils.ROLE_LANDLORD))) { - try { - String accessToken = this.getAccessToken(); - assignRoleById(accessToken, auth0UserId, roleLandlordId); - } catch (Auth0Exception a) { - throw new UserException( - String.format("not possible to assign %s to %s", roleLandlordId, readUserDTO.publicId())); - } - } - } - - private void assignRoleById(String accessToken, String auth0UserId, String roleIdToAdd) { - try { - ManagementAPI mgmt = ManagementAPI.newBuilder(domain, accessToken).build(); - mgmt.roles().assignUsers(roleIdToAdd, List.of(auth0UserId)).execute(); - } catch (APIException e) { - System.out.println("request was executed but the response wasn't successful"); - } catch (Auth0Exception e) { - System.out.println("request couldn't be created or executed successfully"); - } - } - - private String getAccessToken() throws Auth0Exception { - AuthAPI authAPI = AuthAPI.newBuilder(domain, managementClientId, managementClientSecret).build(); - TokenRequest tokenRequest = authAPI.requestToken(domain + "api/v2/"); - TokenHolder holder = tokenRequest.execute().getBody(); - return holder.getAccessToken(); - } - -} \ No newline at end of file diff --git a/src/main/java/fr/codecake/airbnbclone/user/application/UserService.java b/src/main/java/fr/codecake/airbnbclone/user/application/UserService.java deleted file mode 100644 index cd3a5f8..0000000 --- a/src/main/java/fr/codecake/airbnbclone/user/application/UserService.java +++ /dev/null @@ -1,83 +0,0 @@ -package fr.codecake.airbnbclone.user.application; - -import fr.codecake.airbnbclone.infrastructure.config.SecurityUtils; -import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; -import fr.codecake.airbnbclone.user.domain.User; -import fr.codecake.airbnbclone.user.mapper.UserMapper; -import fr.codecake.airbnbclone.user.repository.UserRepository; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.oauth2.core.user.OAuth2User; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.Instant; -import java.util.Map; -import java.util.Optional; -import java.util.UUID; - -@Service -public class UserService { - - private static final String UPDATED_AT_KEY = "updated_at"; - private final UserRepository userRepository; - private final UserMapper userMapper; - - public UserService(UserRepository userRepository, UserMapper userMapper) { - this.userRepository = userRepository; - this.userMapper = userMapper; - } - - @Transactional(readOnly = true) - public ReadUserDTO getAuthenticatedUserFromSecurityContext() { - OAuth2User principal = (OAuth2User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - User user = SecurityUtils.mapOauth2AttributesToUser(principal.getAttributes()); - return getByEmail(user.getEmail()).orElseThrow(); - } - - @Transactional(readOnly = true) - public Optional getByEmail(String email) { - Optional oneByEmail = userRepository.findOneByEmail(email); - return oneByEmail.map(userMapper::userToReadUserDTO); - } - - public void syncWithIdp(OAuth2User oAuth2User, boolean forceResync) { - Map attributes = oAuth2User.getAttributes(); - User user = SecurityUtils.mapOauth2AttributesToUser(attributes); - Optional existingUser = userRepository.findOneByEmail(user.getEmail()); - if (existingUser.isPresent()) { - if (attributes.get(UPDATED_AT_KEY) != null) { - Instant lastModifiedDate = existingUser.orElseThrow().getLastModifiedDate(); - Instant idpModifiedDate; - if (attributes.get(UPDATED_AT_KEY) instanceof Instant instant) { - idpModifiedDate = instant; - } else { - idpModifiedDate = Instant.ofEpochSecond((Integer) attributes.get(UPDATED_AT_KEY)); - } - if (idpModifiedDate.isAfter(lastModifiedDate) || forceResync) { - updateUser(user); - } - } - } else { - userRepository.saveAndFlush(user); - } - } - - private void updateUser(User user) { - Optional userToUpdateOpt = userRepository.findOneByEmail(user.getEmail()); - if (userToUpdateOpt.isPresent()) { - User userToUpdate = userToUpdateOpt.get(); - userToUpdate.setEmail(user.getEmail()); - userToUpdate.setFirstName(user.getFirstName()); - userToUpdate.setLastName(user.getLastName()); - userToUpdate.setAuthorities(user.getAuthorities()); - userToUpdate.setImageUrl(user.getImageUrl()); - userRepository.saveAndFlush(userToUpdate); - } - } - - public Optional getByPublicId(UUID publicId) { - Optional oneByPublicId = userRepository.findOneByPublicId(publicId); - return oneByPublicId.map(userMapper::userToReadUserDTO); - } - -} diff --git a/src/main/java/fr/codecake/airbnbclone/NbatCloneBackApplication.java b/src/main/java/fr/codecake/nbat/NbatCloneBackApplication.java similarity index 90% rename from src/main/java/fr/codecake/airbnbclone/NbatCloneBackApplication.java rename to src/main/java/fr/codecake/nbat/NbatCloneBackApplication.java index 4d00e1a..cb64bb1 100644 --- a/src/main/java/fr/codecake/airbnbclone/NbatCloneBackApplication.java +++ b/src/main/java/fr/codecake/nbat/NbatCloneBackApplication.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone; +package fr.codecake.nbat; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/fr/codecake/airbnbclone/booking/application/BookingService.java b/src/main/java/fr/codecake/nbat/booking/application/BookingService.java similarity index 86% rename from src/main/java/fr/codecake/airbnbclone/booking/application/BookingService.java rename to src/main/java/fr/codecake/nbat/booking/application/BookingService.java index 3d13795..778522f 100644 --- a/src/main/java/fr/codecake/airbnbclone/booking/application/BookingService.java +++ b/src/main/java/fr/codecake/nbat/booking/application/BookingService.java @@ -1,19 +1,19 @@ -package fr.codecake.airbnbclone.booking.application; - -import fr.codecake.airbnbclone.booking.application.dto.BookedDateDTO; -import fr.codecake.airbnbclone.booking.application.dto.BookedListingDTO; -import fr.codecake.airbnbclone.booking.application.dto.NewBookingDTO; -import fr.codecake.airbnbclone.booking.domain.Booking; -import fr.codecake.airbnbclone.booking.mapper.BookingMapper; -import fr.codecake.airbnbclone.booking.repository.BookingRepository; -import fr.codecake.airbnbclone.infrastructure.config.SecurityUtils; -import fr.codecake.airbnbclone.listing.application.LandlordService; -import fr.codecake.airbnbclone.listing.application.dto.DisplayCardListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.ListingCreateBookingDTO; -import fr.codecake.airbnbclone.listing.application.dto.vo.PriceVO; -import fr.codecake.airbnbclone.sharedkernel.service.State; -import fr.codecake.airbnbclone.user.application.UserService; -import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; +package fr.codecake.nbat.booking.application; + +import fr.codecake.nbat.booking.application.dto.BookedDateDTO; +import fr.codecake.nbat.booking.application.dto.BookedListingDTO; +import fr.codecake.nbat.booking.application.dto.NewBookingDTO; +import fr.codecake.nbat.booking.domain.Booking; +import fr.codecake.nbat.booking.mapper.BookingMapper; +import fr.codecake.nbat.booking.repository.BookingRepository; +import fr.codecake.nbat.infrastructure.config.SecurityUtils; +import fr.codecake.nbat.listing.application.LandlordService; +import fr.codecake.nbat.listing.application.dto.DisplayCardListingDTO; +import fr.codecake.nbat.listing.application.dto.ListingCreateBookingDTO; +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; +import fr.codecake.nbat.sharedkernel.service.State; +import fr.codecake.nbat.user.application.UserService; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/fr/codecake/airbnbclone/booking/application/dto/BookedDateDTO.java b/src/main/java/fr/codecake/nbat/booking/application/dto/BookedDateDTO.java similarity index 77% rename from src/main/java/fr/codecake/airbnbclone/booking/application/dto/BookedDateDTO.java rename to src/main/java/fr/codecake/nbat/booking/application/dto/BookedDateDTO.java index d1896bb..0b21546 100644 --- a/src/main/java/fr/codecake/airbnbclone/booking/application/dto/BookedDateDTO.java +++ b/src/main/java/fr/codecake/nbat/booking/application/dto/BookedDateDTO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.booking.application.dto; +package fr.codecake.nbat.booking.application.dto; import java.time.OffsetDateTime; diff --git a/src/main/java/fr/codecake/airbnbclone/booking/application/dto/BookedListingDTO.java b/src/main/java/fr/codecake/nbat/booking/application/dto/BookedListingDTO.java similarity index 72% rename from src/main/java/fr/codecake/airbnbclone/booking/application/dto/BookedListingDTO.java rename to src/main/java/fr/codecake/nbat/booking/application/dto/BookedListingDTO.java index c97977e..c858393 100644 --- a/src/main/java/fr/codecake/airbnbclone/booking/application/dto/BookedListingDTO.java +++ b/src/main/java/fr/codecake/nbat/booking/application/dto/BookedListingDTO.java @@ -1,7 +1,7 @@ -package fr.codecake.airbnbclone.booking.application.dto; +package fr.codecake.nbat.booking.application.dto; -import fr.codecake.airbnbclone.listing.application.dto.sub.PictureDTO; -import fr.codecake.airbnbclone.listing.application.dto.vo.PriceVO; +import fr.codecake.nbat.listing.application.dto.sub.PictureDTO; +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/booking/application/dto/NewBookingDTO.java b/src/main/java/fr/codecake/nbat/booking/application/dto/NewBookingDTO.java similarity index 82% rename from src/main/java/fr/codecake/airbnbclone/booking/application/dto/NewBookingDTO.java rename to src/main/java/fr/codecake/nbat/booking/application/dto/NewBookingDTO.java index 14eb439..fbba1fb 100644 --- a/src/main/java/fr/codecake/airbnbclone/booking/application/dto/NewBookingDTO.java +++ b/src/main/java/fr/codecake/nbat/booking/application/dto/NewBookingDTO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.booking.application.dto; +package fr.codecake.nbat.booking.application.dto; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/booking/domain/Booking.java b/src/main/java/fr/codecake/nbat/booking/domain/Booking.java similarity index 96% rename from src/main/java/fr/codecake/airbnbclone/booking/domain/Booking.java rename to src/main/java/fr/codecake/nbat/booking/domain/Booking.java index dcddf40..d7f0706 100644 --- a/src/main/java/fr/codecake/airbnbclone/booking/domain/Booking.java +++ b/src/main/java/fr/codecake/nbat/booking/domain/Booking.java @@ -1,6 +1,6 @@ -package fr.codecake.airbnbclone.booking.domain; +package fr.codecake.nbat.booking.domain; -import fr.codecake.airbnbclone.sharedkernel.domain.AbstractAuditingEntity; +import fr.codecake.nbat.sharedkernel.domain.AbstractAuditingEntity; import jakarta.persistence.*; import org.hibernate.annotations.UuidGenerator; diff --git a/src/main/java/fr/codecake/airbnbclone/booking/mapper/BookingMapper.java b/src/main/java/fr/codecake/nbat/booking/mapper/BookingMapper.java similarity index 75% rename from src/main/java/fr/codecake/airbnbclone/booking/mapper/BookingMapper.java rename to src/main/java/fr/codecake/nbat/booking/mapper/BookingMapper.java index 5969df9..b35a907 100644 --- a/src/main/java/fr/codecake/airbnbclone/booking/mapper/BookingMapper.java +++ b/src/main/java/fr/codecake/nbat/booking/mapper/BookingMapper.java @@ -1,11 +1,11 @@ -package fr.codecake.airbnbclone.booking.mapper; +package fr.codecake.nbat.booking.mapper; import org.mapstruct.Mapper; import org.mapstruct.Mapping; -import fr.codecake.airbnbclone.booking.application.dto.BookedDateDTO; -import fr.codecake.airbnbclone.booking.application.dto.NewBookingDTO; -import fr.codecake.airbnbclone.booking.domain.Booking; +import fr.codecake.nbat.booking.application.dto.BookedDateDTO; +import fr.codecake.nbat.booking.application.dto.NewBookingDTO; +import fr.codecake.nbat.booking.domain.Booking; @Mapper(componentModel = "spring") public interface BookingMapper { @@ -20,4 +20,4 @@ public interface BookingMapper { Booking newBookingToBooking(NewBookingDTO newBookingDTO); BookedDateDTO bookingToCheckAvailability(Booking booking); -} \ No newline at end of file +} diff --git a/src/main/java/fr/codecake/airbnbclone/booking/presentation/BookingResource.java b/src/main/java/fr/codecake/nbat/booking/presentation/BookingResource.java similarity index 76% rename from src/main/java/fr/codecake/airbnbclone/booking/presentation/BookingResource.java rename to src/main/java/fr/codecake/nbat/booking/presentation/BookingResource.java index 87a2b2c..11b5496 100644 --- a/src/main/java/fr/codecake/airbnbclone/booking/presentation/BookingResource.java +++ b/src/main/java/fr/codecake/nbat/booking/presentation/BookingResource.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.booking.presentation; +package fr.codecake.nbat.booking.presentation; import java.util.List; import java.util.UUID; @@ -16,18 +16,18 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import fr.codecake.airbnbclone.booking.application.BookingService; -import fr.codecake.airbnbclone.booking.application.dto.BookedDateDTO; -import fr.codecake.airbnbclone.booking.application.dto.BookedListingDTO; -import fr.codecake.airbnbclone.booking.application.dto.NewBookingDTO; -import fr.codecake.airbnbclone.infrastructure.config.SecurityUtils; -import fr.codecake.airbnbclone.sharedkernel.service.State; -import fr.codecake.airbnbclone.sharedkernel.service.StatusNotification; +import fr.codecake.nbat.booking.application.BookingService; +import fr.codecake.nbat.booking.application.dto.BookedDateDTO; +import fr.codecake.nbat.booking.application.dto.BookedListingDTO; +import fr.codecake.nbat.booking.application.dto.NewBookingDTO; +import fr.codecake.nbat.infrastructure.config.SecurityUtils; +import fr.codecake.nbat.sharedkernel.service.State; +import fr.codecake.nbat.sharedkernel.service.StatusNotification; import jakarta.validation.Valid; @RestController @RequestMapping("/api/booking") -@CrossOrigin(origins = "http://localhost:4200") +@CrossOrigin(origins = { "http://localhost:4200", "http://localhost:4201" }, allowCredentials = "true") public class BookingResource { private final BookingService bookingService; @@ -40,7 +40,8 @@ public BookingResource(BookingService bookingService) { public ResponseEntity create(@Valid @RequestBody NewBookingDTO newBookingDTO) { State createState = bookingService.create(newBookingDTO); if (createState.getStatus().equals(StatusNotification.ERROR)) { - ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, "createState.getError()"); + ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, + "createState.getError()"); return ResponseEntity.of(problemDetail).build(); } else { return ResponseEntity.ok().build(); @@ -59,11 +60,12 @@ public ResponseEntity> getBookedListing() { @DeleteMapping("cancel") public ResponseEntity cancel(@RequestParam UUID bookingPublicId, - @RequestParam UUID listingPublicId, - @RequestParam boolean byLandlord) { + @RequestParam UUID listingPublicId, + @RequestParam boolean byLandlord) { State cancelState = bookingService.cancel(bookingPublicId, listingPublicId, byLandlord); if (cancelState.getStatus().equals(StatusNotification.ERROR)) { - ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, "cancelState.getError()"); + ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, + "cancelState.getError()"); return ResponseEntity.of(problemDetail).build(); } else { return ResponseEntity.ok(bookingPublicId); diff --git a/src/main/java/fr/codecake/airbnbclone/booking/repository/BookingRepository.java b/src/main/java/fr/codecake/nbat/booking/repository/BookingRepository.java similarity index 92% rename from src/main/java/fr/codecake/airbnbclone/booking/repository/BookingRepository.java rename to src/main/java/fr/codecake/nbat/booking/repository/BookingRepository.java index f90d3bc..b51db15 100644 --- a/src/main/java/fr/codecake/airbnbclone/booking/repository/BookingRepository.java +++ b/src/main/java/fr/codecake/nbat/booking/repository/BookingRepository.java @@ -1,6 +1,6 @@ -package fr.codecake.airbnbclone.booking.repository; +package fr.codecake.nbat.booking.repository; -import fr.codecake.airbnbclone.booking.domain.Booking; +import fr.codecake.nbat.booking.domain.Booking; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; diff --git a/src/main/java/fr/codecake/airbnbclone/infrastructure/config/CustomAuthorizationRequestResolver.java b/src/main/java/fr/codecake/nbat/infrastructure/config/CustomAuthorizationRequestResolver.java similarity index 97% rename from src/main/java/fr/codecake/airbnbclone/infrastructure/config/CustomAuthorizationRequestResolver.java rename to src/main/java/fr/codecake/nbat/infrastructure/config/CustomAuthorizationRequestResolver.java index 975b44c..0d183d3 100644 --- a/src/main/java/fr/codecake/airbnbclone/infrastructure/config/CustomAuthorizationRequestResolver.java +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/CustomAuthorizationRequestResolver.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.infrastructure.config; +package fr.codecake.nbat.infrastructure.config; import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.security.oauth2.client.web.DefaultOAuth2AuthorizationRequestResolver; diff --git a/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseAuthoritiesFilter.java b/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseAuthoritiesFilter.java new file mode 100644 index 0000000..7d00b8f --- /dev/null +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseAuthoritiesFilter.java @@ -0,0 +1,67 @@ +package fr.codecake.nbat.infrastructure.config; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.oauth2.core.user.OAuth2User; +import org.springframework.web.filter.OncePerRequestFilter; +import fr.codecake.nbat.user.application.UserService; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; + +import java.io.IOException; +import java.util.Collection; +import java.util.stream.Collectors; + +/** + * Filter that reloads user authorities from the database for each authenticated + * request. + * This allows roles assigned after OAuth2 login to be recognized by Spring + * Security. + */ +public class DatabaseAuthoritiesFilter extends OncePerRequestFilter { + + private final UserService userService; + + public DatabaseAuthoritiesFilter(UserService userService) { + this.userService = userService; + } + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) + throws ServletException, IOException { + Authentication auth = SecurityContextHolder.getContext().getAuthentication(); + + // Only process authenticated requests with OAuth2 principal + if (auth != null && auth.isAuthenticated() && auth.getPrincipal() instanceof OAuth2User oAuth2User) { + try { + // Get user's current roles from database + ReadUserDTO userFromDb = userService.getAuthenticatedUserFromSecurityContext(); + + if (userFromDb != null && userFromDb.authorities() != null) { + // Convert authorities from DB to GrantedAuthority + Collection dbAuthorities = userFromDb.authorities() + .stream() + .map(SimpleGrantedAuthority::new) + .collect(Collectors.toList()); + + // Create a new authentication with updated authorities from DB + OAuth2AuthenticationWithDbAuthorities updatedAuth = new OAuth2AuthenticationWithDbAuthorities(auth, + dbAuthorities); + + // Update the security context with the new authentication + SecurityContextHolder.getContext().setAuthentication(updatedAuth); + } + } catch (Exception e) { + // Log but don't fail - continue with original authentication + System.err.println("⚠️ Failed to reload authorities from database: " + e.getMessage()); + } + } + + filterChain.doFilter(request, response); + } +} diff --git a/src/main/java/fr/codecake/airbnbclone/infrastructure/config/DatabaseConfiguration.java b/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseConfiguration.java similarity index 63% rename from src/main/java/fr/codecake/airbnbclone/infrastructure/config/DatabaseConfiguration.java rename to src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseConfiguration.java index 8db691c..bc14141 100644 --- a/src/main/java/fr/codecake/airbnbclone/infrastructure/config/DatabaseConfiguration.java +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseConfiguration.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.infrastructure.config; +package fr.codecake.nbat.infrastructure.config; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; @@ -6,9 +6,9 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @Configuration -@EnableJpaRepositories({"fr.codecake.airbnbclone.user.repository", - "fr.codecake.airbnbclone.listing.repository", - "fr.codecake.airbnbclone.booking.repository"}) +@EnableJpaRepositories({"fr.codecake.nbat.user.repository", + "fr.codecake.nbat.listing.repository", + "fr.codecake.nbat.booking.repository"}) @EnableTransactionManagement @EnableJpaAuditing public class DatabaseConfiguration { diff --git a/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2AuthenticationWithDbAuthorities.java b/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2AuthenticationWithDbAuthorities.java new file mode 100644 index 0000000..4cc4f7b --- /dev/null +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2AuthenticationWithDbAuthorities.java @@ -0,0 +1,29 @@ +package fr.codecake.nbat.infrastructure.config; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; + +import java.util.Collection; + +/** + * Wrapper for OAuth2AuthenticationToken that uses authorities from the database + * instead of the OAuth2 token. + */ +public class OAuth2AuthenticationWithDbAuthorities extends OAuth2AuthenticationToken { + + private final Collection dbAuthorities; + + public OAuth2AuthenticationWithDbAuthorities(Authentication original, Collection dbAuthorities) { + super( + ((OAuth2AuthenticationToken) original).getPrincipal(), + dbAuthorities, + ((OAuth2AuthenticationToken) original).getAuthorizedClientRegistrationId()); + this.dbAuthorities = dbAuthorities; + } + + @Override + public Collection getAuthorities() { + return this.dbAuthorities; + } +} diff --git a/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2LoginSuccessHandler.java b/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2LoginSuccessHandler.java new file mode 100644 index 0000000..718ca62 --- /dev/null +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2LoginSuccessHandler.java @@ -0,0 +1,52 @@ +package fr.codecake.nbat.infrastructure.config; + +import fr.codecake.nbat.user.application.UserService; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.security.core.Authentication; +import org.springframework.security.oauth2.core.user.OAuth2User; +import org.springframework.security.web.authentication.AuthenticationSuccessHandler; +import org.springframework.stereotype.Component; + +import java.io.IOException; + +@Component +public class OAuth2LoginSuccessHandler implements AuthenticationSuccessHandler { + + private final UserService userService; + + public OAuth2LoginSuccessHandler(UserService userService) { + this.userService = userService; + } + + @Override + public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, + Authentication authentication) throws IOException, ServletException { + try { + System.out.println("πŸ” OAuth2 Login Success - Syncing user with IdP"); + System.out.println("πŸ“± Authentication type: " + authentication.getClass().getSimpleName()); + + // Get the OAuth2User from authentication + OAuth2User oAuth2User = (OAuth2User) authentication.getPrincipal(); + System.out.println("πŸ‘€ OAuth2User attributes: " + oAuth2User.getAttributes().keySet()); + + // Sync with IdP (creates new user with ROLE_TENANT or updates existing user) + System.out.println("πŸ”„ Starting syncWithIdp..."); + userService.syncWithIdp(oAuth2User, false); + + System.out.println("βœ… User synced successfully"); + + // Redirect to frontend or default landing page + response.sendRedirect("/"); + + } catch (Exception e) { + System.err.println("❌ ERROR in OAuth2LoginSuccessHandler: " + e.getMessage()); + System.err.println("❌ Exception type: " + e.getClass().getSimpleName()); + e.printStackTrace(); + + // Don't hide the error - let Spring handle it + throw new ServletException("Failed to sync user: " + e.getMessage(), e); + } + } +} diff --git a/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityConfiguration.java b/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityConfiguration.java new file mode 100644 index 0000000..6c26731 --- /dev/null +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityConfiguration.java @@ -0,0 +1,113 @@ +package fr.codecake.nbat.infrastructure.config; + +import java.util.HashSet; +import java.util.Set; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; +import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; +import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.csrf.CookieCsrfTokenRepository; +import org.springframework.security.web.csrf.CsrfTokenRequestAttributeHandler; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import fr.codecake.nbat.user.application.UserService; + +@Configuration +@EnableMethodSecurity +public class SecurityConfiguration { + + private final ClientRegistrationRepository clientRegistrationRepository; + private final OAuth2LoginSuccessHandler oAuth2LoginSuccessHandler; + private final UserService userService; + + public SecurityConfiguration(ClientRegistrationRepository clientRegistrationRepository, + OAuth2LoginSuccessHandler oAuth2LoginSuccessHandler, + UserService userService) { + this.clientRegistrationRepository = clientRegistrationRepository; + this.oAuth2LoginSuccessHandler = oAuth2LoginSuccessHandler; + this.userService = userService; + } + + @Bean + public SecurityFilterChain configure(HttpSecurity http) throws Exception { + CsrfTokenRequestAttributeHandler requestHandler = new CsrfTokenRequestAttributeHandler(); + requestHandler.setCsrfRequestAttributeName(null); + http.cors(cors -> cors.configurationSource(corsConfigurationSource())) + .authorizeHttpRequests(authorize -> authorize + .requestMatchers(HttpMethod.GET, "/api/auth/get-authenticated-user").permitAll() + .requestMatchers(HttpMethod.POST, "/api/auth/logout").permitAll() + .requestMatchers(HttpMethod.POST, "/api/auth/assign-landlord-role").permitAll() + .requestMatchers(HttpMethod.GET, "/api/tenant-listing/get-all-by-category").permitAll() + .requestMatchers(HttpMethod.GET, "/api/tenant-listing/get-one").permitAll() + .requestMatchers(HttpMethod.POST, "/api/tenant-listing/search").permitAll() + .requestMatchers(HttpMethod.GET, "/api/booking/check-availability").permitAll() + .requestMatchers(HttpMethod.POST, "/api/booking/create").authenticated() + .requestMatchers(HttpMethod.GET, "/api/booking/get-booked-listing").authenticated() + .requestMatchers(HttpMethod.GET, "/api/booking/get-booked-listing-for-landlord").authenticated() + .requestMatchers(HttpMethod.GET, "/api/landlord-listing/get-all").authenticated() + .requestMatchers(HttpMethod.GET, "/api/landlord-listing/get-one").authenticated() + .requestMatchers("/assets/**").permitAll() + .anyRequest() + .authenticated()) + .csrf(csrf -> csrf + .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) + .csrfTokenRequestHandler(requestHandler) + .ignoringRequestMatchers( + "/api/auth/logout", + "/api/auth/assign-landlord-role", + "/api/tenant-listing/search")) + .oauth2Login(oauth2 -> oauth2 + .authorizationEndpoint(authorization -> authorization + .authorizationRequestResolver( + new CustomAuthorizationRequestResolver(clientRegistrationRepository))) + .successHandler(oAuth2LoginSuccessHandler)) + .oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())) + .oauth2Client(Customizer.withDefaults()) + .sessionManagement(session -> session + .sessionCreationPolicy(org.springframework.security.config.http.SessionCreationPolicy.ALWAYS)) + .addFilterAfter(new DatabaseAuthoritiesFilter(userService), + org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter.class); + + return http.build(); + } + + @Bean + public GrantedAuthoritiesMapper userAuthoritiesMapper() { + return authorities -> { + Set grantedAuthorities = new HashSet<>(); + + authorities.forEach(grantedAuthority -> { + if (grantedAuthority instanceof OidcUserAuthority oidcUserAuthority) { + grantedAuthorities + .addAll(SecurityUtils + .extractAuthorityFromClaims(oidcUserAuthority.getUserInfo().getClaims())); + } + }); + return grantedAuthorities; + }; + } + + @Bean + public CorsConfigurationSource corsConfigurationSource() { + CorsConfiguration configuration = new CorsConfiguration(); + configuration.setAllowedOrigins(java.util.List.of("http://localhost:4200", "http://localhost:4201")); + configuration.setAllowedMethods(java.util.List.of("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH")); + configuration.setAllowedHeaders(java.util.List.of("*")); + configuration.setExposedHeaders(java.util.List.of("Authorization", "X-Total-Count", "X-Page-Number")); + configuration.setAllowCredentials(true); + configuration.setMaxAge(3600L); + + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", configuration); + return source; + } +} diff --git a/src/main/java/fr/codecake/airbnbclone/infrastructure/config/SecurityUtils.java b/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityUtils.java similarity index 84% rename from src/main/java/fr/codecake/airbnbclone/infrastructure/config/SecurityUtils.java rename to src/main/java/fr/codecake/nbat/infrastructure/config/SecurityUtils.java index d04a9f7..1abd20e 100644 --- a/src/main/java/fr/codecake/airbnbclone/infrastructure/config/SecurityUtils.java +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityUtils.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.infrastructure.config; +package fr.codecake.nbat.infrastructure.config; import java.util.Arrays; import java.util.Collection; @@ -14,8 +14,8 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; -import fr.codecake.airbnbclone.user.domain.Authority; -import fr.codecake.airbnbclone.user.domain.User; +import fr.codecake.nbat.user.domain.Authority; +import fr.codecake.nbat.user.domain.User; public class SecurityUtils { @@ -57,7 +57,7 @@ public static User mapOauth2AttributesToUser(Map attributes) { user.setImageUrl(((String) attributes.get("picture"))); } - if(attributes.get(CLAIMS_NAMESPACE) != null) { + if (attributes.get(CLAIMS_NAMESPACE) != null) { List authoritiesRaw = (List) attributes.get(CLAIMS_NAMESPACE); Set authorities = authoritiesRaw.stream() .map(authority -> { @@ -81,21 +81,22 @@ private static Collection getRolesFromClaims(Map claims) private static List mapRolesToGrantedAuthorities(Collection roles) { if (roles == null || roles.isEmpty()) { - return List.of(new SimpleGrantedAuthority("ROLE_TENANT")); // RΓ΄le par dΓ©faut - } + return List.of(new SimpleGrantedAuthority("ROLE_TENANT")); // RΓ΄le par dΓ©faut + } return roles.stream().filter(role -> role.startsWith("ROLE_")).map(SimpleGrantedAuthority::new).toList(); } - public static boolean hasCurrentUserAnyOfAuthorities(String ...authorities) { + public static boolean hasCurrentUserAnyOfAuthorities(String... authorities) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return (authentication != null && getAuthorities(authentication) .anyMatch(authority -> Arrays.asList(authorities).contains(authority))); } private static Stream getAuthorities(Authentication authentication) { - Collection authorities = authentication - instanceof JwtAuthenticationToken jwtAuthenticationToken && jwtAuthenticationToken.getToken() != null ? - extractAuthorityFromClaims(jwtAuthenticationToken.getToken().getClaims()) : authentication.getAuthorities(); + Collection authorities = authentication instanceof JwtAuthenticationToken jwtAuthenticationToken + && jwtAuthenticationToken.getToken() != null + ? extractAuthorityFromClaims(jwtAuthenticationToken.getToken().getClaims()) + : authentication.getAuthorities(); return authorities.stream().map(GrantedAuthority::getAuthority); } } diff --git a/src/main/java/fr/codecake/nbat/listing/application/LandlordService.java b/src/main/java/fr/codecake/nbat/listing/application/LandlordService.java new file mode 100644 index 0000000..85bffd3 --- /dev/null +++ b/src/main/java/fr/codecake/nbat/listing/application/LandlordService.java @@ -0,0 +1,156 @@ +package fr.codecake.nbat.listing.application; + +import fr.codecake.nbat.listing.application.dto.CreatedListingDTO; +import fr.codecake.nbat.listing.application.dto.DisplayCardListingDTO; +import fr.codecake.nbat.listing.application.dto.ListingCreateBookingDTO; +import fr.codecake.nbat.listing.application.dto.SaveListingDTO; +import fr.codecake.nbat.listing.domain.Listing; +import fr.codecake.nbat.listing.mapper.ListingMapper; +import fr.codecake.nbat.listing.repository.ListingRepository; +import fr.codecake.nbat.sharedkernel.service.State; +import fr.codecake.nbat.user.application.Auth0Service; +import fr.codecake.nbat.user.application.UserService; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Optional; +import java.util.UUID; + +@Service +public class LandlordService { + + private final ListingRepository listingRepository; + + private final ListingMapper listingMapper; + private final UserService userService; + private final Auth0Service auth0Service; + private final PictureService pictureService; + + public LandlordService(ListingRepository listingRepository, ListingMapper listingMapper, UserService userService, + Auth0Service auth0Service, PictureService pictureService) { + this.listingRepository = listingRepository; + this.listingMapper = listingMapper; + this.userService = userService; + this.auth0Service = auth0Service; + this.pictureService = pictureService; + } + + public CreatedListingDTO create(SaveListingDTO saveListingDTO) { + Listing newListing = listingMapper.saveListingDTOToListing(saveListingDTO); + + ReadUserDTO userConnected = userService.getAuthenticatedUserFromSecurityContext(); + newListing.setLandlordPublicId(userConnected.publicId()); + + Listing savedListing = listingRepository.saveAndFlush(newListing); + + pictureService.saveAll(saveListingDTO.getPictures(), savedListing); + + // Get auth0UserId from OAuth2 context + String auth0UserId = userConnected.publicId().toString(); // or get from OAuth2User attributes + auth0Service.addLandlordRoleToUser(userConnected, auth0UserId); + + return listingMapper.listingToCreatedListingDTO(savedListing); + } + + @Transactional(readOnly = true) + public List getAllProperties(ReadUserDTO landlord) { + List properties = listingRepository.findAllByLandlordPublicIdFetchCoverPicture(landlord.publicId()); + return listingMapper.listingToDisplayCardListingDTOs(properties); + } + + @Transactional + public State delete(UUID publicId, ReadUserDTO landlord) { + long deletedSuccessfuly = listingRepository.deleteByPublicIdAndLandlordPublicId(publicId, landlord.publicId()); + if (deletedSuccessfuly > 0) { + return State.builder().forSuccess(publicId); + } else { + return State.builder().forUnauthorized("User not authorized to delete this listing"); + } + } + + public Optional getByListingPublicId(UUID publicId) { + return listingRepository.findByPublicId(publicId).map(listingMapper::mapListingToListingCreateBookingDTO); + } + + public List getCardDisplayByListingPublicId(List allListingPublicIDs) { + return listingRepository.findAllByPublicIdIn(allListingPublicIDs) + .stream() + .map(listingMapper::listingToDisplayCardListingDTO) + .toList(); + } + + @Transactional(readOnly = true) + public Optional getByPublicIdAndLandlordPublicId(UUID listingPublicId, + UUID landlordPublicId) { + return listingRepository.findOneByPublicIdAndLandlordPublicId(listingPublicId, landlordPublicId) + .map(listingMapper::listingToDisplayCardListingDTO); + } + + @Transactional(readOnly = true) + public State getOne(UUID publicId, + ReadUserDTO landlord) { + Optional listingOpt = listingRepository.findByPublicId(publicId); + + if (listingOpt.isEmpty()) { + return State.builder() + .forError("Listing not found"); + } + + Listing listing = listingOpt.get(); + + // Check if listing belongs to this landlord + if (!listing.getLandlordPublicId().equals(landlord.publicId())) { + return State.builder() + .forUnauthorized("You are not authorized to view this listing"); + } + + fr.codecake.nbat.listing.application.dto.DisplayListingDTO displayDTO = listingMapper + .listingToDisplayListingDTO(listing); + + return State.builder() + .forSuccess(displayDTO); + } + + @Transactional + public CreatedListingDTO update(UUID publicId, SaveListingDTO saveListingDTO, ReadUserDTO landlord) { + Optional listingOpt = listingRepository.findByPublicId(publicId); + + if (listingOpt.isEmpty()) { + throw new IllegalArgumentException("Listing not found"); + } + + Listing listing = listingOpt.get(); + + // Check if listing belongs to this landlord + if (!listing.getLandlordPublicId().equals(landlord.publicId())) { + throw new IllegalArgumentException("You are not authorized to update this listing"); + } + + // Update listing properties from DTO + listing.setTitle(saveListingDTO.getDescription().title().value()); + listing.setDescription(saveListingDTO.getDescription().description().value()); + listing.setLocation(saveListingDTO.getLocation()); + listing.setPrice(saveListingDTO.getPrice().value()); + listing.setBookingCategory(saveListingDTO.getCategory()); + + // Update listing info + listing.setBedrooms(saveListingDTO.getInfos().bedrooms().value()); + listing.setGuests(saveListingDTO.getInfos().guests().value()); + listing.setBeds(saveListingDTO.getInfos().beds().value()); + listing.setBathrooms(saveListingDTO.getInfos().baths().value()); + + Listing updatedListing = listingRepository.saveAndFlush(listing); + + // Update pictures if new ones provided + if (!saveListingDTO.getPictures().isEmpty()) { + // Delete old pictures + listing.getPictures().clear(); + // Save new pictures + pictureService.saveAll(saveListingDTO.getPictures(), updatedListing); + } + + return listingMapper.listingToCreatedListingDTO(updatedListing); + } +} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/PictureService.java b/src/main/java/fr/codecake/nbat/listing/application/PictureService.java similarity index 75% rename from src/main/java/fr/codecake/airbnbclone/listing/application/PictureService.java rename to src/main/java/fr/codecake/nbat/listing/application/PictureService.java index b32d38b..5626a44 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/PictureService.java +++ b/src/main/java/fr/codecake/nbat/listing/application/PictureService.java @@ -1,10 +1,10 @@ -package fr.codecake.airbnbclone.listing.application; +package fr.codecake.nbat.listing.application; -import fr.codecake.airbnbclone.listing.application.dto.sub.PictureDTO; -import fr.codecake.airbnbclone.listing.domain.Listing; -import fr.codecake.airbnbclone.listing.domain.ListingPicture; -import fr.codecake.airbnbclone.listing.mapper.ListingPictureMapper; -import fr.codecake.airbnbclone.listing.repository.ListingPictureRepository; +import fr.codecake.nbat.listing.application.dto.sub.PictureDTO; +import fr.codecake.nbat.listing.domain.Listing; +import fr.codecake.nbat.listing.domain.ListingPicture; +import fr.codecake.nbat.listing.mapper.ListingPictureMapper; +import fr.codecake.nbat.listing.repository.ListingPictureRepository; import org.springframework.stereotype.Service; import java.util.List; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/TenantService.java b/src/main/java/fr/codecake/nbat/listing/application/TenantService.java similarity index 80% rename from src/main/java/fr/codecake/airbnbclone/listing/application/TenantService.java rename to src/main/java/fr/codecake/nbat/listing/application/TenantService.java index 8c3f8eb..646947a 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/TenantService.java +++ b/src/main/java/fr/codecake/nbat/listing/application/TenantService.java @@ -1,17 +1,17 @@ -package fr.codecake.airbnbclone.listing.application; - -import fr.codecake.airbnbclone.booking.application.BookingService; -import fr.codecake.airbnbclone.listing.application.dto.DisplayCardListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.DisplayListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.SearchDTO; -import fr.codecake.airbnbclone.listing.application.dto.sub.LandlordListingDTO; -import fr.codecake.airbnbclone.listing.domain.BookingCategory; -import fr.codecake.airbnbclone.listing.domain.Listing; -import fr.codecake.airbnbclone.listing.mapper.ListingMapper; -import fr.codecake.airbnbclone.listing.repository.ListingRepository; -import fr.codecake.airbnbclone.sharedkernel.service.State; -import fr.codecake.airbnbclone.user.application.UserService; -import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; +package fr.codecake.nbat.listing.application; + +import fr.codecake.nbat.booking.application.BookingService; +import fr.codecake.nbat.listing.application.dto.DisplayCardListingDTO; +import fr.codecake.nbat.listing.application.dto.DisplayListingDTO; +import fr.codecake.nbat.listing.application.dto.SearchDTO; +import fr.codecake.nbat.listing.application.dto.sub.LandlordListingDTO; +import fr.codecake.nbat.listing.domain.BookingCategory; +import fr.codecake.nbat.listing.domain.Listing; +import fr.codecake.nbat.listing.mapper.ListingMapper; +import fr.codecake.nbat.listing.repository.ListingRepository; +import fr.codecake.nbat.sharedkernel.service.State; +import fr.codecake.nbat.user.application.UserService; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; diff --git a/src/main/java/fr/codecake/nbat/listing/application/dto/CreatedListingDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/CreatedListingDTO.java new file mode 100644 index 0000000..822fef7 --- /dev/null +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/CreatedListingDTO.java @@ -0,0 +1,4 @@ +package fr.codecake.nbat.listing.application.dto; + +public record CreatedListingDTO(String publicId) { +} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/DisplayCardListingDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/DisplayCardListingDTO.java similarity index 54% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/DisplayCardListingDTO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/DisplayCardListingDTO.java index f776e8e..d00c974 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/DisplayCardListingDTO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/DisplayCardListingDTO.java @@ -1,8 +1,8 @@ -package fr.codecake.airbnbclone.listing.application.dto; +package fr.codecake.nbat.listing.application.dto; -import fr.codecake.airbnbclone.listing.application.dto.sub.PictureDTO; -import fr.codecake.airbnbclone.listing.application.dto.vo.PriceVO; -import fr.codecake.airbnbclone.listing.domain.BookingCategory; +import fr.codecake.nbat.listing.application.dto.sub.PictureDTO; +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; +import fr.codecake.nbat.listing.domain.BookingCategory; import java.util.UUID; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/DisplayListingDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/DisplayListingDTO.java similarity index 75% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/DisplayListingDTO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/DisplayListingDTO.java index 5bf8b27..4c27187 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/DisplayListingDTO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/DisplayListingDTO.java @@ -1,11 +1,11 @@ -package fr.codecake.airbnbclone.listing.application.dto; - -import fr.codecake.airbnbclone.listing.application.dto.sub.DescriptionDTO; -import fr.codecake.airbnbclone.listing.application.dto.sub.LandlordListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.sub.ListingInfoDTO; -import fr.codecake.airbnbclone.listing.application.dto.sub.PictureDTO; -import fr.codecake.airbnbclone.listing.application.dto.vo.PriceVO; -import fr.codecake.airbnbclone.listing.domain.BookingCategory; +package fr.codecake.nbat.listing.application.dto; + +import fr.codecake.nbat.listing.application.dto.sub.DescriptionDTO; +import fr.codecake.nbat.listing.application.dto.sub.LandlordListingDTO; +import fr.codecake.nbat.listing.application.dto.sub.ListingInfoDTO; +import fr.codecake.nbat.listing.application.dto.sub.PictureDTO; +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; +import fr.codecake.nbat.listing.domain.BookingCategory; import java.util.List; diff --git a/src/main/java/fr/codecake/nbat/listing/application/dto/ListingCreateBookingDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/ListingCreateBookingDTO.java new file mode 100644 index 0000000..29de651 --- /dev/null +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/ListingCreateBookingDTO.java @@ -0,0 +1,9 @@ +package fr.codecake.nbat.listing.application.dto; + +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; + +import java.util.UUID; + +public record ListingCreateBookingDTO( + UUID listingPublicId, PriceVO price) { +} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/SaveListingDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/SaveListingDTO.java similarity index 77% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/SaveListingDTO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/SaveListingDTO.java index 9a65ce7..b43e0ee 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/SaveListingDTO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/SaveListingDTO.java @@ -1,10 +1,10 @@ -package fr.codecake.airbnbclone.listing.application.dto; +package fr.codecake.nbat.listing.application.dto; -import fr.codecake.airbnbclone.listing.application.dto.sub.DescriptionDTO; -import fr.codecake.airbnbclone.listing.application.dto.sub.ListingInfoDTO; -import fr.codecake.airbnbclone.listing.application.dto.sub.PictureDTO; -import fr.codecake.airbnbclone.listing.application.dto.vo.PriceVO; -import fr.codecake.airbnbclone.listing.domain.BookingCategory; +import fr.codecake.nbat.listing.application.dto.sub.DescriptionDTO; +import fr.codecake.nbat.listing.application.dto.sub.ListingInfoDTO; +import fr.codecake.nbat.listing.application.dto.sub.PictureDTO; +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; +import fr.codecake.nbat.listing.domain.BookingCategory; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/SearchDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/SearchDTO.java similarity index 54% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/SearchDTO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/SearchDTO.java index b903e48..530b827 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/SearchDTO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/SearchDTO.java @@ -1,7 +1,7 @@ -package fr.codecake.airbnbclone.listing.application.dto; +package fr.codecake.nbat.listing.application.dto; -import fr.codecake.airbnbclone.booking.application.dto.BookedDateDTO; -import fr.codecake.airbnbclone.listing.application.dto.sub.ListingInfoDTO; +import fr.codecake.nbat.booking.application.dto.BookedDateDTO; +import fr.codecake.nbat.listing.application.dto.sub.ListingInfoDTO; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; diff --git a/src/main/java/fr/codecake/nbat/listing/application/dto/sub/DescriptionDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/sub/DescriptionDTO.java new file mode 100644 index 0000000..a82260a --- /dev/null +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/sub/DescriptionDTO.java @@ -0,0 +1,11 @@ +package fr.codecake.nbat.listing.application.dto.sub; + +import fr.codecake.nbat.listing.application.dto.vo.DescriptionVO; +import fr.codecake.nbat.listing.application.dto.vo.TitleVO; +import jakarta.validation.constraints.NotNull; + +public record DescriptionDTO( + @NotNull TitleVO title, + @NotNull DescriptionVO description + ) { +} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/LandlordListingDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/sub/LandlordListingDTO.java similarity index 73% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/LandlordListingDTO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/sub/LandlordListingDTO.java index 22c4adb..fc8a3d3 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/LandlordListingDTO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/sub/LandlordListingDTO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.sub; +package fr.codecake.nbat.listing.application.dto.sub; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/nbat/listing/application/dto/sub/ListingInfoDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/sub/ListingInfoDTO.java new file mode 100644 index 0000000..9ff8b47 --- /dev/null +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/sub/ListingInfoDTO.java @@ -0,0 +1,15 @@ +package fr.codecake.nbat.listing.application.dto.sub; + +import fr.codecake.nbat.listing.application.dto.vo.BathsVO; +import fr.codecake.nbat.listing.application.dto.vo.BedroomsVO; +import fr.codecake.nbat.listing.application.dto.vo.BedsVO; +import fr.codecake.nbat.listing.application.dto.vo.GuestsVO; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +public record ListingInfoDTO( + @NotNull @Valid GuestsVO guests, + @NotNull @Valid BedroomsVO bedrooms, + @NotNull @Valid BedsVO beds, + @NotNull @Valid BathsVO baths) { +} diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/PictureDTO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/sub/PictureDTO.java similarity index 93% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/PictureDTO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/sub/PictureDTO.java index 169daec..0946b69 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/sub/PictureDTO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/sub/PictureDTO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.sub; +package fr.codecake.nbat.listing.application.dto.sub; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BathsVO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/BathsVO.java similarity index 69% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BathsVO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/vo/BathsVO.java index ca13f41..155bb29 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BathsVO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/BathsVO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.vo; +package fr.codecake.nbat.listing.application.dto.vo; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BedroomsVO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/BedroomsVO.java similarity index 70% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BedroomsVO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/vo/BedroomsVO.java index db6be25..5afc97a 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BedroomsVO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/BedroomsVO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.vo; +package fr.codecake.nbat.listing.application.dto.vo; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BedsVO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/BedsVO.java similarity index 69% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BedsVO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/vo/BedsVO.java index 87bc26d..6d75229 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/BedsVO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/BedsVO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.vo; +package fr.codecake.nbat.listing.application.dto.vo; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/DescriptionVO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/DescriptionVO.java similarity index 71% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/DescriptionVO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/vo/DescriptionVO.java index 5e57c21..c000693 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/DescriptionVO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/DescriptionVO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.vo; +package fr.codecake.nbat.listing.application.dto.vo; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/GuestsVO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/GuestsVO.java similarity index 69% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/GuestsVO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/vo/GuestsVO.java index 99aebbb..3f2ef19 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/GuestsVO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/GuestsVO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.vo; +package fr.codecake.nbat.listing.application.dto.vo; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/PriceVO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/PriceVO.java similarity index 69% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/PriceVO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/vo/PriceVO.java index d904522..5cf80ca 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/PriceVO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/PriceVO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.vo; +package fr.codecake.nbat.listing.application.dto.vo; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/TitleVO.java b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/TitleVO.java similarity index 69% rename from src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/TitleVO.java rename to src/main/java/fr/codecake/nbat/listing/application/dto/vo/TitleVO.java index 90f75ca..63f3963 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/application/dto/vo/TitleVO.java +++ b/src/main/java/fr/codecake/nbat/listing/application/dto/vo/TitleVO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.application.dto.vo; +package fr.codecake.nbat.listing.application.dto.vo; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/domain/BookingCategory.java b/src/main/java/fr/codecake/nbat/listing/domain/BookingCategory.java similarity index 85% rename from src/main/java/fr/codecake/airbnbclone/listing/domain/BookingCategory.java rename to src/main/java/fr/codecake/nbat/listing/domain/BookingCategory.java index 272f2c0..d740059 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/domain/BookingCategory.java +++ b/src/main/java/fr/codecake/nbat/listing/domain/BookingCategory.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.listing.domain; +package fr.codecake.nbat.listing.domain; public enum BookingCategory { ALL, diff --git a/src/main/java/fr/codecake/airbnbclone/listing/domain/Listing.java b/src/main/java/fr/codecake/nbat/listing/domain/Listing.java similarity index 97% rename from src/main/java/fr/codecake/airbnbclone/listing/domain/Listing.java rename to src/main/java/fr/codecake/nbat/listing/domain/Listing.java index 178fea5..de616b4 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/domain/Listing.java +++ b/src/main/java/fr/codecake/nbat/listing/domain/Listing.java @@ -1,6 +1,6 @@ -package fr.codecake.airbnbclone.listing.domain; +package fr.codecake.nbat.listing.domain; -import fr.codecake.airbnbclone.sharedkernel.domain.AbstractAuditingEntity; +import fr.codecake.nbat.sharedkernel.domain.AbstractAuditingEntity; import jakarta.persistence.*; import org.hibernate.annotations.UuidGenerator; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/domain/ListingPicture.java b/src/main/java/fr/codecake/nbat/listing/domain/ListingPicture.java similarity index 94% rename from src/main/java/fr/codecake/airbnbclone/listing/domain/ListingPicture.java rename to src/main/java/fr/codecake/nbat/listing/domain/ListingPicture.java index 47adb7a..869bd29 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/domain/ListingPicture.java +++ b/src/main/java/fr/codecake/nbat/listing/domain/ListingPicture.java @@ -1,6 +1,6 @@ -package fr.codecake.airbnbclone.listing.domain; +package fr.codecake.nbat.listing.domain; -import fr.codecake.airbnbclone.sharedkernel.domain.AbstractAuditingEntity; +import fr.codecake.nbat.sharedkernel.domain.AbstractAuditingEntity; import jakarta.persistence.*; import java.util.Arrays; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/mapper/ListingMapper.java b/src/main/java/fr/codecake/nbat/listing/mapper/ListingMapper.java similarity index 91% rename from src/main/java/fr/codecake/airbnbclone/listing/mapper/ListingMapper.java rename to src/main/java/fr/codecake/nbat/listing/mapper/ListingMapper.java index 67959ed..ce884c6 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/mapper/ListingMapper.java +++ b/src/main/java/fr/codecake/nbat/listing/mapper/ListingMapper.java @@ -1,8 +1,8 @@ -package fr.codecake.airbnbclone.listing.mapper; +package fr.codecake.nbat.listing.mapper; -import fr.codecake.airbnbclone.listing.application.dto.*; -import fr.codecake.airbnbclone.listing.application.dto.vo.PriceVO; -import fr.codecake.airbnbclone.listing.domain.Listing; +import fr.codecake.nbat.listing.application.dto.*; +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; +import fr.codecake.nbat.listing.domain.Listing; import org.mapstruct.Mapper; import org.mapstruct.Mapping; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/mapper/ListingPictureMapper.java b/src/main/java/fr/codecake/nbat/listing/mapper/ListingPictureMapper.java similarity index 84% rename from src/main/java/fr/codecake/airbnbclone/listing/mapper/ListingPictureMapper.java rename to src/main/java/fr/codecake/nbat/listing/mapper/ListingPictureMapper.java index f2e9232..d7de15f 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/mapper/ListingPictureMapper.java +++ b/src/main/java/fr/codecake/nbat/listing/mapper/ListingPictureMapper.java @@ -1,7 +1,7 @@ -package fr.codecake.airbnbclone.listing.mapper; +package fr.codecake.nbat.listing.mapper; -import fr.codecake.airbnbclone.listing.application.dto.sub.PictureDTO; -import fr.codecake.airbnbclone.listing.domain.ListingPicture; +import fr.codecake.nbat.listing.application.dto.sub.PictureDTO; +import fr.codecake.nbat.listing.domain.ListingPicture; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.Named; diff --git a/src/main/java/fr/codecake/airbnbclone/listing/presentation/LandlordResource.java b/src/main/java/fr/codecake/nbat/listing/presentation/LandlordResource.java similarity index 57% rename from src/main/java/fr/codecake/airbnbclone/listing/presentation/LandlordResource.java rename to src/main/java/fr/codecake/nbat/listing/presentation/LandlordResource.java index 89c7c68..05f1321 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/presentation/LandlordResource.java +++ b/src/main/java/fr/codecake/nbat/listing/presentation/LandlordResource.java @@ -1,17 +1,17 @@ -package fr.codecake.airbnbclone.listing.presentation; +package fr.codecake.nbat.listing.presentation; import com.fasterxml.jackson.databind.ObjectMapper; -import fr.codecake.airbnbclone.infrastructure.config.SecurityUtils; -import fr.codecake.airbnbclone.listing.application.LandlordService; -import fr.codecake.airbnbclone.listing.application.dto.CreatedListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.DisplayCardListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.SaveListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.sub.PictureDTO; -import fr.codecake.airbnbclone.sharedkernel.service.State; -import fr.codecake.airbnbclone.sharedkernel.service.StatusNotification; -import fr.codecake.airbnbclone.user.application.UserException; -import fr.codecake.airbnbclone.user.application.UserService; -import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; +import fr.codecake.nbat.infrastructure.config.SecurityUtils; +import fr.codecake.nbat.listing.application.LandlordService; +import fr.codecake.nbat.listing.application.dto.CreatedListingDTO; +import fr.codecake.nbat.listing.application.dto.DisplayCardListingDTO; +import fr.codecake.nbat.listing.application.dto.SaveListingDTO; +import fr.codecake.nbat.listing.application.dto.sub.PictureDTO; +import fr.codecake.nbat.sharedkernel.service.State; +import fr.codecake.nbat.sharedkernel.service.StatusNotification; +import fr.codecake.nbat.user.application.UserException; +import fr.codecake.nbat.user.application.UserService; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validator; import org.springframework.http.HttpStatus; @@ -32,6 +32,7 @@ @RestController @RequestMapping("/api/landlord-listing") +@CrossOrigin(origins = { "http://localhost:4200", "http://localhost:4201" }, allowCredentials = "true") public class LandlordResource { private final LandlordService landlordService; @@ -42,19 +43,16 @@ public class LandlordResource { private final ObjectMapper objectMapper = new ObjectMapper(); - public LandlordResource(LandlordService landlordService, Validator validator, UserService userService) { this.landlordService = landlordService; this.validator = validator; this.userService = userService; } - @PostMapping(value = "/create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity create( MultipartHttpServletRequest request, - @RequestPart(name = "dto") String saveListingDTOString - ) throws IOException { + @RequestPart(name = "dto") String saveListingDTOString) throws IOException { List pictures = request.getFileMap() .values() .stream() @@ -79,13 +77,13 @@ public ResponseEntity create( } } - private static Function mapMultipartFileToPictureDTO() { return multipartFile -> { try { return new PictureDTO(multipartFile.getBytes(), multipartFile.getContentType(), false); } catch (IOException ioe) { - throw new UserException(String.format("Cannot parse multipart file: %s", multipartFile.getOriginalFilename())); + throw new UserException( + String.format("Cannot parse multipart file: %s", multipartFile.getOriginalFilename())); } }; } @@ -98,6 +96,46 @@ public ResponseEntity> getAll() { return ResponseEntity.ok(allProperties); } + @GetMapping(value = "/get-one") + @PreAuthorize("hasAnyRole('" + SecurityUtils.ROLE_LANDLORD + "')") + public ResponseEntity getOne(@RequestParam UUID publicId) { + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + return ResponseEntity.ok(landlordService.getOne(publicId, connectedUser)); + } + + @PutMapping(value = "/update", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @PreAuthorize("hasAnyRole('" + SecurityUtils.ROLE_LANDLORD + "')") + public ResponseEntity update( + MultipartHttpServletRequest request, + @RequestParam UUID publicId, + @RequestPart(name = "dto") String saveListingDTOString) throws IOException { + List pictures = request.getFileMap() + .values() + .stream() + .map(mapMultipartFileToPictureDTO()) + .toList(); + + SaveListingDTO saveListingDTO = objectMapper.readValue(saveListingDTOString, SaveListingDTO.class); + if (!pictures.isEmpty()) { + saveListingDTO.setPictures(pictures); + } + + Set> violations = validator.validate(saveListingDTO); + if (!violations.isEmpty()) { + String violationsJoined = violations.stream() + .map(violation -> violation.getPropertyPath() + " " + violation.getMessage()) + .collect(Collectors.joining()); + if (violationsJoined == null || violationsJoined.isEmpty()) { + violationsJoined = "Validation failed"; + } + ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, violationsJoined); + return ResponseEntity.of(problemDetail).build(); + } else { + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + return ResponseEntity.ok(landlordService.update(publicId, saveListingDTO, connectedUser)); + } + } + @DeleteMapping("/delete") @PreAuthorize("hasAnyRole('" + SecurityUtils.ROLE_LANDLORD + "')") public ResponseEntity delete(@RequestParam UUID publicId) { diff --git a/src/main/java/fr/codecake/airbnbclone/listing/presentation/TenantResource.java b/src/main/java/fr/codecake/nbat/listing/presentation/TenantResource.java similarity index 66% rename from src/main/java/fr/codecake/airbnbclone/listing/presentation/TenantResource.java rename to src/main/java/fr/codecake/nbat/listing/presentation/TenantResource.java index fa58596..b563c63 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/presentation/TenantResource.java +++ b/src/main/java/fr/codecake/nbat/listing/presentation/TenantResource.java @@ -1,12 +1,12 @@ -package fr.codecake.airbnbclone.listing.presentation; - -import fr.codecake.airbnbclone.listing.application.TenantService; -import fr.codecake.airbnbclone.listing.application.dto.DisplayCardListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.DisplayListingDTO; -import fr.codecake.airbnbclone.listing.application.dto.SearchDTO; -import fr.codecake.airbnbclone.listing.domain.BookingCategory; -import fr.codecake.airbnbclone.sharedkernel.service.State; -import fr.codecake.airbnbclone.sharedkernel.service.StatusNotification; +package fr.codecake.nbat.listing.presentation; + +import fr.codecake.nbat.listing.application.TenantService; +import fr.codecake.nbat.listing.application.dto.DisplayCardListingDTO; +import fr.codecake.nbat.listing.application.dto.DisplayListingDTO; +import fr.codecake.nbat.listing.application.dto.SearchDTO; +import fr.codecake.nbat.listing.domain.BookingCategory; +import fr.codecake.nbat.sharedkernel.service.State; +import fr.codecake.nbat.sharedkernel.service.StatusNotification; import jakarta.validation.Valid; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -19,18 +19,18 @@ @RestController @RequestMapping("/api/tenant-listing") +@CrossOrigin(origins = { "http://localhost:4200", "http://localhost:4201" }, allowCredentials = "true") public class TenantResource { private final TenantService tenantService; - public TenantResource(TenantService tenantService) { this.tenantService = tenantService; } @GetMapping("/get-all-by-category") public ResponseEntity> findAllByBookingCategory(Pageable pageable, - @RequestParam BookingCategory category) { + @RequestParam BookingCategory category) { return ResponseEntity.ok(tenantService.getAllByCategory(pageable, category)); } @@ -40,7 +40,8 @@ public ResponseEntity getOne(@RequestParam UUID publicId) { if (displayListingState.getStatus().equals(StatusNotification.OK)) { return ResponseEntity.ok(displayListingState.getValue()); } else { - String errorMessage = displayListingState.getError() != null ? displayListingState.getError() : "Unknown error"; + String errorMessage = displayListingState.getError() != null ? displayListingState.getError() + : "Unknown error"; ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, errorMessage); return ResponseEntity.of(problemDetail).build(); } @@ -48,7 +49,7 @@ public ResponseEntity getOne(@RequestParam UUID publicId) { @PostMapping("/search") public ResponseEntity> search(Pageable pageable, - @Valid @RequestBody SearchDTO searchDTO) { + @Valid @RequestBody SearchDTO searchDTO) { return ResponseEntity.ok(tenantService.search(pageable, searchDTO)); } } diff --git a/src/main/java/fr/codecake/airbnbclone/listing/repository/ListingPictureRepository.java b/src/main/java/fr/codecake/nbat/listing/repository/ListingPictureRepository.java similarity index 57% rename from src/main/java/fr/codecake/airbnbclone/listing/repository/ListingPictureRepository.java rename to src/main/java/fr/codecake/nbat/listing/repository/ListingPictureRepository.java index 2fce088..970eae8 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/repository/ListingPictureRepository.java +++ b/src/main/java/fr/codecake/nbat/listing/repository/ListingPictureRepository.java @@ -1,6 +1,6 @@ -package fr.codecake.airbnbclone.listing.repository; +package fr.codecake.nbat.listing.repository; -import fr.codecake.airbnbclone.listing.domain.ListingPicture; +import fr.codecake.nbat.listing.domain.ListingPicture; import org.springframework.data.jpa.repository.JpaRepository; public interface ListingPictureRepository extends JpaRepository { diff --git a/src/main/java/fr/codecake/airbnbclone/listing/repository/ListingRepository.java b/src/main/java/fr/codecake/nbat/listing/repository/ListingRepository.java similarity index 90% rename from src/main/java/fr/codecake/airbnbclone/listing/repository/ListingRepository.java rename to src/main/java/fr/codecake/nbat/listing/repository/ListingRepository.java index cd4fb91..4dbfc47 100644 --- a/src/main/java/fr/codecake/airbnbclone/listing/repository/ListingRepository.java +++ b/src/main/java/fr/codecake/nbat/listing/repository/ListingRepository.java @@ -1,7 +1,7 @@ -package fr.codecake.airbnbclone.listing.repository; +package fr.codecake.nbat.listing.repository; -import fr.codecake.airbnbclone.listing.domain.BookingCategory; -import fr.codecake.airbnbclone.listing.domain.Listing; +import fr.codecake.nbat.listing.domain.BookingCategory; +import fr.codecake.nbat.listing.domain.Listing; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/fr/codecake/airbnbclone/sharedkernel/domain/AbstractAuditingEntity.java b/src/main/java/fr/codecake/nbat/sharedkernel/domain/AbstractAuditingEntity.java similarity index 95% rename from src/main/java/fr/codecake/airbnbclone/sharedkernel/domain/AbstractAuditingEntity.java rename to src/main/java/fr/codecake/nbat/sharedkernel/domain/AbstractAuditingEntity.java index ac11182..f9f9b12 100644 --- a/src/main/java/fr/codecake/airbnbclone/sharedkernel/domain/AbstractAuditingEntity.java +++ b/src/main/java/fr/codecake/nbat/sharedkernel/domain/AbstractAuditingEntity.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.sharedkernel.domain; +package fr.codecake.nbat.sharedkernel.domain; import jakarta.persistence.Column; import jakarta.persistence.EntityListeners; diff --git a/src/main/java/fr/codecake/airbnbclone/sharedkernel/service/State.java b/src/main/java/fr/codecake/nbat/sharedkernel/service/State.java similarity index 93% rename from src/main/java/fr/codecake/airbnbclone/sharedkernel/service/State.java rename to src/main/java/fr/codecake/nbat/sharedkernel/service/State.java index 7c83dc8..f0d56e8 100644 --- a/src/main/java/fr/codecake/airbnbclone/sharedkernel/service/State.java +++ b/src/main/java/fr/codecake/nbat/sharedkernel/service/State.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.sharedkernel.service; +package fr.codecake.nbat.sharedkernel.service; public class State { private T value; diff --git a/src/main/java/fr/codecake/airbnbclone/sharedkernel/service/StateBuilder.java b/src/main/java/fr/codecake/nbat/sharedkernel/service/StateBuilder.java similarity index 94% rename from src/main/java/fr/codecake/airbnbclone/sharedkernel/service/StateBuilder.java rename to src/main/java/fr/codecake/nbat/sharedkernel/service/StateBuilder.java index aee3e5c..d5d67b1 100644 --- a/src/main/java/fr/codecake/airbnbclone/sharedkernel/service/StateBuilder.java +++ b/src/main/java/fr/codecake/nbat/sharedkernel/service/StateBuilder.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.sharedkernel.service; +package fr.codecake.nbat.sharedkernel.service; public class StateBuilder { private StatusNotification status; diff --git a/src/main/java/fr/codecake/airbnbclone/sharedkernel/service/StatusNotification.java b/src/main/java/fr/codecake/nbat/sharedkernel/service/StatusNotification.java similarity index 54% rename from src/main/java/fr/codecake/airbnbclone/sharedkernel/service/StatusNotification.java rename to src/main/java/fr/codecake/nbat/sharedkernel/service/StatusNotification.java index 4dd8c6f..ab34722 100644 --- a/src/main/java/fr/codecake/airbnbclone/sharedkernel/service/StatusNotification.java +++ b/src/main/java/fr/codecake/nbat/sharedkernel/service/StatusNotification.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.sharedkernel.service; +package fr.codecake.nbat.sharedkernel.service; public enum StatusNotification { OK, ERROR, UNAUTHORIZED; diff --git a/src/main/java/fr/codecake/nbat/user/application/Auth0Service.java b/src/main/java/fr/codecake/nbat/user/application/Auth0Service.java new file mode 100644 index 0000000..0a32d67 --- /dev/null +++ b/src/main/java/fr/codecake/nbat/user/application/Auth0Service.java @@ -0,0 +1,132 @@ +package fr.codecake.nbat.user.application; + +import com.auth0.client.auth.AuthAPI; +import com.auth0.client.mgmt.ManagementAPI; +import com.auth0.exception.APIException; +import com.auth0.exception.Auth0Exception; +import com.auth0.json.auth.TokenHolder; +import com.auth0.net.TokenRequest; +import fr.codecake.nbat.infrastructure.config.SecurityUtils; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; +import fr.codecake.nbat.user.domain.Authority; +import fr.codecake.nbat.user.domain.User; +import fr.codecake.nbat.user.repository.AuthorityRepository; +import fr.codecake.nbat.user.repository.UserRepository; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@Service +public class Auth0Service { + + @Value("${okta.oauth2.client-id}") + private String clientId; + + @Value("${okta.oauth2.client-secret}") + private String clientSecret; + + @Value("${okta.oauth2.issuer}") + private String domain; + + @Value("${application.auth0.management-client-id}") + private String managementClientId; + + @Value("${application.auth0.management-client-secret}") + private String managementClientSecret; + + @Value("${application.auth0.role-landlord-id}") + private String roleLandlordId; + + @Value("${application.auth0.role-tenant-id}") + private String roleTenantId; + + private final UserRepository userRepository; + private final AuthorityRepository authorityRepository; + + public Auth0Service(UserRepository userRepository, AuthorityRepository authorityRepository) { + this.userRepository = userRepository; + this.authorityRepository = authorityRepository; + } + + @Transactional + public void addLandlordRoleToUser(ReadUserDTO readUserDTO, String auth0UserId) { + if (readUserDTO.authorities().stream().noneMatch(role -> role.equals(SecurityUtils.ROLE_LANDLORD))) { + try { + // 1. Assign ROLE_LANDLORD to Auth0 + System.out.println("πŸ“‘ Assigning ROLE_LANDLORD to Auth0 for: " + auth0UserId); + String accessToken = this.getAccessToken(); + assignRoleById(accessToken, auth0UserId, roleLandlordId); + + // 2. Also save ROLE_LANDLORD to database + System.out.println("πŸ’Ύ Saving ROLE_LANDLORD to database for: " + readUserDTO.publicId()); + User user = userRepository.findOneByPublicId(readUserDTO.publicId()) + .orElseThrow(() -> new UserException("User not found: " + readUserDTO.publicId())); + + Authority landlordAuthority = authorityRepository.findByName(SecurityUtils.ROLE_LANDLORD) + .orElseGet(() -> { + System.out.println("⚠️ ROLE_LANDLORD not found in DB, creating it..."); + Authority auth = new Authority(); + auth.setName(SecurityUtils.ROLE_LANDLORD); + return authorityRepository.save(auth); + }); + + // Add ROLE_LANDLORD while keeping existing roles + System.out.println("πŸ“‹ Current roles before adding: " + user.getAuthorities()); + + // Create new Set to ensure all existing roles are preserved + Set authorities = new HashSet<>(user.getAuthorities()); + authorities.add(landlordAuthority); + user.setAuthorities(authorities); + + userRepository.saveAndFlush(user); + System.out.println("πŸ“‹ Current roles after adding: " + user.getAuthorities()); + System.out.println("βœ… ROLE_LANDLORD saved to database"); + + } catch (Auth0Exception a) { + throw new UserException( + String.format("not possible to assign %s to %s", roleLandlordId, readUserDTO.publicId())); + } + } + } + + public void assignTenantRole(String auth0UserId) { + try { + String accessToken = this.getAccessToken(); + String roleTenantId = "rol_Ur6hM5pvWc3q1yn9"; // Your ROLE_TENANT ID + assignRoleById(accessToken, auth0UserId, roleTenantId); + System.out.println("βœ… ROLE_TENANT assigned to: " + auth0UserId); + } catch (Auth0Exception e) { + System.err.println("❌ Failed to assign ROLE_TENANT: " + e.getMessage()); + throw new UserException("Failed to assign tenant role"); + } + } + + private void assignRoleById(String accessToken, String auth0UserId, String roleIdToAdd) { + try { + System.out.println("πŸ”— Connecting to Auth0 Management API..."); + ManagementAPI mgmt = ManagementAPI.newBuilder(domain, accessToken).build(); + System.out.println("πŸ“€ Assigning role " + roleIdToAdd + " to user " + auth0UserId); + mgmt.roles().assignUsers(roleIdToAdd, List.of(auth0UserId)).execute(); + System.out.println("βœ… Role assigned successfully in Auth0"); + } catch (APIException e) { + System.err.println("❌ Auth0 API Error: " + e.getMessage()); + System.err.println("❌ Status: " + e.getStatusCode()); + throw new UserException("Auth0 API failed: " + e.getMessage()); + } catch (Auth0Exception e) { + System.err.println("❌ Auth0 Exception: " + e.getMessage()); + throw new UserException("Failed to connect to Auth0: " + e.getMessage()); + } + } + + private String getAccessToken() throws Auth0Exception { + AuthAPI authAPI = AuthAPI.newBuilder(domain, managementClientId, managementClientSecret).build(); + TokenRequest tokenRequest = authAPI.requestToken(domain + "api/v2/"); + TokenHolder holder = tokenRequest.execute().getBody(); + return holder.getAccessToken(); + } + +} diff --git a/src/main/java/fr/codecake/airbnbclone/user/application/UserException.java b/src/main/java/fr/codecake/nbat/user/application/UserException.java similarity index 72% rename from src/main/java/fr/codecake/airbnbclone/user/application/UserException.java rename to src/main/java/fr/codecake/nbat/user/application/UserException.java index b709841..5d82a13 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/application/UserException.java +++ b/src/main/java/fr/codecake/nbat/user/application/UserException.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.user.application; +package fr.codecake.nbat.user.application; public class UserException extends RuntimeException { diff --git a/src/main/java/fr/codecake/nbat/user/application/UserService.java b/src/main/java/fr/codecake/nbat/user/application/UserService.java new file mode 100644 index 0000000..81977da --- /dev/null +++ b/src/main/java/fr/codecake/nbat/user/application/UserService.java @@ -0,0 +1,194 @@ +package fr.codecake.nbat.user.application; + +import fr.codecake.nbat.infrastructure.config.SecurityUtils; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; +import fr.codecake.nbat.user.domain.Authority; +import fr.codecake.nbat.user.domain.User; +import fr.codecake.nbat.user.mapper.UserMapper; +import fr.codecake.nbat.user.repository.AuthorityRepository; +import fr.codecake.nbat.user.repository.UserRepository; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.oauth2.core.user.OAuth2User; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.Instant; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class UserService { + + private static final String UPDATED_AT_KEY = "updated_at"; + private final UserRepository userRepository; + private final AuthorityRepository authorityRepository; + private final Auth0Service auth0Service; + private final UserMapper userMapper; + + public UserService(UserRepository userRepository, + AuthorityRepository authorityRepository, + Auth0Service auth0Service, + UserMapper userMapper) { + this.userRepository = userRepository; + this.authorityRepository = authorityRepository; + this.auth0Service = auth0Service; + this.userMapper = userMapper; + } + + @Transactional(readOnly = true) + public ReadUserDTO getAuthenticatedUserFromSecurityContext() { + OAuth2User principal = (OAuth2User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + User user = mapOauth2AttributesToUser(principal.getAttributes()); + return getByEmail(user.getEmail()).orElseThrow(); + } + + @Transactional(readOnly = true) + public Optional getByEmail(String email) { + Optional oneByEmail = userRepository.findOneByEmail(email); + return oneByEmail.map(userMapper::userToReadUserDTO); + } + + @Transactional + public void syncWithIdp(OAuth2User oAuth2User, boolean forceResync) { + Map attributes = oAuth2User.getAttributes(); + User user = mapOauth2AttributesToUser(attributes); + String auth0UserId = String.valueOf(attributes.get("sub")); + + Optional existingUser = userRepository.findOneByEmail(user.getEmail()); + + if (existingUser.isPresent()) { + // User exists - update if needed + User currentUser = existingUser.orElseThrow(); + + // CHECK: If user has NO roles, assign default ROLE_TENANT + if (currentUser.getAuthorities().isEmpty()) { + System.out.println("⚠️ User exists but has NO roles - assigning default ROLE_TENANT..."); + assignTenantRoleForNewUser(auth0UserId, currentUser); + } + + // Also update user info if it changed + if (attributes.get(UPDATED_AT_KEY) != null) { + Instant lastModifiedDate = currentUser.getLastModifiedDate(); + Instant idpModifiedDate; + if (attributes.get(UPDATED_AT_KEY) instanceof Instant instant) { + idpModifiedDate = instant; + } else { + idpModifiedDate = Instant.ofEpochSecond((Integer) attributes.get(UPDATED_AT_KEY)); + } + if (idpModifiedDate.isAfter(lastModifiedDate) || forceResync) { + updateUser(user); + } + } + } else { + // NEW USER - Backend assigns ROLE_TENANT + System.out.println("πŸ†• New user detected, assigning ROLE_TENANT..."); + assignTenantRoleForNewUser(auth0UserId, user); + } + } + + @Transactional + private void assignTenantRoleForNewUser(String auth0UserId, User user) { + try { + // 1. Assign ROLE_TENANT to Auth0 + System.out.println("πŸ“‘ Assigning ROLE_TENANT to Auth0 for: " + auth0UserId); + auth0Service.assignTenantRole(auth0UserId); + + // 2. Get ROLE_TENANT from database (or create if doesn't exist) + Authority tenantAuthority = authorityRepository.findByName(SecurityUtils.ROLE_TENANT) + .orElseGet(() -> { + System.out.println("⚠️ ROLE_TENANT not found in DB, creating it..."); + Authority auth = new Authority(); + auth.setName(SecurityUtils.ROLE_TENANT); + return authorityRepository.save(auth); + }); + + // 3. Add role to user and save to database + user.getAuthorities().clear(); // Remove any existing roles + user.getAuthorities().add(tenantAuthority); + + // For NEW users, save first, then add role (to ensure user ID is generated) + if (user.getId() == null) { + System.out.println("πŸ’Ύ Saving NEW user to database..."); + user = userRepository.saveAndFlush(user); + } + + // Now update with roles + userRepository.saveAndFlush(user); + System.out.println("βœ… User saved to database with ROLE_TENANT"); + System.out.println("πŸ”‘ User ID: " + user.getId() + ", Public ID: " + user.getPublicId()); + + } catch (Exception e) { + System.err.println("❌ Error assigning tenant role: " + e.getMessage()); + e.printStackTrace(); + throw e; + } + } + + @Transactional + private void updateUser(User user) { + Optional userToUpdateOpt = userRepository.findOneByEmail(user.getEmail()); + if (userToUpdateOpt.isPresent()) { + User userToUpdate = userToUpdateOpt.get(); + userToUpdate.setEmail(user.getEmail()); + userToUpdate.setFirstName(user.getFirstName()); + userToUpdate.setLastName(user.getLastName()); + userToUpdate.setAuthorities(user.getAuthorities()); + userToUpdate.setImageUrl(user.getImageUrl()); + userRepository.saveAndFlush(userToUpdate); + } + } + + public Optional getByPublicId(UUID publicId) { + Optional oneByPublicId = userRepository.findOneByPublicId(publicId); + return oneByPublicId.map(userMapper::userToReadUserDTO); + } + + @SuppressWarnings("unchecked") + private User mapOauth2AttributesToUser(Map attributes) { + User user = new User(); + String sub = String.valueOf(attributes.get("sub")); + String username = null; + + if (attributes.get("preferred_username") != null) { + username = ((String) attributes.get("preferred_username")).toLowerCase(); + } + + if (attributes.get("given_name") != null) { + user.setFirstName(((String) attributes.get("given_name"))); + } else if ((attributes.get("nickname") != null)) { + user.setFirstName(((String) attributes.get("nickname"))); + } + + if (attributes.get("family_name") != null) { + user.setLastName(((String) attributes.get("family_name"))); + } + + if (attributes.get("email") != null) { + user.setEmail(((String) attributes.get("email"))); + } else if (sub.contains("|") && (username != null && username.contains("@"))) { + user.setEmail(username); + } else { + user.setEmail(sub); + } + + if (attributes.get("picture") != null) { + user.setImageUrl(((String) attributes.get("picture"))); + } + + if (attributes.get(SecurityUtils.CLAIMS_NAMESPACE) != null) { + List authoritiesRaw = (List) attributes.get(SecurityUtils.CLAIMS_NAMESPACE); + + // Look up authorities from database + Set authorities = authoritiesRaw.stream() + .map(authorityName -> authorityRepository.findByName(authorityName) + .orElseGet(() -> { + Authority newAuth = new Authority(); + newAuth.setName(authorityName); + return authorityRepository.save(newAuth); + })) + .collect(Collectors.toSet()); + user.setAuthorities(authorities); + } + return user; + } +} diff --git a/src/main/java/fr/codecake/airbnbclone/user/application/dto/ReadUserDTO.java b/src/main/java/fr/codecake/nbat/user/application/dto/ReadUserDTO.java similarity index 85% rename from src/main/java/fr/codecake/airbnbclone/user/application/dto/ReadUserDTO.java rename to src/main/java/fr/codecake/nbat/user/application/dto/ReadUserDTO.java index 5198db3..804872b 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/application/dto/ReadUserDTO.java +++ b/src/main/java/fr/codecake/nbat/user/application/dto/ReadUserDTO.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.user.application.dto; +package fr.codecake.nbat.user.application.dto; import java.util.Set; import java.util.UUID; diff --git a/src/main/java/fr/codecake/airbnbclone/user/domain/Authority.java b/src/main/java/fr/codecake/nbat/user/domain/Authority.java similarity index 96% rename from src/main/java/fr/codecake/airbnbclone/user/domain/Authority.java rename to src/main/java/fr/codecake/nbat/user/domain/Authority.java index 881a7ca..5fe489d 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/domain/Authority.java +++ b/src/main/java/fr/codecake/nbat/user/domain/Authority.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.user.domain; +package fr.codecake.nbat.user.domain; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/fr/codecake/airbnbclone/user/domain/User.java b/src/main/java/fr/codecake/nbat/user/domain/User.java similarity index 96% rename from src/main/java/fr/codecake/airbnbclone/user/domain/User.java rename to src/main/java/fr/codecake/nbat/user/domain/User.java index e35b297..d075d4f 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/domain/User.java +++ b/src/main/java/fr/codecake/nbat/user/domain/User.java @@ -1,4 +1,4 @@ -package fr.codecake.airbnbclone.user.domain; +package fr.codecake.nbat.user.domain; import java.util.HashSet; import java.util.Objects; @@ -7,7 +7,7 @@ import org.hibernate.annotations.UuidGenerator; -import fr.codecake.airbnbclone.sharedkernel.domain.AbstractAuditingEntity; +import fr.codecake.nbat.sharedkernel.domain.AbstractAuditingEntity; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; diff --git a/src/main/java/fr/codecake/airbnbclone/user/mapper/UserMapper.java b/src/main/java/fr/codecake/nbat/user/mapper/UserMapper.java similarity index 54% rename from src/main/java/fr/codecake/airbnbclone/user/mapper/UserMapper.java rename to src/main/java/fr/codecake/nbat/user/mapper/UserMapper.java index ffaf103..935680e 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/mapper/UserMapper.java +++ b/src/main/java/fr/codecake/nbat/user/mapper/UserMapper.java @@ -1,10 +1,10 @@ -package fr.codecake.airbnbclone.user.mapper; +package fr.codecake.nbat.user.mapper; import org.mapstruct.Mapper; -import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; -import fr.codecake.airbnbclone.user.domain.Authority; -import fr.codecake.airbnbclone.user.domain.User; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; +import fr.codecake.nbat.user.domain.Authority; +import fr.codecake.nbat.user.domain.User; @Mapper(componentModel = "spring") public interface UserMapper { diff --git a/src/main/java/fr/codecake/airbnbclone/user/presentation/AuthResource.java b/src/main/java/fr/codecake/nbat/user/presentation/AuthResource.java similarity index 75% rename from src/main/java/fr/codecake/airbnbclone/user/presentation/AuthResource.java rename to src/main/java/fr/codecake/nbat/user/presentation/AuthResource.java index cde7f56..0bde2aa 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/presentation/AuthResource.java +++ b/src/main/java/fr/codecake/nbat/user/presentation/AuthResource.java @@ -1,8 +1,8 @@ -package fr.codecake.airbnbclone.user.presentation; +package fr.codecake.nbat.user.presentation; -import fr.codecake.airbnbclone.user.application.Auth0Service; -import fr.codecake.airbnbclone.user.application.UserService; -import fr.codecake.airbnbclone.user.application.dto.ReadUserDTO; +import fr.codecake.nbat.user.application.Auth0Service; +import fr.codecake.nbat.user.application.UserService; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; import jakarta.servlet.http.HttpServletRequest; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; @@ -18,6 +18,7 @@ @RestController @RequestMapping("/api/auth") +@CrossOrigin(origins = { "http://localhost:4200", "http://localhost:4201" }, allowCredentials = "true") public class AuthResource { private final UserService userService; @@ -26,9 +27,14 @@ public class AuthResource { private final Auth0Service auth0Service; - public AuthResource(UserService userService, ClientRegistrationRepository registration, Auth0Service auth0Service) { + public AuthResource(UserService userService, ClientRegistrationRepository registrationRepository, + Auth0Service auth0Service) { this.userService = userService; - this.registration = registration.findByRegistrationId("okta"); + this.registration = registrationRepository.findByRegistrationId("okta"); + if (this.registration == null) { + throw new IllegalStateException( + "OAuth2 Client registration 'okta' not found. Check application.yml configuration."); + } this.auth0Service = auth0Service; } @@ -58,10 +64,11 @@ public ResponseEntity assignLandlordRole( } // add landlord role via Auth0Service - auth0Service.addLandlordRoleToUser(userDto, auth0UserId); // updates Auth0's database + auth0Service.addLandlordRoleToUser(userDto, auth0UserId); // updates Auth0's database AND our database - // force resync to update database - userService.syncWithIdp(user, true); // fetches fresh data from Auth0 and updates YOUR database + // DON'T force resync here - it overwrites roles from the token which don't + // include the new role yet + // The next login will sync the updated roles from Auth0 return ResponseEntity.ok("Landlord role assigned successfully"); } diff --git a/src/main/java/fr/codecake/nbat/user/repository/AuthorityRepository.java b/src/main/java/fr/codecake/nbat/user/repository/AuthorityRepository.java new file mode 100644 index 0000000..2a5b9ab --- /dev/null +++ b/src/main/java/fr/codecake/nbat/user/repository/AuthorityRepository.java @@ -0,0 +1,10 @@ +package fr.codecake.nbat.user.repository; + +import fr.codecake.nbat.user.domain.Authority; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.Optional; + +public interface AuthorityRepository extends JpaRepository { + Optional findByName(String name); +} diff --git a/src/main/java/fr/codecake/airbnbclone/user/repository/UserRepository.java b/src/main/java/fr/codecake/nbat/user/repository/UserRepository.java similarity index 74% rename from src/main/java/fr/codecake/airbnbclone/user/repository/UserRepository.java rename to src/main/java/fr/codecake/nbat/user/repository/UserRepository.java index d096364..e70eb6d 100644 --- a/src/main/java/fr/codecake/airbnbclone/user/repository/UserRepository.java +++ b/src/main/java/fr/codecake/nbat/user/repository/UserRepository.java @@ -1,6 +1,6 @@ -package fr.codecake.airbnbclone.user.repository; +package fr.codecake.nbat.user.repository; -import fr.codecake.airbnbclone.user.domain.User; +import fr.codecake.nbat.user.domain.User; import org.springframework.data.jpa.repository.JpaRepository; import java.util.Optional; diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 05a8de9..97947e2 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1,21 +1,2 @@ -# spring: -# liquibase: -# contexts: dev -# default-schema: public -# jpa: -# properties: -# hibernate: -# '[default_schema]': public -# datasource: -# url: jdbc:postgresql://localhost:5432/airbnb_db -# username: postgres -# password: 0000 -# application: -# auth0: -# role-landlord-id: "rol_rSyLRkZ1gsnawxY4" -# role-tenant-id: "rol_Ur6hM5pvWc3q1yn9" - -spring: - liquibase: - contexts: dev - \ No newline at end of file +# This is the dev profile configuration +# Currently using default application.yml settings diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index f3d1e9b..494cee6 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -2,7 +2,7 @@ # level: # ROOT: info # '[org.hibernate.SQL]': INFO -# '[fr.codecake.airbnbcloneback]': INFO +# '[fr.codecake.nbatback]': INFO # spring: # datasource: @@ -13,9 +13,6 @@ # properties: # hibernate: # '[default_schema]': public -# liquibase: -# contexts: prod -# default-schema: public logging: level: @@ -28,13 +25,10 @@ spring: compose: enabled: false datasource: - url: jdbc:postgresql://localhost:5432/nbat_db - username: postgres - password: "0000" + url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/nbat_db} + username: ${SPRING_DATASOURCE_USERNAME:postgres} + password: ${SPRING_DATASOURCE_PASSWORD:0000} jpa: properties: hibernate: "[default_schema]": nbat_schema - liquibase: - contexts: prod - default-schema: nbat_schema \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index dd531c7..5320dbf 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -5,11 +5,12 @@ logging: "[mr.imane.nbatcloneback]": DEBUG spring: - profiles: - active: prod application: name: nbat-clone-back datasource: + url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/nbat_db} + username: ${SPRING_DATASOURCE_USERNAME:postgres} + password: ${SPRING_DATASOURCE_PASSWORD:0000} type: com.zaxxer.hikari.HikariDataSource hikari: poolName: Hikari @@ -21,32 +22,27 @@ spring: jpa: open-in-view: false hibernate: - ddl-auto: validate + ddl-auto: update properties: hibernate: "[default_schema]": nbat_schema - liquibase: - contexts: dev - change-log: classpath:db/changelog/master.xml - default-schema: nbat_schema - enabled: true - # drop-first: true servlet: multipart: enabled: true max-file-size: 100MB max-request-size: 100MB server: - port: 8080 + port: ${SERVER_PORT:8080} okta: oauth2: - issuer: https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ - client-id: WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg - client-secret: Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw + issuer: ${AUTH0_DOMAIN:https://dev-1m8rc8rkauzkk7c6.us.auth0.com/} + client-id: ${AUTH0_CLIENT_ID:WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg} + client-secret: ${AUTH0_CLIENT_SECRET:Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw} application: auth0: - management-client-id: nvO5Zh1avQFtJzBGPMmih2W0cvSFU9LZ - management-client-secret: E9gQ6zbcJ3iTA_qBg_W1QD0SMNrnqatggK4lS0YRYz_7njfSxqJSZAAjL0rII8Nc - role-landlord-id: rol_rSyLRkZ1gsnawxY4 + management-client-id: ${APPLICATION_AUTH0_MANAGEMENT_CLIENT_ID:nvO5Zh1avQFtJzBGPMmih2W0cvSFU9LZ} + management-client-secret: ${APPLICATION_AUTH0_MANAGEMENT_CLIENT_SECRET:E9gQ6zbcJ3iTA_qBg_W1QD0SMNrnqatggK4lS0YRYz_7njfSxqJSZAAjL0rII8Nc} + role-landlord-id: ${APPLICATION_AUTH0_ROLE_LANDLORD_ID:rol_rSyLRkZ1gsnawxY4} + role-tenant-id: ${APPLICATION_AUTH0_ROLE_TENANT_ID:rol_Ur6hM5pvWc3q1yn9} diff --git a/src/main/resources/db/.DS_Store b/src/main/resources/db/.DS_Store deleted file mode 100644 index ab2e070209d874ef50a4bc637cb935830dc76f3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T0$TO(;SS3Oz1(Em+$k7B8XJ7cim+m73Vn24hzGV-KZ}v%Zi|;`2DO zyAew(coMNQF#FBUPnP`>cCr8<+SA@4Kp6lWRKlE#!y2JD>5Am6hfwHe44@A&C>VsZ zm27tWMF!~Ixo{6d2q1wk?{EAR#wx__VwH%n`j~Qa6(v12YpZF}8|zx%1RU3KyXDG! zUT-z4ve7(VROP%?uT^EUakN;t&ffmP$$9r7eoWMhp;O?Or)9@t2CrzW+1ax{N@A4^ zFq&0n6^zUPGr$aN3Iq21b4r`CVcsV*zzqDD0XiQfDxqgFHK>mc9O(Cv;srtywCOHE zC@p#xQ-c^m5vCN;lnQ&r5T+dc(&l*(kmm2&mK|{A<%%xUb bLDhnONd}^4F*S%D6#fy=H1NO-{3-(<*TzjX diff --git a/src/main/resources/db/changelog/.DS_Store b/src/main/resources/db/changelog/.DS_Store deleted file mode 100644 index d3efac87d89efd2c675b548383b321630a5c2a9d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!AiqG5PcIPRK4`32tvM~Sp9)e>cO)gpsAH2MgwZWWA1*8-{(o+>@2NG+JYA; zG81OrW->F$z73fy02$4vL!b|!M^#MrXjX_`SM5j=J-b8+HBPZSI^pivLI!m04u7oL za{X*H#5Lx4!5yA4z#AS>UY6DEq^u^))Ys;NI`|605pcYr+8L{rxM#gr+9%9b*OZfA z)I4X+2`U~B8*9F|YNnW?;Byqs`N(H0Zl7~5!V|CMAepstcvsV(Ii} zF)oi-8(KOfZayU5S>g^w!rfUv3*nI5(5*Az3^W - - - - - CREATE SCHEMA IF NOT EXISTS nbat_db; - - - - \ No newline at end of file diff --git a/src/main/resources/db/changelog/00000000000001_user.xml b/src/main/resources/db/changelog/00000000000001_user.xml deleted file mode 100644 index 3eb9b4b..0000000 --- a/src/main/resources/db/changelog/00000000000001_user.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/db/changelog/00000000000002_listing.xml b/src/main/resources/db/changelog/00000000000002_listing.xml deleted file mode 100644 index 9f51b80..0000000 --- a/src/main/resources/db/changelog/00000000000002_listing.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/db/changelog/00000000000003_booking.xml b/src/main/resources/db/changelog/00000000000003_booking.xml deleted file mode 100644 index 4c35c77..0000000 --- a/src/main/resources/db/changelog/00000000000003_booking.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/db/changelog/data/authority.csv b/src/main/resources/db/changelog/data/authority.csv deleted file mode 100644 index c48fe73..0000000 --- a/src/main/resources/db/changelog/data/authority.csv +++ /dev/null @@ -1,4 +0,0 @@ -name -ROLE_ADMIN -ROLE_TENANT -ROLE_LANDLORD diff --git a/src/main/resources/db/changelog/master.xml b/src/main/resources/db/changelog/master.xml deleted file mode 100644 index a484226..0000000 --- a/src/main/resources/db/changelog/master.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/test/java/fr/codecake/nbat/NbatCloneBackApplicationIntegrationTest.java b/src/test/java/fr/codecake/nbat/NbatCloneBackApplicationIntegrationTest.java new file mode 100644 index 0000000..a1aac32 --- /dev/null +++ b/src/test/java/fr/codecake/nbat/NbatCloneBackApplicationIntegrationTest.java @@ -0,0 +1,22 @@ +package fr.codecake.nbat; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class NbatCloneBackApplicationIntegrationTest { + + @Test + void testApplicationContextLoads() { + // Test that the application class exists and is instantiable + assertNotNull(NbatCloneBackApplication.class); + assertTrue(NbatCloneBackApplication.class.getName().contains("NbatCloneBackApplication")); + } + + @Test + void testTestResourcesLoaded() { + // Test that configuration files exist in classpath + ClassLoader loader = this.getClass().getClassLoader(); + assertNotNull(loader.getResource("application.yml")); + } +} diff --git a/src/test/java/fr/codecake/nbat/booking/application/BookingServiceTest.java b/src/test/java/fr/codecake/nbat/booking/application/BookingServiceTest.java new file mode 100644 index 0000000..1b876d1 --- /dev/null +++ b/src/test/java/fr/codecake/nbat/booking/application/BookingServiceTest.java @@ -0,0 +1,156 @@ +package fr.codecake.nbat.booking.application; + +import fr.codecake.nbat.booking.application.dto.BookedDateDTO; +import fr.codecake.nbat.booking.application.dto.NewBookingDTO; +import fr.codecake.nbat.booking.domain.Booking; +import fr.codecake.nbat.booking.mapper.BookingMapper; +import fr.codecake.nbat.booking.repository.BookingRepository; +import fr.codecake.nbat.listing.application.LandlordService; +import fr.codecake.nbat.listing.application.dto.ListingCreateBookingDTO; +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; +import fr.codecake.nbat.sharedkernel.service.State; +import fr.codecake.nbat.sharedkernel.service.StatusNotification; +import fr.codecake.nbat.user.application.UserService; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.Optional; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +class BookingServiceTest { + + @Mock + private BookingRepository bookingRepository; + + @Mock + private BookingMapper bookingMapper; + + @Mock + private UserService userService; + + @Mock + private LandlordService landlordService; + + @InjectMocks + private BookingService bookingService; + + private UUID listingId; + private UUID tenantId; + private NewBookingDTO newBookingDTO; + private ListingCreateBookingDTO listingDTO; + private ReadUserDTO userDTO; + + @BeforeEach + void setUp() { + listingId = UUID.randomUUID(); + tenantId = UUID.randomUUID(); + + newBookingDTO = new NewBookingDTO( + OffsetDateTime.now().plusDays(1), + OffsetDateTime.now().plusDays(3), + listingId); + + listingDTO = new ListingCreateBookingDTO( + listingId, + new PriceVO(100)); + + userDTO = new ReadUserDTO( + tenantId, + "Test", + "User", + "test@example.com", + null, + new HashSet<>()); + } + + @Test + void testCreateBookingSuccessfully() { + // Arrange + Booking booking = new Booking(); + booking.setStartDate(newBookingDTO.startDate()); + booking.setEndDate(newBookingDTO.endDate()); + + when(bookingMapper.newBookingToBooking(newBookingDTO)).thenReturn(booking); + when(landlordService.getByListingPublicId(listingId)).thenReturn(Optional.of(listingDTO)); + when(bookingRepository.bookingExistsAtInterval(newBookingDTO.startDate(), newBookingDTO.endDate(), listingId)) + .thenReturn(false); + when(userService.getAuthenticatedUserFromSecurityContext()).thenReturn(userDTO); + + // Act + State result = bookingService.create(newBookingDTO); + + // Assert + assertEquals(StatusNotification.OK, result.getStatus()); + verify(bookingRepository, times(1)).save(booking); + } + + @Test + void testCreateBookingFailsWhenListingNotFound() { + // Arrange + when(bookingMapper.newBookingToBooking(newBookingDTO)).thenReturn(new Booking()); + when(landlordService.getByListingPublicId(listingId)).thenReturn(Optional.empty()); + + // Act + State result = bookingService.create(newBookingDTO); + + // Assert + assertEquals(StatusNotification.ERROR, result.getStatus()); + assertEquals("Landlord public id not found", result.getError()); + verify(bookingRepository, never()).save(any()); + } + + @Test + void testCreateBookingFailsWhenAlreadyBooked() { + // Arrange + Booking booking = new Booking(); + when(bookingMapper.newBookingToBooking(newBookingDTO)).thenReturn(booking); + when(landlordService.getByListingPublicId(listingId)).thenReturn(Optional.of(listingDTO)); + when(bookingRepository.bookingExistsAtInterval(any(), any(), eq(listingId))).thenReturn(true); + + // Act + State result = bookingService.create(newBookingDTO); + + // Assert + assertEquals(StatusNotification.ERROR, result.getStatus()); + assertEquals("One booking already exists", result.getError()); + verify(bookingRepository, never()).save(any()); + } + + @Test + void testCheckAvailability() { + // Arrange + UUID listingId = UUID.randomUUID(); + Booking booking = new Booking(); + booking.setStartDate(OffsetDateTime.now().plusDays(1)); + booking.setEndDate(OffsetDateTime.now().plusDays(3)); + + when(bookingRepository.findAllByFkListing(listingId)) + .thenReturn(java.util.List.of(booking)); + when(bookingMapper.bookingToCheckAvailability(booking)) + .thenReturn(new BookedDateDTO(booking.getStartDate(), booking.getEndDate())); + + // Act + var result = bookingService.checkAvailability(listingId); + + // Assert + assertNotNull(result); + assertEquals(1, result.size()); + } +} diff --git a/src/test/java/fr/codecake/nbat/infrastructure/config/SecurityUtilsTest.java b/src/test/java/fr/codecake/nbat/infrastructure/config/SecurityUtilsTest.java new file mode 100644 index 0000000..6670fed --- /dev/null +++ b/src/test/java/fr/codecake/nbat/infrastructure/config/SecurityUtilsTest.java @@ -0,0 +1,20 @@ +package fr.codecake.nbat.infrastructure.config; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class SecurityUtilsTest { + + @Test + void testRoleConstants() { + assertEquals("ROLE_TENANT", SecurityUtils.ROLE_TENANT); + assertEquals("ROLE_LANDLORD", SecurityUtils.ROLE_LANDLORD); + } + + @Test + void testClaimsNamespaceExists() { + assertNotNull(SecurityUtils.CLAIMS_NAMESPACE); + assertTrue(SecurityUtils.CLAIMS_NAMESPACE.length() > 0); + } +} diff --git a/src/test/java/fr/codecake/nbat/listing/application/TenantServiceTest.java b/src/test/java/fr/codecake/nbat/listing/application/TenantServiceTest.java new file mode 100644 index 0000000..9d5d797 --- /dev/null +++ b/src/test/java/fr/codecake/nbat/listing/application/TenantServiceTest.java @@ -0,0 +1,132 @@ +package fr.codecake.nbat.listing.application; + +import fr.codecake.nbat.booking.application.BookingService; +import fr.codecake.nbat.listing.application.dto.DisplayCardListingDTO; +import fr.codecake.nbat.listing.application.dto.vo.PriceVO; +import fr.codecake.nbat.listing.domain.BookingCategory; +import fr.codecake.nbat.listing.domain.Listing; +import fr.codecake.nbat.listing.mapper.ListingMapper; +import fr.codecake.nbat.listing.repository.ListingRepository; +import fr.codecake.nbat.sharedkernel.service.StatusNotification; +import fr.codecake.nbat.user.application.UserService; +import fr.codecake.nbat.user.application.dto.ReadUserDTO; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; + +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +class TenantServiceTest { + + @Mock + private ListingRepository listingRepository; + + @Mock + private ListingMapper listingMapper; + + @Mock + private UserService userService; + + @Mock + private BookingService bookingService; + + @InjectMocks + private TenantService tenantService; + + private Listing testListing; + private DisplayCardListingDTO displayDTO; + + @BeforeEach + void setUp() { + testListing = new Listing(); + testListing.setPublicId(UUID.randomUUID()); + testListing.setTitle("Beautiful House"); + testListing.setBookingCategory(BookingCategory.BEACH); + + displayDTO = new DisplayCardListingDTO( + new PriceVO(100), + "Location", + null, + BookingCategory.BEACH, + testListing.getPublicId()); + } + + @Test + void testGetAllListingsByCategory() { + // Arrange + var pageable = PageRequest.of(0, 10); + Page listingPage = new PageImpl<>(List.of(testListing)); + + when(listingRepository.findAllByBookingCategoryWithCoverOnly(pageable, BookingCategory.BEACH)) + .thenReturn(listingPage); + when(listingMapper.listingToDisplayCardListingDTO(testListing)) + .thenReturn(displayDTO); + + // Act + Page result = tenantService.getAllByCategory(pageable, BookingCategory.BEACH); + + // Assert + assertNotNull(result); + assertEquals(1, result.getTotalElements()); + verify(listingRepository, times(1)).findAllByBookingCategoryWithCoverOnly(pageable, BookingCategory.BEACH); + } + + @Test + void testGetAllListingsWhenCategoryIsAll() { + // Arrange + var pageable = PageRequest.of(0, 10); + Page listingPage = new PageImpl<>(List.of(testListing)); + + when(listingRepository.findAllWithCoverOnly(pageable)) + .thenReturn(listingPage); + when(listingMapper.listingToDisplayCardListingDTO(testListing)) + .thenReturn(displayDTO); + + // Act + Page result = tenantService.getAllByCategory(pageable, BookingCategory.ALL); + + // Assert + assertNotNull(result); + assertEquals(1, result.getTotalElements()); + verify(listingRepository, times(1)).findAllWithCoverOnly(pageable); + } + + @Test + void testGetListingByPublicId() { + // Arrange + UUID publicId = testListing.getPublicId(); + UUID landlordId = UUID.randomUUID(); + testListing.setLandlordPublicId(landlordId); + + // Use DisplayListingDTO from service, not DisplayCardListingDTO + org.mockito.Mockito.doReturn(new fr.codecake.nbat.listing.application.dto.DisplayListingDTO()) + .when(listingMapper).listingToDisplayListingDTO(testListing); + + when(listingRepository.findByPublicId(publicId)).thenReturn(Optional.of(testListing)); + when(userService.getByPublicId(landlordId)).thenReturn(Optional.of(new ReadUserDTO( + landlordId, "Landlord", "Name", "landlord@test.com", null, new HashSet<>()))); + + // Act + var result = tenantService.getOne(publicId); + + // Assert + assertNotNull(result); + assertEquals(StatusNotification.OK, result.getStatus()); + assertNull(result.getError()); + verify(listingRepository, times(1)).findByPublicId(publicId); + } +} diff --git a/src/test/java/fr/codecake/nbat/user/application/UserServiceTest.java b/src/test/java/fr/codecake/nbat/user/application/UserServiceTest.java new file mode 100644 index 0000000..afaed55 --- /dev/null +++ b/src/test/java/fr/codecake/nbat/user/application/UserServiceTest.java @@ -0,0 +1,112 @@ +package fr.codecake.nbat.user.application; + +import fr.codecake.nbat.user.application.dto.ReadUserDTO; +import fr.codecake.nbat.user.domain.Authority; +import fr.codecake.nbat.user.domain.User; +import fr.codecake.nbat.user.mapper.UserMapper; +import fr.codecake.nbat.user.repository.AuthorityRepository; +import fr.codecake.nbat.user.repository.UserRepository; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.*; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +class UserServiceTest { + + @Mock + private UserRepository userRepository; + + @Mock + private AuthorityRepository authorityRepository; + + @Mock + private UserMapper userMapper; + + @Mock + private Auth0Service auth0Service; + + @InjectMocks + private UserService userService; + + private User testUser; + private Authority roleTenant; + + @BeforeEach + void setUp() { + UUID userId = UUID.randomUUID(); + testUser = new User(); + testUser.setPublicId(userId); + testUser.setEmail("test@example.com"); + testUser.setFirstName("Test"); + testUser.setLastName("User"); + + roleTenant = new Authority(); + roleTenant.setName("ROLE_TENANT"); + } + + @Test + void testUserPersistenceInRepository() { + // Arrange + when(userRepository.save(any(User.class))).thenReturn(testUser); + + // Act + User saved = userRepository.save(testUser); + + // Assert + assertNotNull(saved); + assertEquals("test@example.com", saved.getEmail()); + verify(userRepository, times(1)).save(testUser); + } + + @Test + void testAssignDefaultRoleToNewUser() { + // Arrange + testUser.setAuthorities(new HashSet<>()); + + // Act + testUser.getAuthorities().add(roleTenant); + + // Assert + assertTrue(testUser.getAuthorities().contains(roleTenant)); + assertEquals(1, testUser.getAuthorities().size()); + } + + @Test + void testFindUserByEmail() { + // Arrange + when(userRepository.findOneByEmail("test@example.com")).thenReturn(Optional.of(testUser)); + + // Act + Optional result = userRepository.findOneByEmail("test@example.com"); + + // Assert + assertTrue(result.isPresent()); + assertEquals("test@example.com", result.get().getEmail()); + } + + @Test + void testGetAuthenticatedUser() { + // Arrange + when(userRepository.findOneByEmail("test@example.com")).thenReturn(Optional.of(testUser)); + ReadUserDTO dto = new ReadUserDTO(testUser.getPublicId(), testUser.getFirstName(), testUser.getLastName(), + testUser.getEmail(), null, new HashSet<>()); + when(userMapper.userToReadUserDTO(testUser)).thenReturn(dto); + + // Act + Optional result = userRepository.findOneByEmail("test@example.com") + .map(userMapper::userToReadUserDTO); + + // Assert + assertTrue(result.isPresent()); + assertEquals("test@example.com", result.get().email()); + } +} diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml new file mode 100644 index 0000000..5ccc2ca --- /dev/null +++ b/src/test/resources/application.yml @@ -0,0 +1,28 @@ +logging: + level: + ROOT: WARN + fr.codecake.nbat: DEBUG + +spring: + application: + name: nbat-clone-back-test + datasource: + url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false + driver-class-name: org.h2.Driver + username: sa + password: + h2: + console: + enabled: true + jpa: + hibernate: + ddl-auto: create-drop + database-platform: org.hibernate.dialect.H2Dialect + security: + oauth2: + resourceserver: + jwt: + issuer-uri: ${OKTA_OAUTH2_ISSUER:https://test.auth0.com/} + +server: + port: 8081 From e69c58ee91f0fb53a47a4235d3f198216bd54c9f Mon Sep 17 00:00:00 2001 From: Mustapha Bouddahr Date: Tue, 3 Feb 2026 00:05:48 +0100 Subject: [PATCH 3/3] implement database-based role management --- .env | 25 - .env.example | 25 - BACKEND_DOCUMENTATION.md | 829 +++++++----------- Dockerfile | 5 - README.md | 206 +---- docker-compose.override.yml | 16 - docker-compose.yml | 21 +- init.sql | 10 +- .../booking/application/BookingService.java | 75 +- .../booking/presentation/BookingResource.java | 11 +- .../config/DatabaseAuthoritiesFilter.java | 13 +- .../config/OAuth2LoginSuccessHandler.java | 2 +- .../config/SecurityConfiguration.java | 156 ++-- .../infrastructure/config/SecurityUtils.java | 98 +-- .../listing/application/LandlordService.java | 6 +- .../presentation/LandlordResource.java | 17 +- .../nbat/user/application/Auth0Service.java | 126 +-- .../nbat/user/application/UserService.java | 71 +- .../nbat/user/presentation/AuthResource.java | 33 +- src/main/resources/application-dev.yml | 2 - src/main/resources/application-prod.yml | 34 - src/main/resources/application.yml | 46 +- ...atCloneBackApplicationIntegrationTest.java | 22 - .../application/BookingServiceTest.java | 156 ---- .../config/SecurityUtilsTest.java | 20 - .../application/TenantServiceTest.java | 132 --- .../user/application/UserServiceTest.java | 112 --- src/test/resources/application.yml | 28 - 28 files changed, 581 insertions(+), 1716 deletions(-) delete mode 100644 .env delete mode 100644 .env.example delete mode 100644 Dockerfile delete mode 100644 docker-compose.override.yml delete mode 100644 src/main/resources/application-dev.yml delete mode 100644 src/main/resources/application-prod.yml delete mode 100644 src/test/java/fr/codecake/nbat/NbatCloneBackApplicationIntegrationTest.java delete mode 100644 src/test/java/fr/codecake/nbat/booking/application/BookingServiceTest.java delete mode 100644 src/test/java/fr/codecake/nbat/infrastructure/config/SecurityUtilsTest.java delete mode 100644 src/test/java/fr/codecake/nbat/listing/application/TenantServiceTest.java delete mode 100644 src/test/java/fr/codecake/nbat/user/application/UserServiceTest.java delete mode 100644 src/test/resources/application.yml diff --git a/.env b/.env deleted file mode 100644 index 7e5d5cb..0000000 --- a/.env +++ /dev/null @@ -1,25 +0,0 @@ -# PostgreSQL Configuration -POSTGRES_USER=postgres -POSTGRES_PASSWORD=0000 -POSTGRES_DB=nbat_db -POSTGRES_HOST=localhost -POSTGRES_PORT=5432 - -# Spring Boot DataSource (must match above) -SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/nbat_db -SPRING_DATASOURCE_USERNAME=postgres -SPRING_DATASOURCE_PASSWORD=0000 - -# Auth0 / Okta OAuth2 Configuration -AUTH0_DOMAIN=https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ -AUTH0_CLIENT_ID=WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg -AUTH0_CLIENT_SECRET=Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw - -# Auth0 Management API Configuration -APPLICATION_AUTH0_MANAGEMENT_CLIENT_ID=nvO5Zh1avQFtJzBGPMmih2W0cvSFU9LZ -APPLICATION_AUTH0_MANAGEMENT_CLIENT_SECRET=E9gQ6zbcJ3iTA_qBg_W1QD0SMNrnqatggK4lS0YRYz_7njfSxqJSZAAjL0rII8Nc -APPLICATION_AUTH0_ROLE_LANDLORD_ID=rol_rSyLRkZ1gsnawxY4 -APPLICATION_AUTH0_ROLE_TENANT_ID=rol_Ur6hM5pvWc3q1yn9 - -# Server Configuration -SERVER_PORT=8080 \ No newline at end of file diff --git a/.env.example b/.env.example deleted file mode 100644 index c55f55e..0000000 --- a/.env.example +++ /dev/null @@ -1,25 +0,0 @@ -# PostgreSQL Configuration -POSTGRES_USER=postgres -POSTGRES_PASSWORD=0000 -POSTGRES_DB=nbat_db -POSTGRES_HOST=localhost -POSTGRES_PORT=5432 - -# Spring Boot DataSource (must match above) -SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/nbat_db -SPRING_DATASOURCE_USERNAME=postgres -SPRING_DATASOURCE_PASSWORD=0000 - -# Auth0 / Okta OAuth2 Configuration -AUTH0_DOMAIN=https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ -AUTH0_CLIENT_ID=WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg -AUTH0_CLIENT_SECRET=Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw - -# Auth0 Management API Configuration -APPLICATION_AUTH0_MANAGEMENT_CLIENT_ID=nvO5Zh1avQFtJzBGPMmih2W0cvSFU9LZ -APPLICATION_AUTH0_MANAGEMENT_CLIENT_SECRET=E9gQ6zbcJ3iTA_qBg_W1QD0SMNrnqatggK4lS0YRYz_7njfSxqJSZAAjL0rII8Nc -APPLICATION_AUTH0_ROLE_LANDLORD_ID=rol_rSyLRkZ1gsnawxY4 -APPLICATION_AUTH0_ROLE_TENANT_ID=rol_Ur6hM5pvWc3q1yn9 - -# Server Configuration -SERVER_PORT=8080 diff --git a/BACKEND_DOCUMENTATION.md b/BACKEND_DOCUMENTATION.md index f30509a..951cdb1 100644 --- a/BACKEND_DOCUMENTATION.md +++ b/BACKEND_DOCUMENTATION.md @@ -1,87 +1,57 @@ -# NBAT Backend - Complete Documentation +# NBAT Backend Documentation -**Version:** 1.0 -**Last Updated:** January 30, 2026 +**Version:** 2.0 +**Last Updated:** February 2, 2026 **Status:** βœ… Production Ready --- -## πŸ“‹ Table of Contents +## Quick Overview -1. [Architecture Overview](#architecture-overview) -2. [Project Structure](#project-structure) -3. [Technology Stack](#technology-stack) -4. [Database Schema](#database-schema) -5. [API Endpoints](#api-endpoints) -6. [Authentication & Security](#authentication--security) -7. [Configuration](#configuration) -8. [Error Handling](#error-handling) -9. [Development Guide](#development-guide) -10. [Deployment](#deployment) +NBAT is a property rental platform (like Airbnb) built with Spring Boot. ---- +**Key Architecture:** + +- Auth0 handles **authentication** (verifying who you are) +- PostgreSQL database handles **authorization** (what you can do) +- CSRF tokens protect state-changing requests +- Roles are loaded from database on every request for instant updates -## Architecture Overview +--- -### System Design +## How It Works -NBAT Backend is a Spring Boot 3.2 microservice built with: +### Login Flow -- **Framework:** Spring Boot 3.2.4 -- **Java Version:** 21 LTS -- **Database:** PostgreSQL 15+ -- **Authentication:** OAuth2 with Auth0 -- **Session Management:** Cookie-based sessions -- **CSRF Protection:** CookieCsrfTokenRepository with tokens -- **Build Tool:** Maven 3.8+ +``` +1. User clicks login β†’ Redirected to Auth0 +2. Auth0 verifies credentials β†’ Redirects back +3. OAuth2LoginSuccessHandler runs: + - Checks if user exists in database + - Creates new user OR updates existing user + - New users get ROLE_TENANT automatically +4. DatabaseAuthoritiesFilter runs on EVERY request: + - Loads user's roles from database + - Updates SecurityContext with fresh roles +5. User can now access features based on their roles +``` -### Key Components +### Request Flow ``` -β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” -β”‚ Spring Boot Application (8080) β”‚ -β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ -β”‚ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ Controller Layer (REST Endpoints) β”‚ β”‚ -β”‚ β”‚ β€’ AuthController β”‚ β”‚ -β”‚ β”‚ β€’ BookingController β”‚ β”‚ -β”‚ β”‚ β€’ ListingController β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ ↓ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ Service Layer (Business Logic) β”‚ β”‚ -β”‚ β”‚ β€’ AuthService β”‚ β”‚ -β”‚ β”‚ β€’ BookingService β”‚ β”‚ -β”‚ β”‚ β€’ ListingService β”‚ β”‚ -β”‚ β”‚ β€’ UserService β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ ↓ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ Repository Layer (Data Access) β”‚ β”‚ -β”‚ β”‚ β€’ JPA Repositories β”‚ β”‚ -β”‚ β”‚ β€’ Custom Queries β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ ↓ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ PostgreSQL Database β”‚ β”‚ -β”‚ β”‚ β€’ users β”‚ β”‚ -β”‚ β”‚ β€’ landlord_listings β”‚ β”‚ -β”‚ β”‚ β€’ bookings β”‚ β”‚ -β”‚ β”‚ β€’ user_authorities β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ Security Layer β”‚ β”‚ -β”‚ β”‚ β€’ OAuth2LoginSuccessHandler β”‚ β”‚ -β”‚ β”‚ β€’ DatabaseAuthoritiesFilter β”‚ β”‚ -β”‚ β”‚ β€’ CSRF Token Handler β”‚ β”‚ -β”‚ β”‚ β€’ CORS Configuration β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ β”‚ -β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ - ↕ - Auth0 +Browser Request + ↓ +CORS Check (is origin allowed?) + ↓ +CSRF Validation (for POST/PUT/DELETE) + ↓ +Authentication (is user logged in?) + ↓ +DatabaseAuthoritiesFilter (load roles from DB) + ↓ +Authorization (does user have required role?) + ↓ +Controller β†’ Service β†’ Repository β†’ Database ``` --- @@ -90,611 +60,424 @@ NBAT Backend is a Spring Boot 3.2 microservice built with: ``` src/main/java/fr/codecake/nbat/ -β”œβ”€β”€ infrastructure/ -β”‚ β”œβ”€β”€ config/ -β”‚ β”‚ β”œβ”€β”€ SecurityConfiguration.java # OAuth2, CORS, CSRF setup -β”‚ β”‚ β”œβ”€β”€ OAuth2LoginSuccessHandler.java # Auth0 login handler -β”‚ β”‚ β”œβ”€β”€ DatabaseAuthoritiesFilter.java # Reload roles from DB -β”‚ β”‚ └── CustomAuthorizationRequestResolver.java -β”‚ β”œβ”€β”€ rest/ -β”‚ β”‚ β”œβ”€β”€ GlobalExceptionHandler.java -β”‚ β”‚ └── ExceptionResponse.java -β”‚ └── persistence/ -β”‚ └── JPA Configurations β”‚ -β”œβ”€β”€ booking/ -β”‚ β”œβ”€β”€ api/BookingController.java # REST endpoints -β”‚ β”œβ”€β”€ application/BookingService.java # Business logic -β”‚ β”œβ”€β”€ infrastructure/BookingRepository.java # Data access -β”‚ └── domain/ -β”‚ └── Booking.java # Entity +β”œβ”€β”€ infrastructure/config/ +β”‚ β”œβ”€β”€ SecurityConfiguration.java # CORS, CSRF, OAuth2 setup +β”‚ β”œβ”€β”€ OAuth2LoginSuccessHandler.java # Syncs Auth0 user to DB on login +β”‚ β”œβ”€β”€ DatabaseAuthoritiesFilter.java # Loads roles from DB on each request +β”‚ └── DatabaseConfiguration.java β”‚ β”œβ”€β”€ user/ -β”‚ β”œβ”€β”€ api/AuthController.java # Auth endpoints -β”‚ β”œβ”€β”€ application/UserService.java # User management -β”‚ β”œβ”€β”€ infrastructure/UserRepository.java # Data access -β”‚ └── domain/ -β”‚ β”œβ”€β”€ User.java # Entity -β”‚ └── Authority.java # Roles +β”‚ β”œβ”€β”€ presentation/AuthResource.java # /api/auth/* endpoints +β”‚ β”œβ”€β”€ application/UserService.java # User business logic +β”‚ β”œβ”€β”€ domain/ +β”‚ β”‚ β”œβ”€β”€ User.java # nbat_user table +β”‚ β”‚ └── Authority.java # nbat_authority table +β”‚ └── repository/ +β”‚ β”œβ”€β”€ UserRepository.java +β”‚ └── AuthorityRepository.java +β”‚ +β”œβ”€β”€ listing/ +β”‚ β”œβ”€β”€ presentation/ +β”‚ β”‚ β”œβ”€β”€ TenantResource.java # Public listing endpoints +β”‚ β”‚ └── LandlordResource.java # Landlord-only endpoints +β”‚ β”œβ”€β”€ application/ +β”‚ β”‚ β”œβ”€β”€ TenantService.java +β”‚ β”‚ └── LandlordService.java +β”‚ β”œβ”€β”€ domain/ +β”‚ β”‚ β”œβ”€β”€ Listing.java +β”‚ β”‚ └── ListingPicture.java +β”‚ └── repository/ β”‚ -└── listing/ - β”œβ”€β”€ api/ListingController.java # REST endpoints - β”œβ”€β”€ application/ListingService.java # Business logic - β”œβ”€β”€ infrastructure/ListingRepository.java # Data access - └── domain/ - └── LandlordListing.java # Entity +└── booking/ + β”œβ”€β”€ presentation/BookingResource.java + β”œβ”€β”€ application/BookingService.java + β”œβ”€β”€ domain/Booking.java + └── repository/BookingRepository.java ``` --- -## Technology Stack - -| Layer | Technology | Version | -| -------------------- | ------------- | ------- | -| **Framework** | Spring Boot | 3.2.4 | -| **Language** | Java | 21 LTS | -| **Build** | Maven | 3.8+ | -| **Database** | PostgreSQL | 15+ | -| **ORM** | Hibernate/JPA | Latest | -| **Authentication** | Auth0 OAuth2 | Latest | -| **Containerization** | Docker | Latest | -| **API** | REST | JSON | - ---- - ## Database Schema -### Users Table +All tables live in `nbat_schema`: + +### User & Role Tables ```sql -CREATE TABLE users ( - id UUID PRIMARY KEY, - email VARCHAR(255) UNIQUE NOT NULL, - name VARCHAR(255), - auth0_id VARCHAR(255) UNIQUE, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); -``` +-- User profiles +nbat_user ( + id, email, first_name, last_name, + image_url, public_id, created_date, last_modified_date +) -### User Authorities (Roles) +-- Available roles: ROLE_TENANT, ROLE_LANDLORD +nbat_authority (name) -```sql -CREATE TABLE user_authorities ( - id UUID PRIMARY KEY, - user_id UUID REFERENCES users(id) ON DELETE CASCADE, - authority VARCHAR(100) NOT NULL, - UNIQUE(user_id, authority) -); +-- Links users to their roles +nbat_user_authority (user_id, authority_name) ``` -### Landlord Listings +### Business Tables ```sql -CREATE TABLE landlord_listings ( - id UUID PRIMARY KEY, - user_id UUID REFERENCES users(id), - title VARCHAR(255) NOT NULL, - description TEXT, - location VARCHAR(255), - price_per_night DECIMAL(10, 2), - max_guests INT, - beds INT, - bedrooms INT, - bathrooms INT, - amenities TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); -``` +listing ( + id, landlord_fk, title, description, price, + location, beds, bedrooms, bathrooms, guests, category +) -### Bookings +listing_picture ( + id, listing_fk, file, file_content_type, is_cover +) -```sql -CREATE TABLE bookings ( - id UUID PRIMARY KEY, - listing_id UUID REFERENCES landlord_listings(id), - user_id UUID REFERENCES users(id), - check_in_date DATE NOT NULL, - check_out_date DATE NOT NULL, - total_nights INT, - total_price DECIMAL(10, 2), - status VARCHAR(50) DEFAULT 'CONFIRMED', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); +booking ( + id, listing_fk, tenant_fk, start_date, end_date, + total_price, number_of_travelers +) ``` --- -## API Endpoints +## Security Components -### Authentication +### 1. SecurityConfiguration.java -#### Get Authenticated User +**Main security setup** -``` -GET /api/auth/get-authenticated-user -Response: { - "id": "user-uuid", - "email": "user@example.com", - "name": "John Doe", - "authorities": ["ROLE_TENANT"] -} -``` +- Configures OAuth2 login with Auth0 +- Sets up CSRF protection (cookie + header) +- Configures CORS for frontend (localhost:4200) +- Defines public vs authenticated endpoints -#### Assign Landlord Role +### 2. OAuth2LoginSuccessHandler.java -``` -POST /api/auth/assign-landlord-role -Response: { - "message": "Role assigned successfully" +**Runs after successful Auth0 login** + +```java +@Override +public void onAuthenticationSuccess(...) { + // 1. Get user email from Auth0 + // 2. Check if user exists in DB + // 3. Create new user (assign ROLE_TENANT) OR update existing } ``` -#### Logout +### 3. DatabaseAuthoritiesFilter.java -``` -POST /api/auth/logout -Response: { - "message": "Logged out successfully" +**Runs on EVERY authenticated request** + +```java +@Override +protected void doFilterInternal(...) { + // 1. Get current user's email + // 2. Query database for their roles + // 3. Create new Authentication with DB roles + // 4. Replace old Authentication in SecurityContext } ``` -### Tenant Listings (Public) - -#### Get All Listings by Category +**Why this matters:** Role changes take effect immediately without re-login! -``` -GET /api/tenant-listing/get-all-by-category?category=apartments -Response: [ - { - "id": "listing-uuid", - "title": "Cozy Apartment", - "location": "Paris", - "pricePerNight": 80, - "beds": 2, - ... - } -] -``` +### CSRF Protection -#### Search Listings +- **Cookie:** `XSRF-TOKEN` (frontend reads this) +- **Header:** `X-CSRF-TOKEN` (frontend sends this) +- **Required for:** POST, PUT, DELETE requests +- **Not required for:** GET requests -``` -POST /api/tenant-listing/search -Body: { - "location": "Paris", - "checkInDate": "2024-02-01", - "checkOutDate": "2024-02-05", - "guests": 2 -} -Response: [Filtered listings] -``` +Frontend must: -#### Get One Listing +1. Read token from `XSRF-TOKEN` cookie +2. Send it as `X-CSRF-TOKEN` header on state-changing requests -``` -GET /api/tenant-listing/get-one?id=listing-uuid -Response: Listing details -``` +### CORS -### Booking Management +- **Allowed origins:** http://localhost:4200, http://localhost:4201 +- **Allowed methods:** GET, POST, PUT, DELETE, OPTIONS +- **Credentials:** Allowed (cookies can be sent) -#### Create Booking +--- -``` -POST /api/booking/create -Body: { - "listingId": "listing-uuid", - "checkInDate": "2024-02-01", - "checkOutDate": "2024-02-05" -} -Response: { - "id": "booking-uuid", - "status": "CONFIRMED" -} -``` +## How Roles Work -#### Check Availability +### Default Behavior -``` -GET /api/booking/check-availability?listingId=uuid&checkIn=2024-02-01&checkOut=2024-02-05 -Response: { - "available": true -} -``` +- New user logs in β†’ Gets `ROLE_TENANT` automatically +- User calls `/api/auth/assign-landlord-role` β†’ Gets `ROLE_LANDLORD` added +- Users can have both roles (tenant + landlord) -#### Get My Bookings +### Role Requirements -``` -GET /api/booking/get-booked-listing -Response: [Bookings for current user] -``` +```java +// Public - anyone +GET /api/tenant-listing/get-all-by-category -#### Get Landlord's Bookings +// Authenticated - any logged-in user +@PreAuthorize("hasAnyRole('TENANT', 'LANDLORD')") +POST /api/booking/create +// Landlord only +@PreAuthorize("hasRole('LANDLORD')") +POST /api/landlord-listing/create ``` -GET /api/booking/get-booked-listing-for-landlord -Response: [Bookings for landlord's listings] -``` -### Landlord Listings +--- + +## API Endpoints -#### Create Listing +### Authentication ``` -POST /api/landlord-listing/create -Body: { - "title": "Cozy Apartment", - "description": "...", - "location": "Paris", - "pricePerNight": 80, - "maxGuests": 4, - "beds": 2, - "bedrooms": 1, - "bathrooms": 1, - "amenities": "wifi,kitchen,parking" -} -Response: { - "id": "listing-uuid", - "status": "CREATED" -} +GET /api/auth/get-authenticated-user # Get current user + roles +POST /api/auth/assign-landlord-role # Upgrade to landlord +POST /api/auth/logout # Logout ``` -#### Get All My Listings +### Listings (Public) ``` -GET /api/landlord-listing/get-all -Response: [My listings] +GET /api/tenant-listing/get-all-by-category?category=ALL +POST /api/tenant-listing/search +GET /api/tenant-listing/get-one?publicId=xxx ``` -#### Get One Listing +### Bookings (Authenticated) ``` -GET /api/landlord-listing/get-one?id=listing-uuid -Response: Listing details +POST /api/booking/create # Create booking +GET /api/booking/check-availability # Check dates +GET /api/booking/get-booked-listing # My bookings +GET /api/booking/get-booked-listing-for-landlord # (Landlord only) ``` ---- - -## Authentication & Security - -### OAuth2 with Auth0 - -1. **Login Flow:** - - Frontend redirects to Auth0 - - User authenticates - - Auth0 redirects back with token - - Backend creates user session - -2. **Session Management:** - - Sessions created for all authenticated users - - Session cookie stored (HttpOnly, Secure) - - CSRF token provided in X-XSRF-TOKEN header - -3. **Role Management:** - - Roles stored in database - - Updated via DatabaseAuthoritiesFilter - - Assigned when user becomes landlord - -### CSRF Protection - -- **Token Storage:** Cookies (XSRF-TOKEN) -- **Header:** X-CSRF-TOKEN -- **Handling:** CookieCsrfTokenRepository -- **Exemptions:** GET requests, logout, search - -### CORS Configuration - -**Allowed Origins:** - -- `http://localhost:4200` (development) -- `http://localhost:4201` (development) - -**Allowed Methods:** GET, POST, PUT, DELETE, OPTIONS - -### Authorization Rules +### Landlord (ROLE_LANDLORD Required) ``` -Public Endpoints: -- GET /api/auth/get-authenticated-user -- GET /api/tenant-listing/get-all-by-category -- GET /api/tenant-listing/get-one -- POST /api/tenant-listing/search -- GET /api/booking/check-availability - -Authenticated Endpoints: -- POST /api/booking/create -- GET /api/booking/get-booked-listing -- GET /api/landlord-listing/get-all -- POST /api/landlord-listing/create - -Admin/Landlord Endpoints: -- GET /api/booking/get-booked-listing-for-landlord +POST /api/landlord-listing/create # Create listing +GET /api/landlord-listing/get-all # My listings +DELETE /api/landlord-listing/delete # Delete listing ``` --- ## Configuration -### Environment Variables (.env) - -```bash -# Database -DB_HOST=localhost -DB_PORT=5432 -DB_NAME=nbat_db -DB_USER=postgres -DB_PASSWORD=your-password - -# Auth0 -AUTH0_DOMAIN=your-domain.auth0.com -AUTH0_CLIENT_ID=your-client-id -AUTH0_CLIENT_SECRET=your-client-secret - -# Application -SERVER_PORT=8080 -ENVIRONMENT=dev -``` - -### Application Properties - -**File:** `src/main/resources/application.yml` +### application.yml ```yaml spring: datasource: - url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME} - username: ${DB_USER} - password: ${DB_PASSWORD} + url: jdbc:postgresql://localhost:5432/nbat_db + username: postgres + password: 0000 jpa: hibernate: - ddl-auto: validate + ddl-auto: update # Auto-update schema properties: hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - - security: - oauth2: - client: - registration: - auth0: - client-id: ${AUTH0_CLIENT_ID} - client-secret: ${AUTH0_CLIENT_SECRET} - redirect-uri: http://localhost:8080/login/oauth2/code/auth0 -``` + default_schema: nbat_schema # Use nbat_schema ---- +okta: + oauth2: + issuer: https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ + client-id: YOUR_CLIENT_ID + client-secret: YOUR_CLIENT_SECRET -## Error Handling +server: + port: 8080 +``` -### Global Exception Handler +### docker-compose.yml -All errors return consistent JSON format: +```yaml +services: + postgres: + image: postgres:16 + environment: + POSTGRES_DB: nbat_db + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 0000 + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + - ./init.sql:/docker-entrypoint-initdb.d/init.sql -```json -{ - "timestamp": "2024-01-30T12:00:00", - "status": 400, - "error": "Bad Request", - "message": "Invalid input", - "path": "/api/booking/create" -} +volumes: + postgres_data: ``` -### Common Status Codes +### init.sql -| Code | Meaning | Common Cause | -| ---- | ------------ | ------------------ | -| 200 | OK | Success | -| 201 | Created | Resource created | -| 400 | Bad Request | Invalid input | -| 401 | Unauthorized | Not authenticated | -| 403 | Forbidden | No permission | -| 404 | Not Found | Resource not found | -| 500 | Server Error | Internal error | +```sql +CREATE SCHEMA IF NOT EXISTS nbat_schema; +GRANT ALL ON SCHEMA nbat_schema TO postgres; +ALTER DATABASE nbat_db SET search_path TO nbat_schema, public; +``` --- -## Development Guide - -### Project Setup +## Development Setup -1. **Clone Repository** +### Prerequisites -```bash -git clone -cd Nbat-project-backend -``` +- Java 21 +- Docker & Docker Compose +- Maven -2. **Setup Environment** +### Quick Start ```bash -cp .env.example .env -# Edit .env with your Auth0 credentials -``` +# 1. Start database +docker-compose up -d -3. **Start Database** +# 2. Wait for postgres (check logs) +docker-compose logs -f postgres +# Look for: "database system is ready to accept connections" -```bash -docker-compose up -d postgres +# 3. Run application +./mvnw spring-boot:run + +# Application runs on http://localhost:8080 ``` -4. **Run Application** +### Reset Database ```bash +docker-compose down -v # Delete everything including data +docker-compose up -d # Fresh start ./mvnw spring-boot:run ``` -Server runs on `http://localhost:8080` - -### Building +### Check Database ```bash -# Compile -./mvnw clean compile +# Connect to postgres +docker exec -it nbat-postgres psql -U postgres -d nbat_db -# Build JAR -./mvnw clean package - -# Run JAR -java -jar target/nbat-back-0.0.1-SNAPSHOT.jar +# Useful commands: +\dt nbat_schema.* # List tables +SELECT * FROM nbat_schema.nbat_user; # View users +SELECT * FROM nbat_schema.nbat_user_authority; # View roles +\q # Exit ``` -### Testing +--- -```bash -# Run all tests -./mvnw test +## Error Responses -# Run specific test class -./mvnw test -Dtest=UserServiceTest +All errors return JSON: -# Run with coverage -./mvnw jacoco:report +```json +{ + "timestamp": "2026-02-02T12:00:00", + "status": 400, + "error": "Bad Request", + "message": "Specific error message", + "path": "/api/endpoint" +} ``` -### Adding New Endpoints +### Status Codes -1. Create Controller class in `api/` package -2. Create Service class in `application/` package -3. Create Repository in `infrastructure/` package -4. Add Entity class in `domain/` package -5. Update `SecurityConfiguration` if needed - -### Code Standards - -- Use dependency injection (constructor injection preferred) -- Follow REST conventions -- Include logging for important operations -- Add Javadoc comments for public methods -- Use DTOs for request/response +- **200 OK** - Success +- **201 Created** - Resource created +- **400 Bad Request** - Invalid input +- **401 Unauthorized** - Not logged in +- **403 Forbidden** - Missing required role +- **404 Not Found** - Resource not found +- **500 Server Error** - Something broke --- -## Deployment +## Common Issues & Solutions -### Docker Deployment - -```bash -# Build image -docker build -t nbat-backend:1.0 . - -# Run container -docker run -d \ - -e DB_HOST=postgres \ - -e AUTH0_CLIENT_ID=your-id \ - -e AUTH0_CLIENT_SECRET=your-secret \ - -p 8080:8080 \ - nbat-backend:1.0 -``` +### "relation nbat_schema.nbat_user does not exist" -### Docker Compose +**Cause:** Schema not created +**Fix:** ```bash -# Start all services +docker-compose down -v docker-compose up -d - -# View logs -docker-compose logs -f backend - -# Stop services -docker-compose down ``` -### Production Checklist - -- [ ] All environment variables set -- [ ] Database backed up -- [ ] SSL/TLS configured -- [ ] Auth0 credentials updated -- [ ] CORS origins updated -- [ ] Logging configured -- [ ] Monitoring set up -- [ ] Database connection pooling configured -- [ ] Session timeout configured -- [ ] Rate limiting configured +Ensure `init.sql` is mounted in docker-compose.yml ---- - -## Troubleshooting +### CSRF token errors -### Database Connection Error - -``` -Solution: Check DB_HOST, DB_PORT, DB_PASSWORD in .env -docker-compose logs postgres -``` +**Cause:** Missing X-CSRF-TOKEN header +**Fix:** Frontend must read XSRF-TOKEN cookie and send as X-CSRF-TOKEN header -### Auth0 Authentication Fails +### 403 Forbidden on landlord endpoints -``` -Solution: Verify AUTH0_CLIENT_ID and AUTH0_CLIENT_SECRET -Check Auth0 dashboard for correct values -``` +**Cause:** User doesn't have ROLE_LANDLORD +**Fix:** Call `/api/auth/assign-landlord-role` first -### Port Already in Use +### Roles not updating -```bash -# Windows -netstat -ano | findstr :8080 -taskkill /PID /F +**Should never happen!** DatabaseAuthoritiesFilter loads fresh roles on every request +If it does: Check filter is registered in SecurityConfiguration -# Linux/macOS -lsof -ti:8080 | xargs kill -9 -``` +--- -### CSRF Token Error +## Technology Stack -``` -Solution: Ensure X-CSRF-TOKEN header is sent with requests -Check csrf.interceptor.ts on frontend -``` +| Technology | Version | Purpose | +| --------------- | ------- | ---------------- | +| Spring Boot | 3.2.4 | Framework | +| Java | 21 | Language | +| PostgreSQL | 16 | Database | +| Hibernate/JPA | 6.4 | ORM | +| Spring Security | 6.2 | Security | +| Auth0 | Latest | Authentication | +| Docker | Latest | Containerization | --- -## Recent Fixes (January 30, 2026) +## Key Files Explained -### βœ… DatabaseAuthoritiesFilter +### SecurityConfiguration.java -- Implemented filter to reload user authorities from database -- Allows role assignments without full re-authentication -- Fixes issue where roles were lost after assignment +Sets up all security: -### βœ… CSRF Token Handling +- OAuth2 login with Auth0 +- CSRF tokens (cookie + header) +- CORS configuration +- Public vs protected endpoints -- Fixed CSRF token extraction from cookies -- Added X-CSRF-TOKEN header to requests -- Session management improved +### OAuth2LoginSuccessHandler.java -### βœ… Date Validation +Runs after Auth0 login: -- Fixed booking date validation across month boundaries -- Now uses `getTime()` instead of `getDate()` -- Accurate night calculation +- Gets user info from Auth0 +- Creates or updates user in database +- Assigns ROLE_TENANT to new users ---- +### DatabaseAuthoritiesFilter.java -## Support & Maintenance +Runs on every request: -### Getting Help +- Loads user's current roles from database +- Updates SecurityContext with fresh roles +- Enables instant role changes without re-login -- Check logs: `docker-compose logs backend` -- Review error messages -- Check this documentation -- Contact development team +### UserService.java -### Reporting Issues +User business logic: -- Include error message and stack trace -- Include steps to reproduce -- Include environment details -- Include logs if available +- `syncWithIdp()` - Syncs Auth0 user to DB +- `getAuthenticatedUserFromSecurityContext()` - Gets current user +- `assignRoleLandlord()` - Adds ROLE_LANDLORD --- -**Status:** βœ… Production Ready -**Last Updated:** January 30, 2026 -**Version:** 1.0 +## Summary + +**Authentication:** Auth0 (who you are) +**Authorization:** Database (what you can do) +**Security:** CSRF tokens + CORS +**Key Feature:** DatabaseAuthoritiesFilter loads roles on every request = instant role updates + +Simple, secure, and maintainable! diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index fbcb819..0000000 --- a/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM eclipse-temurin:17-jre-alpine -WORKDIR /app -COPY target/*.jar app.jar -EXPOSE 8080 -ENTRYPOINT ["java", "-jar", "app.jar"] \ No newline at end of file diff --git a/README.md b/README.md index 2e82505..5d47a59 100644 --- a/README.md +++ b/README.md @@ -1,202 +1,56 @@ -# NBAT Backend - Setup & Quick Start +# NBAT Clone Backend -Backend API for NBAT rental platform built with Spring Boot 3.2.4 and PostgreSQL. +## Quick Start for Teammates -## Prerequisites +### Prerequisites -- **Java 21** or higher -- **Maven 3.8+** -- **PostgreSQL 14+** -- **Docker & Docker Compose** (for containerized setup) +- Java 21 +- Docker Desktop +- Maven (or use `./mvnw`) -## Quick Setup +### Setup (First Time) -### 1. Database Setup - -**With Docker:** - -```bash -docker-compose up -d postgres -``` - -**Manual PostgreSQL:** - -```sql -CREATE DATABASE nbat; -CREATE USER nbat_user WITH PASSWORD 'nbat_password'; -GRANT ALL PRIVILEGES ON DATABASE nbat TO nbat_user; -``` - -### 2. Configure Application - -Backend uses environment variables from `.env` file. The `.env` file is already set up with default values that match the Docker PostgreSQL container. - -**No additional configuration needed!** The defaults work out of the box. - -**Optional:** If you need to override values, edit `src/main/resources/application.yml`: - -```yaml -spring: - datasource: - url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/nbat_db} - username: ${SPRING_DATASOURCE_USERNAME:postgres} - password: ${SPRING_DATASOURCE_PASSWORD:0000} - -okta: - oauth2: - issuer: ${AUTH0_DOMAIN:https://dev-1m8rc8rkauzkk7c6.us.auth0.com/} - client-id: ${AUTH0_CLIENT_ID:WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg} - client-secret: ${AUTH0_CLIENT_SECRET:Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw} -``` - -### 3. Build Application - -```bash -# Windows -mvnw.cmd clean install - -# Linux/Mac -./mvnw clean install -``` - -### 4. Run Application - -**Development:** - -```bash -# Windows -mvnw.cmd spring-boot:run - -# Linux/Mac -./mvnw spring-boot:run -``` - -**Docker:** - -```bash -docker-compose up -d -``` - -Application runs on `http://localhost:8080/api` - -## Verify Setup - -**Health Check:** - -```bash -curl http://localhost:8080/api/health -``` - -**All Endpoints:** +1. **Clone the repo** ```bash -curl http://localhost:8080/api/listings/all -curl http://localhost:8080/api/user/me + git clone + cd Nbat-project-backend ``` -## Testing - -All backend tests are automated and passing: +2. **Set up environment variables** ```bash -./mvnw test + cp .env.example .env ``` -**Test Results:** - -- βœ… BookingServiceTest: 4/4 PASS -- βœ… SecurityUtilsTest: 2/2 PASS -- βœ… TenantServiceTest: 3/3 PASS -- βœ… UserServiceTest: 4/4 PASS -- βœ… NbatCloneBackApplicationIntegrationTest: 2/2 PASS +3. **Edit `.env` and fill in YOUR Auth0 credentials** + - Go to https://manage.auth0.com/dashboard/us/dev-1m8rc8rkauzkk7c6/applications + - Copy your client ID and secret + - Paste into `.env` -**Total:** 15/15 tests passing (100% success rate) - -## Configuration - -### Environment Variables +4. **Start PostgreSQL** ```bash -# Database -SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/nbat -SPRING_DATASOURCE_USERNAME=nbat_user -SPRING_DATASOURCE_PASSWORD=nbat_password - -# OAuth2 (Auth0) -OAUTH2_CLIENT_ID=your_client_id -OAUTH2_CLIENT_SECRET=your_client_secret -OAUTH2_ISSUER=https://your-domain.auth0.com/ - -# CORS -CORS_ALLOWED_ORIGINS=http://localhost:4200,http://localhost:3000 + docker-compose up -d ``` -### Profiles - -- **dev:** Development with debug logging -- **prod:** Production with optimized settings - -Run with profile: +5. **Run the application** ```bash -mvnw spring-boot:run -Dspring-boot.run.arguments="--spring.profiles.active=dev" + ./mvnw spring-boot:run ``` -## Project Structure - -``` -src/main/java/fr/codecake/nbat/ -β”œβ”€β”€ infrastructure/ # Config, security, filters -β”œβ”€β”€ domain/ # Business logic, entities -β”œβ”€β”€ persistence/ # Repositories -β”œβ”€β”€ presentation/ # Controllers, DTOs -└── common/ # Utilities -``` - -## Building & Deployment - -### Build JAR - -```bash -mvnw clean package -``` - -JAR file: `target/nbat-backend.jar` - -### Run JAR - -```bash -java -jar target/nbat-backend.jar -``` - -### Docker Build - -```bash -docker build -t nbat-backend:1.0 . -docker run -d -p 8080:8080 nbat-backend:1.0 -``` - -## Troubleshooting - -**Connection Refused** - -- Check PostgreSQL is running: `docker-compose ps` -- Verify database credentials - -**OAuth2 Errors** - -- Verify Auth0 credentials in application.yml -- Check firewall ports - -**Migration Errors** - -- Drop and recreate database -- Ensure PostgreSQL user has permissions +6. **Verify it works** + - Backend: http://localhost:8080 + - Database: localhost:5432 -## Full Documentation +### Common Issues -For detailed API endpoints, authentication flow, database schema, and development guide, see **BACKEND_DOCUMENTATION.md** +**"Auth0 credentials not found"** +β†’ Make sure you copied `.env.example` to `.env` and filled in values -## Status +**"Database connection failed"** +β†’ Make sure Docker is running: `docker-compose ps` -βœ… Production Ready - January 30, 2026 +**"Port 8080 already in use"** +β†’ Change `SERVER_PORT=8081` in your `.env` diff --git a/docker-compose.override.yml b/docker-compose.override.yml deleted file mode 100644 index 7295266..0000000 --- a/docker-compose.override.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is automatically loaded by docker-compose if it exists -# It allows developers to override settings without modifying docker-compose.yml -# This file is optional and NOT committed to git - -version: '3.8' - -services: - postgres: - environment: - # These can be overridden per developer if needed - # Default values come from docker-compose.yml - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-0000} - POSTGRES_USER: ${POSTGRES_USER:-postgres} - POSTGRES_DB: ${POSTGRES_DB:-nbat_db} - ports: - - "${POSTGRES_PORT:-5432}:5432" diff --git a/docker-compose.yml b/docker-compose.yml index 2b1c98a..f98b1d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,21 @@ -version: '3.8' - services: postgres: - image: 'postgres:latest' + image: postgres:16 + container_name: nbat-postgres environment: - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-0000} - - POSTGRES_USER=${POSTGRES_USER:-postgres} - - POSTGRES_DB=${POSTGRES_DB:-nbat_db} + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 0000 + POSTGRES_DB: nbat_db ports: - - "${POSTGRES_PORT:-5432}:5432" + - "5432:5432" volumes: - ./init.sql:/docker-entrypoint-initdb.d/init.sql healthcheck: - test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"] + test: ["CMD-SHELL", "pg_isready -U postgres -d nbat_db"] interval: 10s timeout: 5s - retries: 5 \ No newline at end of file + retries: 5 + +volumes: + postgres_data: + driver: local \ No newline at end of file diff --git a/init.sql b/init.sql index 8914282..2088a22 100644 --- a/init.sql +++ b/init.sql @@ -1,2 +1,8 @@ --- Initialize empty schema for NBAT (tables created by Hibernate on first run) -CREATE SCHEMA IF NOT EXISTS nbat_schema; \ No newline at end of file +-- Create the nbat_schema if it doesn't exist +CREATE SCHEMA IF NOT EXISTS nbat_schema; + +-- Grant all privileges on the schema to the postgres user +GRANT ALL ON SCHEMA nbat_schema TO postgres; + +-- Set the search path so the schema is used by default +ALTER DATABASE nbat_db SET search_path TO nbat_schema, public; \ No newline at end of file diff --git a/src/main/java/fr/codecake/nbat/booking/application/BookingService.java b/src/main/java/fr/codecake/nbat/booking/application/BookingService.java index 778522f..58d17dc 100644 --- a/src/main/java/fr/codecake/nbat/booking/application/BookingService.java +++ b/src/main/java/fr/codecake/nbat/booking/application/BookingService.java @@ -31,7 +31,7 @@ public class BookingService { private final LandlordService landlordService; public BookingService(BookingRepository bookingRepository, BookingMapper bookingMapper, - UserService userService, LandlordService landlordService) { + UserService userService, LandlordService landlordService) { this.bookingRepository = bookingRepository; this.bookingMapper = bookingMapper; this.userService = userService; @@ -42,13 +42,15 @@ public BookingService(BookingRepository bookingRepository, BookingMapper booking public State create(NewBookingDTO newBookingDTO) { Booking booking = bookingMapper.newBookingToBooking(newBookingDTO); - Optional listingOpt = landlordService.getByListingPublicId(newBookingDTO.listingPublicId()); + Optional listingOpt = landlordService + .getByListingPublicId(newBookingDTO.listingPublicId()); if (listingOpt.isEmpty()) { return State.builder().forError("Landlord public id not found"); } - boolean alreadyBooked = bookingRepository.bookingExistsAtInterval(newBookingDTO.startDate(), newBookingDTO.endDate(), newBookingDTO.listingPublicId()); + boolean alreadyBooked = bookingRepository.bookingExistsAtInterval(newBookingDTO.startDate(), + newBookingDTO.endDate(), newBookingDTO.listingPublicId()); if (alreadyBooked) { return State.builder().forError("One booking already exists"); @@ -58,7 +60,7 @@ public State create(NewBookingDTO newBookingDTO) { booking.setFkListing(listingCreateBookingDTO.listingPublicId()); - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); booking.setFkTenant(connectedUser.publicId()); booking.setNumberOfTravelers(1); @@ -78,39 +80,47 @@ public List checkAvailability(UUID publicId) { @Transactional(readOnly = true) public List getBookedListing() { - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); List allBookings = bookingRepository.findAllByFkTenant(connectedUser.publicId()); List allListingPublicIDs = allBookings.stream().map(Booking::getFkListing).toList(); List allListings = landlordService.getCardDisplayByListingPublicId(allListingPublicIDs); return mapBookingToBookedListing(allBookings, allListings); } - private List mapBookingToBookedListing(List allBookings, List allListings) { - return allBookings.stream().map(booking -> { - DisplayCardListingDTO displayCardListingDTO = allListings - .stream() - .filter(listing -> listing.publicId().equals(booking.getFkListing())) - .findFirst() - .orElseThrow(); - BookedDateDTO dates = bookingMapper.bookingToCheckAvailability(booking); - return new BookedListingDTO(displayCardListingDTO.cover(), - displayCardListingDTO.location(), - dates, new PriceVO(booking.getTotalPrice()), - booking.getPublicId(), displayCardListingDTO.publicId()); - }).toList(); + private List mapBookingToBookedListing(List allBookings, + List allListings) { + return allBookings.stream() + .map(booking -> { + // Try to find the listing for this booking + Optional listingOpt = allListings + .stream() + .filter(listing -> listing.publicId().equals(booking.getFkListing())) + .findFirst(); + + // If listing doesn't exist (maybe it was deleted), skip this booking + if (listingOpt.isEmpty()) { + return null; + } + + DisplayCardListingDTO displayCardListingDTO = listingOpt.get(); + BookedDateDTO dates = bookingMapper.bookingToCheckAvailability(booking); + return new BookedListingDTO(displayCardListingDTO.cover(), + displayCardListingDTO.location(), + dates, new PriceVO(booking.getTotalPrice()), + booking.getPublicId(), displayCardListingDTO.publicId()); + }) + .filter(bookedListing -> bookedListing != null) // Remove any null entries + .toList(); } + // Service @Transactional - public State cancel(UUID bookingPublicId, UUID listingPublicId, boolean byLandlord) { - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); - int deleteSuccess = 0; + public State cancel(UUID bookingPublicId) { + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); - if (SecurityUtils.hasCurrentUserAnyOfAuthorities(SecurityUtils.ROLE_LANDLORD) - && byLandlord) { - deleteSuccess = handleDeletionForLandlord(bookingPublicId, listingPublicId, connectedUser, deleteSuccess); - } else { - deleteSuccess = bookingRepository.deleteBookingByFkTenantAndPublicId(connectedUser.publicId(), bookingPublicId); - } + int deleteSuccess = bookingRepository.deleteBookingByFkTenantAndPublicId( + connectedUser.publicId(), + bookingPublicId); if (deleteSuccess >= 1) { return State.builder().forSuccess(bookingPublicId); @@ -119,17 +129,20 @@ public State cancel(UUID bookingPublicId, UUID listingPublicId, bo } } - private int handleDeletionForLandlord(UUID bookingPublicId, UUID listingPublicId, ReadUserDTO connectedUser, int deleteSuccess) { - Optional listingVerificationOpt = landlordService.getByPublicIdAndLandlordPublicId(listingPublicId, connectedUser.publicId()); + private int handleDeletionForLandlord(UUID bookingPublicId, UUID listingPublicId, ReadUserDTO connectedUser, + int deleteSuccess) { + Optional listingVerificationOpt = landlordService + .getByPublicIdAndLandlordPublicId(listingPublicId, connectedUser.publicId()); if (listingVerificationOpt.isPresent()) { - deleteSuccess = bookingRepository.deleteBookingByPublicIdAndFkListing(bookingPublicId, listingVerificationOpt.get().publicId()); + deleteSuccess = bookingRepository.deleteBookingByPublicIdAndFkListing(bookingPublicId, + listingVerificationOpt.get().publicId()); } return deleteSuccess; } @Transactional(readOnly = true) public List getBookedListingForLandlord() { - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); List allProperties = landlordService.getAllProperties(connectedUser); List allPropertyPublicIds = allProperties.stream().map(DisplayCardListingDTO::publicId).toList(); List allBookings = bookingRepository.findAllByFkListingIn(allPropertyPublicIds); diff --git a/src/main/java/fr/codecake/nbat/booking/presentation/BookingResource.java b/src/main/java/fr/codecake/nbat/booking/presentation/BookingResource.java index 11b5496..9ed258d 100644 --- a/src/main/java/fr/codecake/nbat/booking/presentation/BookingResource.java +++ b/src/main/java/fr/codecake/nbat/booking/presentation/BookingResource.java @@ -59,13 +59,12 @@ public ResponseEntity> getBookedListing() { } @DeleteMapping("cancel") - public ResponseEntity cancel(@RequestParam UUID bookingPublicId, - @RequestParam UUID listingPublicId, - @RequestParam boolean byLandlord) { - State cancelState = bookingService.cancel(bookingPublicId, listingPublicId, byLandlord); + @PreAuthorize("hasRole('ROLE_TENANT')") + public ResponseEntity cancel(@RequestParam UUID bookingPublicId) { + State cancelState = bookingService.cancel(bookingPublicId); if (cancelState.getStatus().equals(StatusNotification.ERROR)) { ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, - "cancelState.getError()"); + cancelState.getError()); return ResponseEntity.of(problemDetail).build(); } else { return ResponseEntity.ok(bookingPublicId); @@ -73,7 +72,7 @@ public ResponseEntity cancel(@RequestParam UUID bookingPublicId, } @GetMapping("get-booked-listing-for-landlord") - @PreAuthorize("hasAnyRole('" + SecurityUtils.ROLE_LANDLORD + "')") + @PreAuthorize("hasRole('ROLE_LANDLORD')") public ResponseEntity> getBookedListingForLandlord() { return ResponseEntity.ok(bookingService.getBookedListingForLandlord()); } diff --git a/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseAuthoritiesFilter.java b/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseAuthoritiesFilter.java index 7d00b8f..23afaa6 100644 --- a/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseAuthoritiesFilter.java +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/DatabaseAuthoritiesFilter.java @@ -36,13 +36,19 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse throws ServletException, IOException { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); + System.out.println( + "πŸ” DatabaseAuthoritiesFilter - Request: " + request.getMethod() + " " + request.getRequestURI()); + System.out.println("πŸ” Auth before filter: " + (auth != null ? auth.getAuthorities() : "null")); + // Only process authenticated requests with OAuth2 principal if (auth != null && auth.isAuthenticated() && auth.getPrincipal() instanceof OAuth2User oAuth2User) { try { // Get user's current roles from database - ReadUserDTO userFromDb = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO userFromDb = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); if (userFromDb != null && userFromDb.authorities() != null) { + System.out.println("πŸ” Authorities from DB: " + userFromDb.authorities()); + // Convert authorities from DB to GrantedAuthority Collection dbAuthorities = userFromDb.authorities() .stream() @@ -55,13 +61,16 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse // Update the security context with the new authentication SecurityContextHolder.getContext().setAuthentication(updatedAuth); + + System.out.println("βœ… Auth after filter: " + updatedAuth.getAuthorities()); } } catch (Exception e) { // Log but don't fail - continue with original authentication System.err.println("⚠️ Failed to reload authorities from database: " + e.getMessage()); + e.printStackTrace(); } } filterChain.doFilter(request, response); } -} +} \ No newline at end of file diff --git a/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2LoginSuccessHandler.java b/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2LoginSuccessHandler.java index 718ca62..7553770 100644 --- a/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2LoginSuccessHandler.java +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/OAuth2LoginSuccessHandler.java @@ -33,7 +33,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo // Sync with IdP (creates new user with ROLE_TENANT or updates existing user) System.out.println("πŸ”„ Starting syncWithIdp..."); - userService.syncWithIdp(oAuth2User, false); + userService.syncWithIdp(oAuth2User); System.out.println("βœ… User synced successfully"); diff --git a/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityConfiguration.java b/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityConfiguration.java index 6c26731..5291b09 100644 --- a/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityConfiguration.java +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityConfiguration.java @@ -25,89 +25,85 @@ @EnableMethodSecurity public class SecurityConfiguration { - private final ClientRegistrationRepository clientRegistrationRepository; - private final OAuth2LoginSuccessHandler oAuth2LoginSuccessHandler; - private final UserService userService; + private final ClientRegistrationRepository clientRegistrationRepository; + private final OAuth2LoginSuccessHandler oAuth2LoginSuccessHandler; + private final UserService userService; - public SecurityConfiguration(ClientRegistrationRepository clientRegistrationRepository, - OAuth2LoginSuccessHandler oAuth2LoginSuccessHandler, - UserService userService) { - this.clientRegistrationRepository = clientRegistrationRepository; - this.oAuth2LoginSuccessHandler = oAuth2LoginSuccessHandler; - this.userService = userService; - } + public SecurityConfiguration(ClientRegistrationRepository clientRegistrationRepository, + OAuth2LoginSuccessHandler oAuth2LoginSuccessHandler, + UserService userService) { + this.clientRegistrationRepository = clientRegistrationRepository; + this.oAuth2LoginSuccessHandler = oAuth2LoginSuccessHandler; + this.userService = userService; + } - @Bean - public SecurityFilterChain configure(HttpSecurity http) throws Exception { - CsrfTokenRequestAttributeHandler requestHandler = new CsrfTokenRequestAttributeHandler(); - requestHandler.setCsrfRequestAttributeName(null); - http.cors(cors -> cors.configurationSource(corsConfigurationSource())) - .authorizeHttpRequests(authorize -> authorize - .requestMatchers(HttpMethod.GET, "/api/auth/get-authenticated-user").permitAll() - .requestMatchers(HttpMethod.POST, "/api/auth/logout").permitAll() - .requestMatchers(HttpMethod.POST, "/api/auth/assign-landlord-role").permitAll() - .requestMatchers(HttpMethod.GET, "/api/tenant-listing/get-all-by-category").permitAll() - .requestMatchers(HttpMethod.GET, "/api/tenant-listing/get-one").permitAll() - .requestMatchers(HttpMethod.POST, "/api/tenant-listing/search").permitAll() - .requestMatchers(HttpMethod.GET, "/api/booking/check-availability").permitAll() - .requestMatchers(HttpMethod.POST, "/api/booking/create").authenticated() - .requestMatchers(HttpMethod.GET, "/api/booking/get-booked-listing").authenticated() - .requestMatchers(HttpMethod.GET, "/api/booking/get-booked-listing-for-landlord").authenticated() - .requestMatchers(HttpMethod.GET, "/api/landlord-listing/get-all").authenticated() - .requestMatchers(HttpMethod.GET, "/api/landlord-listing/get-one").authenticated() - .requestMatchers("/assets/**").permitAll() - .anyRequest() - .authenticated()) - .csrf(csrf -> csrf - .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) - .csrfTokenRequestHandler(requestHandler) - .ignoringRequestMatchers( - "/api/auth/logout", - "/api/auth/assign-landlord-role", - "/api/tenant-listing/search")) - .oauth2Login(oauth2 -> oauth2 - .authorizationEndpoint(authorization -> authorization - .authorizationRequestResolver( - new CustomAuthorizationRequestResolver(clientRegistrationRepository))) - .successHandler(oAuth2LoginSuccessHandler)) - .oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())) - .oauth2Client(Customizer.withDefaults()) - .sessionManagement(session -> session - .sessionCreationPolicy(org.springframework.security.config.http.SessionCreationPolicy.ALWAYS)) - .addFilterAfter(new DatabaseAuthoritiesFilter(userService), - org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter.class); + @Bean + public SecurityFilterChain configure(HttpSecurity http) throws Exception { + CsrfTokenRequestAttributeHandler requestHandler = new CsrfTokenRequestAttributeHandler(); + requestHandler.setCsrfRequestAttributeName(null); + http.cors(cors -> cors.configurationSource(corsConfigurationSource())) + .authorizeHttpRequests(authorize -> authorize + .requestMatchers(HttpMethod.GET, "/api/auth/get-authenticated-user") + .permitAll() + .requestMatchers(HttpMethod.POST, "/api/auth/logout").permitAll() + .requestMatchers(HttpMethod.POST, "/api/auth/assign-landlord-role") + .permitAll() + .requestMatchers(HttpMethod.GET, + "/api/tenant-listing/get-all-by-category") + .permitAll() + .requestMatchers(HttpMethod.GET, "/api/tenant-listing/get-one") + .permitAll() + .requestMatchers(HttpMethod.POST, "/api/tenant-listing/search") + .permitAll() + .requestMatchers(HttpMethod.GET, "/api/booking/check-availability") + .permitAll() + .requestMatchers(HttpMethod.POST, "/api/booking/create").authenticated() + .requestMatchers(HttpMethod.GET, "/api/booking/get-booked-listing") + .authenticated() + .requestMatchers(HttpMethod.GET, + "/api/booking/get-booked-listing-for-landlord") + .authenticated() + .requestMatchers("/api/landlord-listing/**").authenticated() + .requestMatchers("/assets/**").permitAll() + .anyRequest() + .authenticated()) + .csrf(csrf -> csrf + // create the CSRF token and store in a cookie with name: XSRF-TOKEN + .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) + .csrfTokenRequestHandler(requestHandler) + .ignoringRequestMatchers( + "/api/auth/logout", + "/api/auth/assign-landlord-role", + "/api/tenant-listing/search")) + .oauth2Login(oauth2 -> oauth2 + .authorizationEndpoint(authorization -> authorization + .authorizationRequestResolver( + new CustomAuthorizationRequestResolver( + clientRegistrationRepository))) + .successHandler(oAuth2LoginSuccessHandler)) + .oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())) + .oauth2Client(Customizer.withDefaults()) + .sessionManagement(session -> session + .sessionCreationPolicy( + org.springframework.security.config.http.SessionCreationPolicy.ALWAYS)) + .addFilterBefore(new DatabaseAuthoritiesFilter(userService), + org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter.class); - return http.build(); - } + return http.build(); + } - @Bean - public GrantedAuthoritiesMapper userAuthoritiesMapper() { - return authorities -> { - Set grantedAuthorities = new HashSet<>(); + @Bean + public CorsConfigurationSource corsConfigurationSource() { + CorsConfiguration configuration = new CorsConfiguration(); + configuration.setAllowedOrigins(java.util.List.of("http://localhost:4200", "http://localhost:4201")); + configuration.setAllowedMethods(java.util.List.of("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH")); + configuration.setAllowedHeaders(java.util.List.of("*")); + configuration.setExposedHeaders(java.util.List.of("Authorization", "X-Total-Count", "X-Page-Number")); + configuration.setAllowCredentials(true); + configuration.setMaxAge(3600L); - authorities.forEach(grantedAuthority -> { - if (grantedAuthority instanceof OidcUserAuthority oidcUserAuthority) { - grantedAuthorities - .addAll(SecurityUtils - .extractAuthorityFromClaims(oidcUserAuthority.getUserInfo().getClaims())); - } - }); - return grantedAuthorities; - }; - } - - @Bean - public CorsConfigurationSource corsConfigurationSource() { - CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(java.util.List.of("http://localhost:4200", "http://localhost:4201")); - configuration.setAllowedMethods(java.util.List.of("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH")); - configuration.setAllowedHeaders(java.util.List.of("*")); - configuration.setExposedHeaders(java.util.List.of("Authorization", "X-Total-Count", "X-Page-Number")); - configuration.setAllowCredentials(true); - configuration.setMaxAge(3600L); - - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - source.registerCorsConfiguration("/**", configuration); - return source; - } + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", configuration); + return source; + } } diff --git a/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityUtils.java b/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityUtils.java index 1abd20e..3a461db 100644 --- a/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityUtils.java +++ b/src/main/java/fr/codecake/nbat/infrastructure/config/SecurityUtils.java @@ -1,102 +1,8 @@ package fr.codecake.nbat.infrastructure.config; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.springframework.security.core.Authentication; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; - -import fr.codecake.nbat.user.domain.Authority; -import fr.codecake.nbat.user.domain.User; - public class SecurityUtils { - public static final String ROLE_TENANT = "ROLE_TENANT"; - public static final String ROLE_LANDLORD = "ROLE_LANDLORD"; - - public static final String CLAIMS_NAMESPACE = "https://www.codecake.fr/roles"; - - @SuppressWarnings("unchecked") - public static User mapOauth2AttributesToUser(Map attributes) { - User user = new User(); - String sub = String.valueOf(attributes.get("sub")); - - String username = null; - - if (attributes.get("preferred_username") != null) { - username = ((String) attributes.get("preferred_username")).toLowerCase(); - } - - if (attributes.get("given_name") != null) { - user.setFirstName(((String) attributes.get("given_name"))); - } else if ((attributes.get("nickname") != null)) { - user.setFirstName(((String) attributes.get("nickname"))); - } - - if (attributes.get("family_name") != null) { - user.setLastName(((String) attributes.get("family_name"))); - } - - if (attributes.get("email") != null) { - user.setEmail(((String) attributes.get("email"))); - } else if (sub.contains("|") && (username != null && username.contains("@"))) { - user.setEmail(username); - } else { - user.setEmail(sub); - } - - if (attributes.get("picture") != null) { - user.setImageUrl(((String) attributes.get("picture"))); - } - - if (attributes.get(CLAIMS_NAMESPACE) != null) { - List authoritiesRaw = (List) attributes.get(CLAIMS_NAMESPACE); - Set authorities = authoritiesRaw.stream() - .map(authority -> { - Authority auth = new Authority(); - auth.setName(authority); - return auth; - }).collect(Collectors.toSet()); - user.setAuthorities(authorities); - } - return user; - } - - public static List extractAuthorityFromClaims(Map claims) { - return mapRolesToGrantedAuthorities(getRolesFromClaims(claims)); - } - - @SuppressWarnings("unchecked") - private static Collection getRolesFromClaims(Map claims) { - return (List) claims.get(CLAIMS_NAMESPACE); - } - - private static List mapRolesToGrantedAuthorities(Collection roles) { - if (roles == null || roles.isEmpty()) { - return List.of(new SimpleGrantedAuthority("ROLE_TENANT")); // RΓ΄le par dΓ©faut - } - return roles.stream().filter(role -> role.startsWith("ROLE_")).map(SimpleGrantedAuthority::new).toList(); - } - - public static boolean hasCurrentUserAnyOfAuthorities(String... authorities) { - Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - return (authentication != null && getAuthorities(authentication) - .anyMatch(authority -> Arrays.asList(authorities).contains(authority))); - } + public static String ROLE_TENANT = "ROLE_TENANT"; + public static String ROLE_LANDLORD = "ROLE_LANDLORD"; - private static Stream getAuthorities(Authentication authentication) { - Collection authorities = authentication instanceof JwtAuthenticationToken jwtAuthenticationToken - && jwtAuthenticationToken.getToken() != null - ? extractAuthorityFromClaims(jwtAuthenticationToken.getToken().getClaims()) - : authentication.getAuthorities(); - return authorities.stream().map(GrantedAuthority::getAuthority); - } } diff --git a/src/main/java/fr/codecake/nbat/listing/application/LandlordService.java b/src/main/java/fr/codecake/nbat/listing/application/LandlordService.java index 85bffd3..a95c9d7 100644 --- a/src/main/java/fr/codecake/nbat/listing/application/LandlordService.java +++ b/src/main/java/fr/codecake/nbat/listing/application/LandlordService.java @@ -40,16 +40,14 @@ public LandlordService(ListingRepository listingRepository, ListingMapper listin public CreatedListingDTO create(SaveListingDTO saveListingDTO) { Listing newListing = listingMapper.saveListingDTOToListing(saveListingDTO); - ReadUserDTO userConnected = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO userConnected = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); newListing.setLandlordPublicId(userConnected.publicId()); Listing savedListing = listingRepository.saveAndFlush(newListing); pictureService.saveAll(saveListingDTO.getPictures(), savedListing); - // Get auth0UserId from OAuth2 context - String auth0UserId = userConnected.publicId().toString(); // or get from OAuth2User attributes - auth0Service.addLandlordRoleToUser(userConnected, auth0UserId); + auth0Service.addLandlordRoleToUser(userConnected); return listingMapper.listingToCreatedListingDTO(savedListing); } diff --git a/src/main/java/fr/codecake/nbat/listing/presentation/LandlordResource.java b/src/main/java/fr/codecake/nbat/listing/presentation/LandlordResource.java index 05f1321..943bf75 100644 --- a/src/main/java/fr/codecake/nbat/listing/presentation/LandlordResource.java +++ b/src/main/java/fr/codecake/nbat/listing/presentation/LandlordResource.java @@ -50,6 +50,7 @@ public LandlordResource(LandlordService landlordService, Validator validator, Us } @PostMapping(value = "/create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @PreAuthorize("hasRole('ROLE_LANDLORD')") public ResponseEntity create( MultipartHttpServletRequest request, @RequestPart(name = "dto") String saveListingDTOString) throws IOException { @@ -89,22 +90,22 @@ private static Function mapMultipartFileToPictureDTO( } @GetMapping(value = "/get-all") - @PreAuthorize("hasAnyRole('" + SecurityUtils.ROLE_LANDLORD + "')") + @PreAuthorize("hasRole('ROLE_LANDLORD')") public ResponseEntity> getAll() { - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); List allProperties = landlordService.getAllProperties(connectedUser); return ResponseEntity.ok(allProperties); } @GetMapping(value = "/get-one") - @PreAuthorize("hasAnyRole('" + SecurityUtils.ROLE_LANDLORD + "')") + @PreAuthorize("hasRole('ROLE_LANDLORD')") public ResponseEntity getOne(@RequestParam UUID publicId) { - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); return ResponseEntity.ok(landlordService.getOne(publicId, connectedUser)); } @PutMapping(value = "/update", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - @PreAuthorize("hasAnyRole('" + SecurityUtils.ROLE_LANDLORD + "')") + @PreAuthorize("hasRole('ROLE_LANDLORD')") public ResponseEntity update( MultipartHttpServletRequest request, @RequestParam UUID publicId, @@ -131,15 +132,15 @@ public ResponseEntity update( ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, violationsJoined); return ResponseEntity.of(problemDetail).build(); } else { - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); return ResponseEntity.ok(landlordService.update(publicId, saveListingDTO, connectedUser)); } } @DeleteMapping("/delete") - @PreAuthorize("hasAnyRole('" + SecurityUtils.ROLE_LANDLORD + "')") + @PreAuthorize("hasRole('ROLE_LANDLORD')") public ResponseEntity delete(@RequestParam UUID publicId) { - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); State deleteState = landlordService.delete(publicId, connectedUser); if (deleteState.getStatus().equals(StatusNotification.OK)) { return ResponseEntity.ok(deleteState.getValue()); diff --git a/src/main/java/fr/codecake/nbat/user/application/Auth0Service.java b/src/main/java/fr/codecake/nbat/user/application/Auth0Service.java index 0a32d67..6efaddf 100644 --- a/src/main/java/fr/codecake/nbat/user/application/Auth0Service.java +++ b/src/main/java/fr/codecake/nbat/user/application/Auth0Service.java @@ -1,49 +1,17 @@ package fr.codecake.nbat.user.application; -import com.auth0.client.auth.AuthAPI; -import com.auth0.client.mgmt.ManagementAPI; -import com.auth0.exception.APIException; -import com.auth0.exception.Auth0Exception; -import com.auth0.json.auth.TokenHolder; -import com.auth0.net.TokenRequest; import fr.codecake.nbat.infrastructure.config.SecurityUtils; import fr.codecake.nbat.user.application.dto.ReadUserDTO; import fr.codecake.nbat.user.domain.Authority; import fr.codecake.nbat.user.domain.User; import fr.codecake.nbat.user.repository.AuthorityRepository; import fr.codecake.nbat.user.repository.UserRepository; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - @Service public class Auth0Service { - @Value("${okta.oauth2.client-id}") - private String clientId; - - @Value("${okta.oauth2.client-secret}") - private String clientSecret; - - @Value("${okta.oauth2.issuer}") - private String domain; - - @Value("${application.auth0.management-client-id}") - private String managementClientId; - - @Value("${application.auth0.management-client-secret}") - private String managementClientSecret; - - @Value("${application.auth0.role-landlord-id}") - private String roleLandlordId; - - @Value("${application.auth0.role-tenant-id}") - private String roleTenantId; - private final UserRepository userRepository; private final AuthorityRepository authorityRepository; @@ -53,80 +21,28 @@ public Auth0Service(UserRepository userRepository, AuthorityRepository authority } @Transactional - public void addLandlordRoleToUser(ReadUserDTO readUserDTO, String auth0UserId) { + public void addLandlordRoleToUser(ReadUserDTO readUserDTO) { if (readUserDTO.authorities().stream().noneMatch(role -> role.equals(SecurityUtils.ROLE_LANDLORD))) { - try { - // 1. Assign ROLE_LANDLORD to Auth0 - System.out.println("πŸ“‘ Assigning ROLE_LANDLORD to Auth0 for: " + auth0UserId); - String accessToken = this.getAccessToken(); - assignRoleById(accessToken, auth0UserId, roleLandlordId); - - // 2. Also save ROLE_LANDLORD to database - System.out.println("πŸ’Ύ Saving ROLE_LANDLORD to database for: " + readUserDTO.publicId()); - User user = userRepository.findOneByPublicId(readUserDTO.publicId()) - .orElseThrow(() -> new UserException("User not found: " + readUserDTO.publicId())); - - Authority landlordAuthority = authorityRepository.findByName(SecurityUtils.ROLE_LANDLORD) - .orElseGet(() -> { - System.out.println("⚠️ ROLE_LANDLORD not found in DB, creating it..."); - Authority auth = new Authority(); - auth.setName(SecurityUtils.ROLE_LANDLORD); - return authorityRepository.save(auth); - }); - - // Add ROLE_LANDLORD while keeping existing roles - System.out.println("πŸ“‹ Current roles before adding: " + user.getAuthorities()); - - // Create new Set to ensure all existing roles are preserved - Set authorities = new HashSet<>(user.getAuthorities()); - authorities.add(landlordAuthority); - user.setAuthorities(authorities); - - userRepository.saveAndFlush(user); - System.out.println("πŸ“‹ Current roles after adding: " + user.getAuthorities()); - System.out.println("βœ… ROLE_LANDLORD saved to database"); - - } catch (Auth0Exception a) { - throw new UserException( - String.format("not possible to assign %s to %s", roleLandlordId, readUserDTO.publicId())); - } - } - } - - public void assignTenantRole(String auth0UserId) { - try { - String accessToken = this.getAccessToken(); - String roleTenantId = "rol_Ur6hM5pvWc3q1yn9"; // Your ROLE_TENANT ID - assignRoleById(accessToken, auth0UserId, roleTenantId); - System.out.println("βœ… ROLE_TENANT assigned to: " + auth0UserId); - } catch (Auth0Exception e) { - System.err.println("❌ Failed to assign ROLE_TENANT: " + e.getMessage()); - throw new UserException("Failed to assign tenant role"); + // save ROLE_LANDLORD to database + System.out.println("πŸ’Ύ Saving ROLE_LANDLORD to database for: " + readUserDTO.publicId()); + User user = userRepository.findOneByPublicId(readUserDTO.publicId()) + .orElseThrow(() -> new UserException("User not found: " + readUserDTO.publicId())); + + // find landlord authority if it's not exists create it + Authority landlordAuthority = authorityRepository.findByName(SecurityUtils.ROLE_LANDLORD) + .orElseGet(() -> { + System.out.println("ROLE_LANDLORD not found in DB, creating it..."); + Authority auth = new Authority(); + auth.setName(SecurityUtils.ROLE_LANDLORD); + return authorityRepository.save(auth); + }); + + // Add ROLE_LANDLORD authority to the suer + user.getAuthorities().add(landlordAuthority); + + // Save to database + userRepository.saveAndFlush(user); + System.out.println("βœ… ROLE_LANDLORD saved to database"); } } - - private void assignRoleById(String accessToken, String auth0UserId, String roleIdToAdd) { - try { - System.out.println("πŸ”— Connecting to Auth0 Management API..."); - ManagementAPI mgmt = ManagementAPI.newBuilder(domain, accessToken).build(); - System.out.println("πŸ“€ Assigning role " + roleIdToAdd + " to user " + auth0UserId); - mgmt.roles().assignUsers(roleIdToAdd, List.of(auth0UserId)).execute(); - System.out.println("βœ… Role assigned successfully in Auth0"); - } catch (APIException e) { - System.err.println("❌ Auth0 API Error: " + e.getMessage()); - System.err.println("❌ Status: " + e.getStatusCode()); - throw new UserException("Auth0 API failed: " + e.getMessage()); - } catch (Auth0Exception e) { - System.err.println("❌ Auth0 Exception: " + e.getMessage()); - throw new UserException("Failed to connect to Auth0: " + e.getMessage()); - } - } - - private String getAccessToken() throws Auth0Exception { - AuthAPI authAPI = AuthAPI.newBuilder(domain, managementClientId, managementClientSecret).build(); - TokenRequest tokenRequest = authAPI.requestToken(domain + "api/v2/"); - TokenHolder holder = tokenRequest.execute().getBody(); - return holder.getAccessToken(); - } - } diff --git a/src/main/java/fr/codecake/nbat/user/application/UserService.java b/src/main/java/fr/codecake/nbat/user/application/UserService.java index 81977da..e39a671 100644 --- a/src/main/java/fr/codecake/nbat/user/application/UserService.java +++ b/src/main/java/fr/codecake/nbat/user/application/UserService.java @@ -14,7 +14,6 @@ import java.time.Instant; import java.util.*; -import java.util.stream.Collectors; @Service public class UserService { @@ -22,7 +21,6 @@ public class UserService { private static final String UPDATED_AT_KEY = "updated_at"; private final UserRepository userRepository; private final AuthorityRepository authorityRepository; - private final Auth0Service auth0Service; private final UserMapper userMapper; public UserService(UserRepository userRepository, @@ -31,14 +29,21 @@ public UserService(UserRepository userRepository, UserMapper userMapper) { this.userRepository = userRepository; this.authorityRepository = authorityRepository; - this.auth0Service = auth0Service; this.userMapper = userMapper; } + /* + * Method to get the User from the database where his authorities are + * Using the email of the authenticated user + */ @Transactional(readOnly = true) - public ReadUserDTO getAuthenticatedUserFromSecurityContext() { + public ReadUserDTO getAuthenticatedUserFromDatabaseUsingSecurityContextEmail() { + + // get Authenticated user email from security context OAuth2User principal = (OAuth2User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = mapOauth2AttributesToUser(principal.getAttributes()); + + // user the email to get the user from the database return getByEmail(user.getEmail()).orElseThrow(); } @@ -49,51 +54,31 @@ public Optional getByEmail(String email) { } @Transactional - public void syncWithIdp(OAuth2User oAuth2User, boolean forceResync) { + public void syncWithIdp(OAuth2User oAuth2User) { // Remove forceResync param Map attributes = oAuth2User.getAttributes(); User user = mapOauth2AttributesToUser(attributes); - String auth0UserId = String.valueOf(attributes.get("sub")); - Optional existingUser = userRepository.findOneByEmail(user.getEmail()); if (existingUser.isPresent()) { - // User exists - update if needed - User currentUser = existingUser.orElseThrow(); + User currentUser = existingUser.get(); - // CHECK: If user has NO roles, assign default ROLE_TENANT + // Ensure user has default role if (currentUser.getAuthorities().isEmpty()) { - System.out.println("⚠️ User exists but has NO roles - assigning default ROLE_TENANT..."); - assignTenantRoleForNewUser(auth0UserId, currentUser); + assignTenantRoleForNewUser(currentUser); } - // Also update user info if it changed - if (attributes.get(UPDATED_AT_KEY) != null) { - Instant lastModifiedDate = currentUser.getLastModifiedDate(); - Instant idpModifiedDate; - if (attributes.get(UPDATED_AT_KEY) instanceof Instant instant) { - idpModifiedDate = instant; - } else { - idpModifiedDate = Instant.ofEpochSecond((Integer) attributes.get(UPDATED_AT_KEY)); - } - if (idpModifiedDate.isAfter(lastModifiedDate) || forceResync) { - updateUser(user); - } - } + // Update profile every login (simple!) + updateUser(user); } else { - // NEW USER - Backend assigns ROLE_TENANT - System.out.println("πŸ†• New user detected, assigning ROLE_TENANT..."); - assignTenantRoleForNewUser(auth0UserId, user); + // New user + assignTenantRoleForNewUser(user); } } @Transactional - private void assignTenantRoleForNewUser(String auth0UserId, User user) { + private void assignTenantRoleForNewUser(User user) { try { - // 1. Assign ROLE_TENANT to Auth0 - System.out.println("πŸ“‘ Assigning ROLE_TENANT to Auth0 for: " + auth0UserId); - auth0Service.assignTenantRole(auth0UserId); - - // 2. Get ROLE_TENANT from database (or create if doesn't exist) + // Get ROLE_TENANT from database (or create if doesn't exist) Authority tenantAuthority = authorityRepository.findByName(SecurityUtils.ROLE_TENANT) .orElseGet(() -> { System.out.println("⚠️ ROLE_TENANT not found in DB, creating it..."); @@ -102,7 +87,7 @@ private void assignTenantRoleForNewUser(String auth0UserId, User user) { return authorityRepository.save(auth); }); - // 3. Add role to user and save to database + // Add role to user and save to database user.getAuthorities().clear(); // Remove any existing roles user.getAuthorities().add(tenantAuthority); @@ -132,7 +117,6 @@ private void updateUser(User user) { userToUpdate.setEmail(user.getEmail()); userToUpdate.setFirstName(user.getFirstName()); userToUpdate.setLastName(user.getLastName()); - userToUpdate.setAuthorities(user.getAuthorities()); userToUpdate.setImageUrl(user.getImageUrl()); userRepository.saveAndFlush(userToUpdate); } @@ -174,21 +158,6 @@ private User mapOauth2AttributesToUser(Map attributes) { if (attributes.get("picture") != null) { user.setImageUrl(((String) attributes.get("picture"))); } - - if (attributes.get(SecurityUtils.CLAIMS_NAMESPACE) != null) { - List authoritiesRaw = (List) attributes.get(SecurityUtils.CLAIMS_NAMESPACE); - - // Look up authorities from database - Set authorities = authoritiesRaw.stream() - .map(authorityName -> authorityRepository.findByName(authorityName) - .orElseGet(() -> { - Authority newAuth = new Authority(); - newAuth.setName(authorityName); - return authorityRepository.save(newAuth); - })) - .collect(Collectors.toSet()); - user.setAuthorities(authorities); - } return user; } } diff --git a/src/main/java/fr/codecake/nbat/user/presentation/AuthResource.java b/src/main/java/fr/codecake/nbat/user/presentation/AuthResource.java index 0bde2aa..680e278 100644 --- a/src/main/java/fr/codecake/nbat/user/presentation/AuthResource.java +++ b/src/main/java/fr/codecake/nbat/user/presentation/AuthResource.java @@ -39,38 +39,31 @@ public AuthResource(UserService userService, ClientRegistrationRepository regist } @GetMapping("/get-authenticated-user") - public ResponseEntity getAuthenticatedUser( - @AuthenticationPrincipal OAuth2User user, @RequestParam boolean forceResync) { - if (user == null) { - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } else { - userService.syncWithIdp(user, forceResync); - ReadUserDTO connectedUser = userService.getAuthenticatedUserFromSecurityContext(); - return new ResponseEntity<>(connectedUser, HttpStatus.OK); - } + public ResponseEntity getAuthenticatedUser() { + ReadUserDTO connectedUser = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); + return new ResponseEntity<>(connectedUser, HttpStatus.OK); } @PostMapping("/assign-landlord-role") public ResponseEntity assignLandlordRole( @AuthenticationPrincipal OAuth2User user) { - String auth0UserId = user.getAttribute("sub"); - System.out.println(auth0UserId); - ReadUserDTO userDto = userService.getAuthenticatedUserFromSecurityContext(); + // get current user loged in from db + ReadUserDTO userDto = userService.getAuthenticatedUserFromDatabaseUsingSecurityContextEmail(); // Check if already has landlord role if (userDto.authorities().contains("ROLE_LANDLORD")) { - return ResponseEntity.badRequest().body("User already has landlord role"); + return ResponseEntity.badRequest().body(Map.of( + "message", "User already has landlord role")); } - // add landlord role via Auth0Service - auth0Service.addLandlordRoleToUser(userDto, auth0UserId); // updates Auth0's database AND our database - - // DON'T force resync here - it overwrites roles from the token which don't - // include the new role yet - // The next login will sync the updated roles from Auth0 + // add landlord role + auth0Service.addLandlordRoleToUser(userDto); - return ResponseEntity.ok("Landlord role assigned successfully"); + // return ok 200 + return ResponseEntity.ok().body(Map.of( + "message", "landlord role was assigned successfully", + "authorities", userDto.authorities())); } @PostMapping("/logout") diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml deleted file mode 100644 index 97947e2..0000000 --- a/src/main/resources/application-dev.yml +++ /dev/null @@ -1,2 +0,0 @@ -# This is the dev profile configuration -# Currently using default application.yml settings diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml deleted file mode 100644 index 494cee6..0000000 --- a/src/main/resources/application-prod.yml +++ /dev/null @@ -1,34 +0,0 @@ -# logging: -# level: -# ROOT: info -# '[org.hibernate.SQL]': INFO -# '[fr.codecake.nbatback]': INFO - -# spring: -# datasource: -# url: jdbc:postgresql://localhost:5432/airbnb_db -# username: codecake -# password: codecake -# jpa: -# properties: -# hibernate: -# '[default_schema]': public - -logging: - level: - ROOT: info - "[org.hibernate.SQL]": INFO - "[mr.imane.nbatcloneback]": INFO - -spring: - docker: - compose: - enabled: false - datasource: - url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/nbat_db} - username: ${SPRING_DATASOURCE_USERNAME:postgres} - password: ${SPRING_DATASOURCE_PASSWORD:0000} - jpa: - properties: - hibernate: - "[default_schema]": nbat_schema diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 5320dbf..ebfa06d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,47 +2,43 @@ logging: level: ROOT: INFO "[org.hibernate.SQL]": DEBUG - "[mr.imane.nbatcloneback]": DEBUG + "[fr.codecake.nbat]": DEBUG spring: application: name: nbat-clone-back + + docker: + compose: + enabled: true + lifecycle-management: start_only + datasource: - url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/nbat_db} - username: ${SPRING_DATASOURCE_USERNAME:postgres} - password: ${SPRING_DATASOURCE_PASSWORD:0000} - type: com.zaxxer.hikari.HikariDataSource - hikari: - poolName: Hikari - auto-commit: false - data: - jpa: - repositories: - bootstrap-mode: deferred + url: jdbc:postgresql://localhost:5432/nbat_db + username: postgres + password: 0000 + driver-class-name: org.postgresql.Driver + jpa: - open-in-view: false hibernate: ddl-auto: update properties: hibernate: - "[default_schema]": nbat_schema + default_schema: nbat_schema + format_sql: true + show-sql: true + servlet: multipart: enabled: true max-file-size: 100MB max-request-size: 100MB + server: - port: ${SERVER_PORT:8080} + port: 8080 okta: oauth2: - issuer: ${AUTH0_DOMAIN:https://dev-1m8rc8rkauzkk7c6.us.auth0.com/} - client-id: ${AUTH0_CLIENT_ID:WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg} - client-secret: ${AUTH0_CLIENT_SECRET:Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw} - -application: - auth0: - management-client-id: ${APPLICATION_AUTH0_MANAGEMENT_CLIENT_ID:nvO5Zh1avQFtJzBGPMmih2W0cvSFU9LZ} - management-client-secret: ${APPLICATION_AUTH0_MANAGEMENT_CLIENT_SECRET:E9gQ6zbcJ3iTA_qBg_W1QD0SMNrnqatggK4lS0YRYz_7njfSxqJSZAAjL0rII8Nc} - role-landlord-id: ${APPLICATION_AUTH0_ROLE_LANDLORD_ID:rol_rSyLRkZ1gsnawxY4} - role-tenant-id: ${APPLICATION_AUTH0_ROLE_TENANT_ID:rol_Ur6hM5pvWc3q1yn9} + issuer: https://dev-1m8rc8rkauzkk7c6.us.auth0.com/ + client-id: WNUDfBrJg6C46KxbhEmd8nK70y8eBZEg + client-secret: Cgi8WarbeegjZfKDVpBPHbUZQnJAgXg8GAqSp0GG8Bhw-7a1a5EAQue15XqBxVDw diff --git a/src/test/java/fr/codecake/nbat/NbatCloneBackApplicationIntegrationTest.java b/src/test/java/fr/codecake/nbat/NbatCloneBackApplicationIntegrationTest.java deleted file mode 100644 index a1aac32..0000000 --- a/src/test/java/fr/codecake/nbat/NbatCloneBackApplicationIntegrationTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package fr.codecake.nbat; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - -class NbatCloneBackApplicationIntegrationTest { - - @Test - void testApplicationContextLoads() { - // Test that the application class exists and is instantiable - assertNotNull(NbatCloneBackApplication.class); - assertTrue(NbatCloneBackApplication.class.getName().contains("NbatCloneBackApplication")); - } - - @Test - void testTestResourcesLoaded() { - // Test that configuration files exist in classpath - ClassLoader loader = this.getClass().getClassLoader(); - assertNotNull(loader.getResource("application.yml")); - } -} diff --git a/src/test/java/fr/codecake/nbat/booking/application/BookingServiceTest.java b/src/test/java/fr/codecake/nbat/booking/application/BookingServiceTest.java deleted file mode 100644 index 1b876d1..0000000 --- a/src/test/java/fr/codecake/nbat/booking/application/BookingServiceTest.java +++ /dev/null @@ -1,156 +0,0 @@ -package fr.codecake.nbat.booking.application; - -import fr.codecake.nbat.booking.application.dto.BookedDateDTO; -import fr.codecake.nbat.booking.application.dto.NewBookingDTO; -import fr.codecake.nbat.booking.domain.Booking; -import fr.codecake.nbat.booking.mapper.BookingMapper; -import fr.codecake.nbat.booking.repository.BookingRepository; -import fr.codecake.nbat.listing.application.LandlordService; -import fr.codecake.nbat.listing.application.dto.ListingCreateBookingDTO; -import fr.codecake.nbat.listing.application.dto.vo.PriceVO; -import fr.codecake.nbat.sharedkernel.service.State; -import fr.codecake.nbat.sharedkernel.service.StatusNotification; -import fr.codecake.nbat.user.application.UserService; -import fr.codecake.nbat.user.application.dto.ReadUserDTO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.time.OffsetDateTime; -import java.util.HashSet; -import java.util.Optional; -import java.util.UUID; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class BookingServiceTest { - - @Mock - private BookingRepository bookingRepository; - - @Mock - private BookingMapper bookingMapper; - - @Mock - private UserService userService; - - @Mock - private LandlordService landlordService; - - @InjectMocks - private BookingService bookingService; - - private UUID listingId; - private UUID tenantId; - private NewBookingDTO newBookingDTO; - private ListingCreateBookingDTO listingDTO; - private ReadUserDTO userDTO; - - @BeforeEach - void setUp() { - listingId = UUID.randomUUID(); - tenantId = UUID.randomUUID(); - - newBookingDTO = new NewBookingDTO( - OffsetDateTime.now().plusDays(1), - OffsetDateTime.now().plusDays(3), - listingId); - - listingDTO = new ListingCreateBookingDTO( - listingId, - new PriceVO(100)); - - userDTO = new ReadUserDTO( - tenantId, - "Test", - "User", - "test@example.com", - null, - new HashSet<>()); - } - - @Test - void testCreateBookingSuccessfully() { - // Arrange - Booking booking = new Booking(); - booking.setStartDate(newBookingDTO.startDate()); - booking.setEndDate(newBookingDTO.endDate()); - - when(bookingMapper.newBookingToBooking(newBookingDTO)).thenReturn(booking); - when(landlordService.getByListingPublicId(listingId)).thenReturn(Optional.of(listingDTO)); - when(bookingRepository.bookingExistsAtInterval(newBookingDTO.startDate(), newBookingDTO.endDate(), listingId)) - .thenReturn(false); - when(userService.getAuthenticatedUserFromSecurityContext()).thenReturn(userDTO); - - // Act - State result = bookingService.create(newBookingDTO); - - // Assert - assertEquals(StatusNotification.OK, result.getStatus()); - verify(bookingRepository, times(1)).save(booking); - } - - @Test - void testCreateBookingFailsWhenListingNotFound() { - // Arrange - when(bookingMapper.newBookingToBooking(newBookingDTO)).thenReturn(new Booking()); - when(landlordService.getByListingPublicId(listingId)).thenReturn(Optional.empty()); - - // Act - State result = bookingService.create(newBookingDTO); - - // Assert - assertEquals(StatusNotification.ERROR, result.getStatus()); - assertEquals("Landlord public id not found", result.getError()); - verify(bookingRepository, never()).save(any()); - } - - @Test - void testCreateBookingFailsWhenAlreadyBooked() { - // Arrange - Booking booking = new Booking(); - when(bookingMapper.newBookingToBooking(newBookingDTO)).thenReturn(booking); - when(landlordService.getByListingPublicId(listingId)).thenReturn(Optional.of(listingDTO)); - when(bookingRepository.bookingExistsAtInterval(any(), any(), eq(listingId))).thenReturn(true); - - // Act - State result = bookingService.create(newBookingDTO); - - // Assert - assertEquals(StatusNotification.ERROR, result.getStatus()); - assertEquals("One booking already exists", result.getError()); - verify(bookingRepository, never()).save(any()); - } - - @Test - void testCheckAvailability() { - // Arrange - UUID listingId = UUID.randomUUID(); - Booking booking = new Booking(); - booking.setStartDate(OffsetDateTime.now().plusDays(1)); - booking.setEndDate(OffsetDateTime.now().plusDays(3)); - - when(bookingRepository.findAllByFkListing(listingId)) - .thenReturn(java.util.List.of(booking)); - when(bookingMapper.bookingToCheckAvailability(booking)) - .thenReturn(new BookedDateDTO(booking.getStartDate(), booking.getEndDate())); - - // Act - var result = bookingService.checkAvailability(listingId); - - // Assert - assertNotNull(result); - assertEquals(1, result.size()); - } -} diff --git a/src/test/java/fr/codecake/nbat/infrastructure/config/SecurityUtilsTest.java b/src/test/java/fr/codecake/nbat/infrastructure/config/SecurityUtilsTest.java deleted file mode 100644 index 6670fed..0000000 --- a/src/test/java/fr/codecake/nbat/infrastructure/config/SecurityUtilsTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package fr.codecake.nbat.infrastructure.config; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - -class SecurityUtilsTest { - - @Test - void testRoleConstants() { - assertEquals("ROLE_TENANT", SecurityUtils.ROLE_TENANT); - assertEquals("ROLE_LANDLORD", SecurityUtils.ROLE_LANDLORD); - } - - @Test - void testClaimsNamespaceExists() { - assertNotNull(SecurityUtils.CLAIMS_NAMESPACE); - assertTrue(SecurityUtils.CLAIMS_NAMESPACE.length() > 0); - } -} diff --git a/src/test/java/fr/codecake/nbat/listing/application/TenantServiceTest.java b/src/test/java/fr/codecake/nbat/listing/application/TenantServiceTest.java deleted file mode 100644 index 9d5d797..0000000 --- a/src/test/java/fr/codecake/nbat/listing/application/TenantServiceTest.java +++ /dev/null @@ -1,132 +0,0 @@ -package fr.codecake.nbat.listing.application; - -import fr.codecake.nbat.booking.application.BookingService; -import fr.codecake.nbat.listing.application.dto.DisplayCardListingDTO; -import fr.codecake.nbat.listing.application.dto.vo.PriceVO; -import fr.codecake.nbat.listing.domain.BookingCategory; -import fr.codecake.nbat.listing.domain.Listing; -import fr.codecake.nbat.listing.mapper.ListingMapper; -import fr.codecake.nbat.listing.repository.ListingRepository; -import fr.codecake.nbat.sharedkernel.service.StatusNotification; -import fr.codecake.nbat.user.application.UserService; -import fr.codecake.nbat.user.application.dto.ReadUserDTO; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.PageRequest; - -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.UUID; - -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.*; -import static org.mockito.Mockito.*; - -@ExtendWith(MockitoExtension.class) -class TenantServiceTest { - - @Mock - private ListingRepository listingRepository; - - @Mock - private ListingMapper listingMapper; - - @Mock - private UserService userService; - - @Mock - private BookingService bookingService; - - @InjectMocks - private TenantService tenantService; - - private Listing testListing; - private DisplayCardListingDTO displayDTO; - - @BeforeEach - void setUp() { - testListing = new Listing(); - testListing.setPublicId(UUID.randomUUID()); - testListing.setTitle("Beautiful House"); - testListing.setBookingCategory(BookingCategory.BEACH); - - displayDTO = new DisplayCardListingDTO( - new PriceVO(100), - "Location", - null, - BookingCategory.BEACH, - testListing.getPublicId()); - } - - @Test - void testGetAllListingsByCategory() { - // Arrange - var pageable = PageRequest.of(0, 10); - Page listingPage = new PageImpl<>(List.of(testListing)); - - when(listingRepository.findAllByBookingCategoryWithCoverOnly(pageable, BookingCategory.BEACH)) - .thenReturn(listingPage); - when(listingMapper.listingToDisplayCardListingDTO(testListing)) - .thenReturn(displayDTO); - - // Act - Page result = tenantService.getAllByCategory(pageable, BookingCategory.BEACH); - - // Assert - assertNotNull(result); - assertEquals(1, result.getTotalElements()); - verify(listingRepository, times(1)).findAllByBookingCategoryWithCoverOnly(pageable, BookingCategory.BEACH); - } - - @Test - void testGetAllListingsWhenCategoryIsAll() { - // Arrange - var pageable = PageRequest.of(0, 10); - Page listingPage = new PageImpl<>(List.of(testListing)); - - when(listingRepository.findAllWithCoverOnly(pageable)) - .thenReturn(listingPage); - when(listingMapper.listingToDisplayCardListingDTO(testListing)) - .thenReturn(displayDTO); - - // Act - Page result = tenantService.getAllByCategory(pageable, BookingCategory.ALL); - - // Assert - assertNotNull(result); - assertEquals(1, result.getTotalElements()); - verify(listingRepository, times(1)).findAllWithCoverOnly(pageable); - } - - @Test - void testGetListingByPublicId() { - // Arrange - UUID publicId = testListing.getPublicId(); - UUID landlordId = UUID.randomUUID(); - testListing.setLandlordPublicId(landlordId); - - // Use DisplayListingDTO from service, not DisplayCardListingDTO - org.mockito.Mockito.doReturn(new fr.codecake.nbat.listing.application.dto.DisplayListingDTO()) - .when(listingMapper).listingToDisplayListingDTO(testListing); - - when(listingRepository.findByPublicId(publicId)).thenReturn(Optional.of(testListing)); - when(userService.getByPublicId(landlordId)).thenReturn(Optional.of(new ReadUserDTO( - landlordId, "Landlord", "Name", "landlord@test.com", null, new HashSet<>()))); - - // Act - var result = tenantService.getOne(publicId); - - // Assert - assertNotNull(result); - assertEquals(StatusNotification.OK, result.getStatus()); - assertNull(result.getError()); - verify(listingRepository, times(1)).findByPublicId(publicId); - } -} diff --git a/src/test/java/fr/codecake/nbat/user/application/UserServiceTest.java b/src/test/java/fr/codecake/nbat/user/application/UserServiceTest.java deleted file mode 100644 index afaed55..0000000 --- a/src/test/java/fr/codecake/nbat/user/application/UserServiceTest.java +++ /dev/null @@ -1,112 +0,0 @@ -package fr.codecake.nbat.user.application; - -import fr.codecake.nbat.user.application.dto.ReadUserDTO; -import fr.codecake.nbat.user.domain.Authority; -import fr.codecake.nbat.user.domain.User; -import fr.codecake.nbat.user.mapper.UserMapper; -import fr.codecake.nbat.user.repository.AuthorityRepository; -import fr.codecake.nbat.user.repository.UserRepository; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.*; - -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.*; -import static org.mockito.Mockito.*; - -@ExtendWith(MockitoExtension.class) -class UserServiceTest { - - @Mock - private UserRepository userRepository; - - @Mock - private AuthorityRepository authorityRepository; - - @Mock - private UserMapper userMapper; - - @Mock - private Auth0Service auth0Service; - - @InjectMocks - private UserService userService; - - private User testUser; - private Authority roleTenant; - - @BeforeEach - void setUp() { - UUID userId = UUID.randomUUID(); - testUser = new User(); - testUser.setPublicId(userId); - testUser.setEmail("test@example.com"); - testUser.setFirstName("Test"); - testUser.setLastName("User"); - - roleTenant = new Authority(); - roleTenant.setName("ROLE_TENANT"); - } - - @Test - void testUserPersistenceInRepository() { - // Arrange - when(userRepository.save(any(User.class))).thenReturn(testUser); - - // Act - User saved = userRepository.save(testUser); - - // Assert - assertNotNull(saved); - assertEquals("test@example.com", saved.getEmail()); - verify(userRepository, times(1)).save(testUser); - } - - @Test - void testAssignDefaultRoleToNewUser() { - // Arrange - testUser.setAuthorities(new HashSet<>()); - - // Act - testUser.getAuthorities().add(roleTenant); - - // Assert - assertTrue(testUser.getAuthorities().contains(roleTenant)); - assertEquals(1, testUser.getAuthorities().size()); - } - - @Test - void testFindUserByEmail() { - // Arrange - when(userRepository.findOneByEmail("test@example.com")).thenReturn(Optional.of(testUser)); - - // Act - Optional result = userRepository.findOneByEmail("test@example.com"); - - // Assert - assertTrue(result.isPresent()); - assertEquals("test@example.com", result.get().getEmail()); - } - - @Test - void testGetAuthenticatedUser() { - // Arrange - when(userRepository.findOneByEmail("test@example.com")).thenReturn(Optional.of(testUser)); - ReadUserDTO dto = new ReadUserDTO(testUser.getPublicId(), testUser.getFirstName(), testUser.getLastName(), - testUser.getEmail(), null, new HashSet<>()); - when(userMapper.userToReadUserDTO(testUser)).thenReturn(dto); - - // Act - Optional result = userRepository.findOneByEmail("test@example.com") - .map(userMapper::userToReadUserDTO); - - // Assert - assertTrue(result.isPresent()); - assertEquals("test@example.com", result.get().email()); - } -} diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml deleted file mode 100644 index 5ccc2ca..0000000 --- a/src/test/resources/application.yml +++ /dev/null @@ -1,28 +0,0 @@ -logging: - level: - ROOT: WARN - fr.codecake.nbat: DEBUG - -spring: - application: - name: nbat-clone-back-test - datasource: - url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false - driver-class-name: org.h2.Driver - username: sa - password: - h2: - console: - enabled: true - jpa: - hibernate: - ddl-auto: create-drop - database-platform: org.hibernate.dialect.H2Dialect - security: - oauth2: - resourceserver: - jwt: - issuer-uri: ${OKTA_OAUTH2_ISSUER:https://test.auth0.com/} - -server: - port: 8081