I just tried to switch to "wicket native websockets" in a springboot project: 
 
1) filter changed to
„org.apache.wicket.protocol.ws.javax.JavaxWebSocketFilter“
 
2) added   „add(new WebSocketBehavior() {});“ to  page

3) pom:
<java.version>1.8</java.version>
<tomcat.version>8.5.15</tomcat.version>
<wicket.version>7.7.0</wicket.version>
...
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.2.RELEASE</version>
</parent>
 
4)  <dependency>
    <groupId>org.apache.wicket</groupId>
    <artifactId>wicket-native-websocket-javax</artifactId>
    <version>${wicket.version}</version>
</dependency>
 
5)  
@SpringBootApplication(exclude = {ErrorMvcAutoConfiguration.class})
@Slf4j
public class WebApplication {

    public static void main(String[] args) {
        SpringApplication.run(WebApplication.class, args);
    }

    @Bean
    public FilterRegistrationBean wicketFilter() {
        final FilterRegistrationBean wicketFilter = new
FilterRegistrationBean();
        wicketFilter.setDispatcherTypes(DispatcherType.REQUEST,
DispatcherType.ERROR, DispatcherType.FORWARD, DispatcherType.ASYNC);
        wicketFilter.setAsyncSupported(true);
        wicketFilter.setFilter(new JavaxWebSocketFilter());
        wicketFilter.addInitParameter(WicketFilter.APP_FACT_PARAM,   
SpringWebApplicationFactory.class.getName());
        wicketFilter.addInitParameter(WicketFilter.FILTER_MAPPING_PARAM,
"/*");
        wicketFilter.addInitParameter("applicationBean",
"wicketWebApplication");
        wicketFilter.addInitParameter("configuration", "development");
        wicketFilter.addUrlPatterns("/*");
        return wicketFilter;
    }
 
*Result:* WebSocket connection to
'ws://localhost:8080/wicket/websocket?pageId=4&wicket-ajax-baseurl=reports%3F4&wicket-app-name=javaxWebSocketFilter'
failed: Error during WebSocket handshake: Unexpected response code: 404 
wicket-websocket-jquery-ver-1497450491000.js:69

No errors in the log on server start and while working 

Should this configuration work? or maybe I'm missing something? 

I am are using "embedded Tomcat of Spring Boot", maybe this is the reason
.... 

Thanks in advance! 
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/javax-websockets-in-Spring-Boot-project-404-error-tp4678091.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to