Skip to content

Add runtime hints for AbstractHandshakeHandler #28697

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

Closed
mhalbritter opened this issue Jun 24, 2022 · 0 comments
Closed

Add runtime hints for AbstractHandshakeHandler #28697

mhalbritter opened this issue Jun 24, 2022 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@mhalbritter
Copy link
Contributor

When running the native-image from the spring-native sample websocket on the sb-3.0.x branch, i get the following exception:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stompWebSocketHandlerMapping': Instantiation of supplied bean failed
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1234) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1209) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1156) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:566) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:526) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:930) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:926) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:592) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[websocket:3.0.0-SNAPSHOT]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:735) ~[websocket:3.0.0-SNAPSHOT]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:431) ~[websocket:3.0.0-SNAPSHOT]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[websocket:3.0.0-SNAPSHOT]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1307) ~[websocket:3.0.0-SNAPSHOT]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1296) ~[websocket:3.0.0-SNAPSHOT]
	at com.example.websocket.WebsocketApplication.main(WebsocketApplication.java:20) ~[websocket:0.0.1-SNAPSHOT]
Caused by: java.lang.IllegalStateException: Failed to instantiate RequestUpgradeStrategy: org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy
	at org.springframework.web.socket.server.support.AbstractHandshakeHandler.initRequestUpgradeStrategy(AbstractHandshakeHandler.java:160) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.web.socket.server.support.AbstractHandshakeHandler.<init>(AbstractHandshakeHandler.java:118) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.web.socket.server.support.DefaultHandshakeHandler.<init>(DefaultHandshakeHandler.java:35) ~[na:na]
	at org.springframework.web.socket.server.support.WebSocketHttpRequestHandler.<init>(WebSocketHttpRequestHandler.java:73) ~[na:na]
	at org.springframework.web.socket.config.annotation.WebMvcStompWebSocketEndpointRegistration.getMappings(WebMvcStompWebSocketEndpointRegistration.java:160) ~[na:na]
	at org.springframework.web.socket.config.annotation.WebMvcStompEndpointRegistry.getHandlerMapping(WebMvcStompEndpointRegistry.java:155) ~[na:na]
	at org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurationSupport.stompWebSocketHandlerMapping(WebSocketMessageBrokerConfigurationSupport.java:92) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurationSupport__BeanDefinitions.lambda$getStompWebSocketHandlerMappingInstance$0(WebSocketMessageBrokerConfigurationSupport__BeanDefinitions.java:38) ~[na:na]
	at org.springframework.util.function.ThrowingFunction.apply(ThrowingFunction.java:63) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.util.function.ThrowingFunction.apply(ThrowingFunction.java:51) ~[websocket:6.0.0-SNAPSHOT]
	at org.springframework.beans.factory.aot.AutowiredInstantiationArgumentsResolver.resolve(AutowiredInstantiationArgumentsResolver.java:156) ~[na:na]
	at org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurationSupport__BeanDefinitions.getStompWebSocketHandlerMappingInstance(WebSocketMessageBrokerConfigurationSupport__BeanDefinitions.java:38) ~[na:na]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1223) ~[websocket:6.0.0-SNAPSHOT]
	... 18 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy
	at java.lang.Class.forName(DynamicHub.java:1121) ~[websocket:na]
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:284) ~[na:na]
	at org.springframework.web.socket.server.support.AbstractHandshakeHandler.initRequestUpgradeStrategy(AbstractHandshakeHandler.java:156) ~[websocket:6.0.0-SNAPSHOT]
	... 30 common frames omitted
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 24, 2022
@sdeleuze sdeleuze self-assigned this Jun 28, 2022
@sdeleuze sdeleuze added in: web Issues in web modules (web, webmvc, webflux, websocket) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 28, 2022
@rstoyanchev rstoyanchev added this to the Triage Queue milestone Jun 30, 2022
@sdeleuze sdeleuze modified the milestones: Triage Queue, 6.0.0-M5 Jun 30, 2022
@sdeleuze sdeleuze changed the title native-image: Problem with TomcatRequestUpgradeStrategy Add runtime hints for AbstractHandshakeHandler Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants