2014-09-23 2 views
0

У меня есть приложение gwt с пружиной для gwt (gwt-sl). Я хотел бы реализовать атмосферу20. Это мой web.xmlAtmosphere + GWT + Spring проблема интеграции безопасности

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value> 
     /WEB-INF/applicationContext.xml 
     /WEB-INF/spring-security.xml 
    </param-value> 
</context-param> 
<filter> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
</filter> 
<filter-mapping> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 
<listener> 
    <listener-class> 
     org.springframework.web.context.request.RequestContextListener 
    </listener-class> 
</listener> 
<servlet> 
    <servlet-name>gwt</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
    <servlet-name>gwt</servlet-name> 
    <url-pattern>/MY_APP/rpc/*</url-pattern> 
</servlet-mapping> 
<servlet> 
    <servlet-name>init</servlet-name> 
    <servlet-class>MY_APP.shared.util.BootstrapValidationServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 

<!--then follow all GWT Services with mappings and my listeners--> 

<servlet> 
    <description>AtmosphereServlet</description> 
    <servlet-name>AtmosphereServlet</servlet-name> 
    <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class> 
    <init-param> 
     <param-name>org.atmosphere.cpr.packages</param-name> 
     <param-value>MY_APP.atmosphere</param-value> 
    </init-param> 
    <load-on-startup>1</load-on-startup> 
    <async-supported>true</async-supported> 
</servlet> 
<servlet-mapping> 
    <servlet-name>AtmosphereServlet</servlet-name> 
    <url-pattern>/MY_APP/atmosphere/*</url-pattern> 
</servlet-mapping> 

<listener> 
    <listener-class> 
     org.springframework.web.context.ContextLoaderListener 
    </listener-class> 
</listener> 

1) есть связанные темы с атмосферой и интеграции Spring Security. но нет ответов. Более того, мне нужна атмосфера и простой rpc для gwt (оба обеспечены). Работы либо Атмосфера, либо Весенняя безопасность.

У меня есть следующие ошибки: потоковый:

org.atmosphere.cpr.AsynchronousProcessor - Invalid request state. AsyncContext#startAsync not supported. Make sure async-supported is set to true in web.xml http://<path>/atmosphere/rpc 
501 - GET /<path>/atmosphere/rpc?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.4-javascript&X-Atmosphere-Transport=streaming&Content-Type=text%2Fx-gwt-rpc%3B%20charset%3DUTF-8&X-atmo-protocol=true&_=1411453107109 (<path>) 
    Request headers 
     Host: <path> 
     User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 
     Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 
     Accept-Language: en-gb,en;q=0.5 
     Accept-Encoding: gzip, deflate 
     Content-Type: text/x-gwt-rpc; charset=UTF-8 
     Referer: http://<path>/Page.html?gwt.codesvr=127.0.0.1:9997 
     Cookie: JSESSIONID=1te41te8axqfe8cqydbnpsie3 
     Connection: keep-alive 
    Response headers 
     X-Atmosphere-first-request: true 
     X-Atmosphere-tracking-id: 7eae0ee2-5fdc-4a51-9ebc-614094e67244 
     X-Atmosphere-error: AsyncContext not enabled 

WebSocket:

org.atmosphere.cpr.AsynchronousProcessor - Invalid request state. AsyncContext#startAsync not supported. Make sure async-supported is set to true in web.xml http://<path>/atmosphere/rpc 
org.atmosphere.websocket.protocol.SimpleHttpProtocol - Status code higher or equal than 400. Unable to deliver the websocket messages to installed component. Status 501 Message OK 

Пожалуйста, помогите с конфигурациями. Лучшее решение, чтобы добавить Spring Security для существования GWT-RPC примеры для атмосферы

Заранее спасибо

ответ

0

имеют те же проблемы с GWT 2.6 и атмосфера-GWT-2.2.0 и атмосферы клиента 2.2.5. Я добавил <async-supported>true</async-supported> к фильтру безопасности пружины и, похоже, работает.

<filter> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
    <async-supported>true</async-supported> 
    </filter> 
+0

Это не решение для меня. Конечно, я добавил. После отправки клиенту с сервера моя Spring Session удаляется из HttpSession. для решения этого я добавил слушателя при отправке и все время переписываю SpringContext. это работает, но выглядят как не лучшее решение – Alex

Смежные вопросы