Fix null params handling in processMcpMethod
- Add null check for params before setting sessionId - Remove references to non-existent sessionManager in destroy and other methods - This fixes the NullPointerException when processing notifications/initialized
Showing
35 changed files
with
16 additions
and
8 deletions
.gradle/7.4.1/checksums/checksums.lock
0 → 100644
No preview for this file type
No preview for this file type
File mode changed
.gradle/7.4.1/fileChanges/last-build.bin
0 → 100644
No preview for this file type
.gradle/7.4.1/fileHashes/fileHashes.lock
0 → 100644
No preview for this file type
.gradle/7.4.1/gc.properties
0 → 100644
File mode changed
No preview for this file type
| 1 | arguments=--init-script /home/ean/.config/Code/User/globalStorage/redhat.java/1.46.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/init/init.gradle --init-script /home/ean/.config/Code/User/globalStorage/redhat.java/1.46.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/protobuf/init.gradle | 1 | arguments=--init-script /home/ean/.config/Code/User/globalStorage/redhat.java/1.47.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/init/init.gradle --init-script /home/ean/.config/Code/User/globalStorage/redhat.java/1.47.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/protobuf/init.gradle |
| 2 | auto.sync=false | 2 | auto.sync=false |
| 3 | build.scans.enabled=false | 3 | build.scans.enabled=false |
| 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9)) | 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9)) |
| 5 | connection.project.dir=../../.. | 5 | connection.project.dir= |
| 6 | eclipse.preferences.version=1 | 6 | eclipse.preferences.version=1 |
| 7 | gradle.user.home= | 7 | gradle.user.home= |
| 8 | java.home=/usr/lib/jvm/java-17-openjdk-amd64 | 8 | java.home=/usr/lib/jvm/java-17-openjdk-amd64 | ... | ... |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
build/classes/groovy/main/org/moqui/mcp/McpSessionManager$_cleanupInactiveSessions_closure6.class
0 → 100644
No preview for this file type
build/classes/groovy/main/org/moqui/mcp/McpSessionManager$_cleanupInactiveSessions_closure7.class
0 → 100644
No preview for this file type
No preview for this file type
build/classes/groovy/main/org/moqui/mcp/McpSessionManager$_getActiveSessionCount_closure8.class
0 → 100644
No preview for this file type
build/classes/groovy/main/org/moqui/mcp/McpSessionManager$_getSessionStatistics_closure3.class
0 → 100644
No preview for this file type
build/classes/groovy/main/org/moqui/mcp/McpSessionManager$_shutdownGracefully_closure4.class
0 → 100644
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
build/classes/groovy/main/org/moqui/mcp/ServiceBasedMcpServlet$_broadcastSseEvent_closure2.class
0 → 100644
No preview for this file type
No preview for this file type
No preview for this file type
build/classes/groovy/main/org/moqui/mcp/ServiceBasedMcpServlet$_startKeepAliveTask_closure3.class
0 → 100644
No preview for this file type
No preview for this file type
No preview for this file type
build/tmp/jar/MANIFEST.MF
0 → 100644
lib/moqui-mcp-2-1.0.0.jar
0 → 100644
No preview for this file type
| ... | @@ -550,6 +550,11 @@ try { | ... | @@ -550,6 +550,11 @@ try { |
| 550 | logger.info("Enhanced METHOD: ${method} with params: ${params}, sessionId: ${sessionId}") | 550 | logger.info("Enhanced METHOD: ${method} with params: ${params}, sessionId: ${sessionId}") |
| 551 | 551 | ||
| 552 | try { | 552 | try { |
| 553 | // Ensure params is not null | ||
| 554 | if (params == null) { | ||
| 555 | params = [:] | ||
| 556 | } | ||
| 557 | |||
| 553 | // Add session context to parameters for services | 558 | // Add session context to parameters for services |
| 554 | params.sessionId = sessionId | 559 | params.sessionId = sessionId |
| 555 | 560 | ||
| ... | @@ -646,8 +651,7 @@ try { | ... | @@ -646,8 +651,7 @@ try { |
| 646 | void destroy() { | 651 | void destroy() { |
| 647 | logger.info("Destroying EnhancedMcpServlet") | 652 | logger.info("Destroying EnhancedMcpServlet") |
| 648 | 653 | ||
| 649 | // Gracefully shutdown session manager | 654 | // No session manager to shutdown - using Moqui's Visit system |
| 650 | sessionManager.shutdownGracefully() | ||
| 651 | 655 | ||
| 652 | super.destroy() | 656 | super.destroy() |
| 653 | } | 657 | } |
| ... | @@ -656,13 +660,15 @@ try { | ... | @@ -656,13 +660,15 @@ try { |
| 656 | * Broadcast message to all active sessions | 660 | * Broadcast message to all active sessions |
| 657 | */ | 661 | */ |
| 658 | void broadcastToAllSessions(JsonRpcMessage message) { | 662 | void broadcastToAllSessions(JsonRpcMessage message) { |
| 659 | sessionManager.broadcast(message) | 663 | // TODO: Implement broadcast using Moqui's Visit system if needed |
| 664 | logger.info("Broadcast to all sessions not yet implemented") | ||
| 660 | } | 665 | } |
| 661 | 666 | ||
| 662 | /** | 667 | /** |
| 663 | * Get session statistics for monitoring | 668 | * Get session statistics for monitoring |
| 664 | */ | 669 | */ |
| 665 | Map getSessionStatistics() { | 670 | Map getSessionStatistics() { |
| 666 | return sessionManager.getSessionStatistics() | 671 | // TODO: Implement session statistics using Moqui's Visit system if needed |
| 672 | return [activeSessions: 0, message: "Session statistics not yet implemented"] | ||
| 667 | } | 673 | } |
| 668 | } | 674 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment