Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version for the upcoming Grail 7 #74

Open
gsartori opened this issue Nov 4, 2024 · 9 comments
Open

Version for the upcoming Grail 7 #74

gsartori opened this issue Nov 4, 2024 · 9 comments

Comments

@gsartori
Copy link

gsartori commented Nov 4, 2024

Hi @zyro23,

the work on Grails 7 is running, we are porting Dueuno Elements (https://github.com/dueuno-projects/dueuno-elements/tree/feature/grails-7) to support the new Grails version.

We use your plugin, version 2.6.0-RC1.

Do you have any plan to release an updated version working with Grails 7 (Spring Boot 3.3)?

Running the Dueuno Elements test application (./gradlew :app-test:bootRun) we get the following exception:

> Task :app-test:bootRun

12:01:31.573 INFO  [main] o.s.boot.SpringApplication               : 
>                                                                            <
>                         _                                                  <
>                        | |  ELEMENTS                                       <
>                      __| |_   _  ___ _   _ _ __   ___                      <
>                     / _` | | | |/ _ \ | | | '_ \ / _ \                     <
>                    | (_| | |_| |  __/ |_| | | | | (_) |                    <
>                     \__,_|\__,_|\___|\__,_|_| |_|\___/                     <
>                         2024 (c) https://dueuno.com                        <
>                                                                            <
>                                                                            <

12:01:31.623 INFO  [main] dueuno.elements.test.Application         : Starting Application using Java 21 with PID 48708 (/Users/giangio/GitHub/dueuno-elements-grails7/app-test/build/classes/groovy/main started by giangio in /Users/giangio/GitHub/dueuno-elements-grails7/app-test)
12:01:31.624 DEBUG [main] dueuno.elements.test.Application         : Running with Spring Boot v3.4.0-RC1, Spring v6.2.0-RC3
12:01:31.624 INFO  [main] dueuno.elements.test.Application         : The following 1 profile is active: "development"

Configuring Spring Security Core ...
... finished configuring Spring Security Core

12:01:40.275 ERROR [main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method grailsSimpAnnotationMethodMessageHandler in grails.plugin.springwebsocket.DefaultWebSocketConfig required a single bean, but 3 were found:
	- clientInboundChannel: defined by method 'clientInboundChannel' in org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration
	- clientOutboundChannel: defined by method 'clientOutboundChannel' in org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration
	- brokerChannel: defined by method 'brokerChannel' in org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration

This may be due to missing parameter name information

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

Ensure that your compiler is configured to use the '-parameters' flag.
You may need to update both your build tool settings as well as your IDE.
(See https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention)
zyro23 added a commit that referenced this issue Nov 4, 2024
@zyro23
Copy link
Owner

zyro23 commented Nov 4, 2024

thanks for the report. i started work on 2.7.x. that reflects a state that is working locally with grails 7.0.0-SNAPSHOT.

as mentioned in the readme there, grails-spring-websocket-2.7.0-RC1 will be released as soon as a grails-7.0 release(-candidate) is available.

it looks like the cause of the error you are seeing with 2.6.0-RC1 are essentially just missing @Qualifier annotations in DefaultWebSocketConfig (ref. 933a45).

that means for now, you could try:

@gsartori
Copy link
Author

Hi @zyro23,

we now have Grails 7.0.0-M1, it is a first reference release to start porting applications and plugins. Is there any chance to have an updated release of the Websocket plugin?

Thank you very much,
Gianluca

@zyro23
Copy link
Owner

zyro23 commented Jan 27, 2025

the 2.7.x branch is already compatible with grails-7.0.0-M1, however i am still waiting for a grails-7.0.0-RC1 before releasing a plugin release to maven central (as i currently do not have a milestone/snapshot repo available).

to make sure your app works, you also could:

  • clone the plugin (and checkout branch 2.7.x)
  • run gradlew publishToMavenLocal
  • enable repositories { mavenLocal() } in your apps' build.gradle
  • use implementation "io.github.zyro23:grails-spring-websocket:2.7.0-SNAPSHOT"

@gsartori
Copy link
Author

That's great, thank you for the hint!

@gsartori
Copy link
Author

gsartori commented Jan 27, 2025

I've run the aplication with the 7.0.0-SNAPSHOT from mavenLocal() but I'm still getting this error:

2025-01-27T18:21:10.117+01:00 ERROR 21235 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 2 of method grailsSimpAnnotationMethodMessageHandler in grails.plugin.springwebsocket.DefaultWebSocketConfig required a single bean, but 3 were found:
	- transitionService: defined in unknown location
	- websocketService: defined in unknown location
	- brokerMessagingTemplate: defined by method 'brokerMessagingTemplate' in org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration

This may be due to missing parameter name information

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

What am I missing?

@zyro23
Copy link
Owner

zyro23 commented Jan 27, 2025

i am unable to reproduce that error with a fresh grails app (https://start.grails.org).

did you clean your project (gradlew clean) and double-checked that there is no offending DefaultWebSocketConfig class in your src dir (perhaps from testing/copying as suggested in one of my previous comments)?

a minimal sample app reproducing the problem would really be helpful.

thank you.

@zyro23
Copy link
Owner

zyro23 commented Jan 27, 2025

update: this is related to the WebSocket trait. i could reproduce it by making an empty service class implements WebSocket.

looking into it. will keep you posted.

zyro23 added a commit that referenced this issue Jan 27, 2025
…railsSimpAnnotationMethodMessageHandler as well (#74)
@zyro23
Copy link
Owner

zyro23 commented Jan 27, 2025

added another two @Qualifier annotations which are necessary if using the WebSocket trait and fixes the problem.

feel free to pull/publish locally again and give it a spin.

thank you.

@gsartori
Copy link
Author

It works, thank you so much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants