jeudi 19 février 2015

Spring websocket init fail

I would like to use spring websocket. I prefer the xml based configuration, and my websocket configuration is:



<websocket:message-broker>
<websocket:stomp-endpoint path="/websocket">
<websocket:sockjs />
</websocket:stomp-endpoint>
<websocket:simple-broker prefix="/queue, /topic, /user" />
</websocket:message-broker>


But, when I start the app I got the following error:



[16:18:57.276+0100][localhost-startStop-1][WARN][o.s.w.c.s.XmlWebApplicationContext:refresh#487]: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketMessageBrokerStats': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.sun.proxy.$Proxy123 implementing org.springframework.web.socket.WebSocketHandler,org.springframework.web.socket.SubProtocolCapable,org.springframework.messaging.MessageHandler,org.springframework.context.SmartLifecycle,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.web.socket.messaging.SubProtocolWebSocketHandler' for property 'subProtocolWebSocketHandler'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy123 implementing org.springframework.web.socket.WebSocketHandler,org.springframework.web.socket.SubProtocolCapable,org.springframework.messaging.MessageHandler,org.springframework.context.SmartLifecycle,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.web.socket.messaging.SubProtocolWebSocketHandler] for property 'subProtocolWebSocketHandler': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) ~[AbstractAutowireCapableBeanFactory.class:4.1.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[AbstractAutowireCapableBeanFactory.class:4.1.4.RELEASE]
...
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.sun.proxy.$Proxy123 implementing org.springframework.web.socket.WebSocketHandler,org.springframework.web.socket.SubProtocolCapable,org.springframework.messaging.MessageHandler,org.springframework.context.SmartLifecycle,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.web.socket.messaging.SubProtocolWebSocketHandler' for property 'subProtocolWebSocketHandler'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy123 implementing org.springframework.web.socket.WebSocketHandler,org.springframework.web.socket.SubProtocolCapable,org.springframework.messaging.MessageHandler,org.springframework.context.SmartLifecycle,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.web.socket.messaging.SubProtocolWebSocketHandler] for property 'subProtocolWebSocketHandler': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:475) ~[BeanWrapperImpl.class:4.1.4.RELEASE]
... 20 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy123 implementing org.springframework.web.socket.WebSocketHandler,org.springframework.web.socket.SubProtocolCapable,org.springframework.messaging.MessageHandler,org.springframework.context.SmartLifecycle,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.web.socket.messaging.SubProtocolWebSocketHandler] for property 'subProtocolWebSocketHandler': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:287) ~[TypeConverterDelegate.class:4.1.4.RELEASE]
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:460) ~[BeanWrapperImpl.class:4.1.4.RELEASE]
... 26 common frames omitted


Thanks


Aucun commentaire:

Enregistrer un commentaire