Seam Vaadin integration
lobotomy Oct 11, 2011 9:44 PMI am following the documantation that says that we have to add
<web:context-filter url-pattern="/VAADINApplication/*" />
in components.xml
and it seems to solve half of the problems, after adding I have an access to all seam API like it is mentioned by Ricardo Memoria in this post
My Link
problems appear whenever I try to use some of the actions that require active context like entityManager.find() etc.
entity manager is not null and Manager.instance().getCurrentConversationId() returns conversation id
and even though
System.out.println("EVENT context active:" + Contexts.isEventContextActive());
returns true I still get
javax.servlet.ServletException: java.lang.IllegalStateException: No active event context org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:74) org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495) org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73) org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
in documentation (29.1.4.8. ) it also says that I have to for ensure propagation of any new conversation id
How do I do that?
I tried to get the request object in my vaadin application servlet like this
public void onRequestStart(HttpServletRequest request, HttpServletResponse response) { HttpServletRequest oryginalRequest = (HttpServletRequest) ((IdentityRequestWrapper) request).getRequest(); oryginalRequest = new HttpServletRequestWrapper(oryginalRequest); oryginalRequest = new AddableHttpRequest(oryginalRequest);
AddableHttpServlet request is the class that I created and it extends HttpServletRequestWrapper and allowes to add new parameters
When I execute
oryginalRequest = new HttpServletRequestWrapper(oryginalRequest);
everything is OK
but when it gets to execute this
oryginalRequest = new AddableHttpRequest(oryginalRequest);
I get the same error as above with no active event context .
I can wrap request in oryginal wrapper class but i can not wrap it in class that extends it ?