8b135abb by Ean Schuessler

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
1 parent 841138a7
Showing 35 changed files with 16 additions and 8 deletions
No preview for this file type
No preview for this file type
No preview for this file type
1 #Fri Nov 14 19:52:12 CST 2025 1 #Mon Nov 17 22:15:39 CST 2025
2 gradle.version=8.9 2 gradle.version=7.4.1
......
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
......
1 Manifest-Version: 1.0
2
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
......