2013-11-01 27 views
1

我試圖初始化基於本教程的WebSocket端點:http://docs.oracle.com/javaee/7/tutorial/doc/websocket003.htm 使用下面的代碼:的Weblogic的WebSocket:無法加載的平臺配置

ServerEndpointConfig.Builder.create(EchoEndpoint.class, "/echo").build(); 

但我發現了下面的異常:

java.lang.RuntimeException: Cannot load platform configurator 
    at javax.websocket.server.ServerEndpointConfig$Configurator.fetchContainerDefaultConfigurator(ServerEndpointConfig.java:123) 
    at javax.websocket.server.DefaultServerEndpointConfig.<init>(DefaultServerEndpointConfig.java:85) 
    at javax.websocket.server.ServerEndpointConfig$Builder.build(ServerEndpointConfig.java:301) 

我不知道該怎麼做才能避免這種情況。我看到我可以爲ServerEndpointConfig的構建器提供一些配置器,但我不知道應該是什麼參數。

服務器是Weblogic 12.1.1。我應該使用12.1.2嗎?

+1

缺少什麼問題?我不明白-1 – NeplatnyUdaj

+1

本教程可能會有所幫助。我不認爲Weblogic版本應該很重要:http://www.programmingforliving.com/2013/08/websocket-tomcat-8-ServerEndpointConfig-Configurator.html –

回答

1

您確實需要使用Weblogic 12.1.2,因爲它是第一個實現了websockets的地方。

如果您將部署到Weblogic只,你應該使用weblogic.websocket.annotation.WebSocket代替ServiceEndpoint或程序在你的問題。 按照本教程中,你將能夠實現端點:

http://docs.oracle.com/middleware/1212/wls/WLPRG/websockets.htm

就包括wls-api.jar,你WebLogic的server/lib目錄下找到。

+1

謝謝,它現在可以工作。 – NeplatnyUdaj

相關問題