So I’m taking the dive into v7 portlets… I’m building a test using 7.0.2, in case it matters…
I’ve got a simple portlet w/ a simple UI to show a message and two buttons. portlet.xml (2.0) file is properly set up to use the VaadinPortlet class and UI is defined, but web.xml is empty.
The problem is that after the portlet renders itself (just fine, btw), I get an exception of the form:
java.io.FileNotFoundException: The requested resource (/vaadin-test-portlet/vaadin-test/invoke) is not available followed by a big nasty stack trace from catalina, liferay, etc., but nothing from Vaadin.
Okay, so it looks like the Vaadin side is trying to talk to a servlet, which I didn’t have. So in my web.xml file I added a servlet definition, pretty much duplicating what I have in portlet.xml except I use the servlet variety.
Deploy this guy, portlet renders, but then I get a new stack trace of the form:
java.lang.IllegalStateException: Cannot obtain OutputStream because Writer is already in use. Relevant Vaadin stack elements are:
VaadinServletResponse.getOutputStream(VaadinServletResponse.java:31)
BootstrapHandler.writeBootstrapPage(BootstrapHandler.java:220)
BootstrapHandler.handleRequest(BootstrapHandler.java:154)
AbstractCommunicationManager.handleOtherRequest(AbstractCommunicationManager.java:2344)
VaadinServlet.service(VaadinServlet:330)
VaadinServlet.service(VaadinServlet:201)
So on one hand, it looks like my portlet requires a servlet to function. But on the other hand, the servlet has issues.
So the question is, what do I need to put into the web.xml that will lead to a happy servlet/portlet combination?
And seriously? Going through the code for the new V7 control panel for Liferay, it doesn’t jive w/ what is in the Book of Vaadin. One or both are wrong, but I don’t know which…
And anyway, why all of a sudden do we need servlets to support portlets anyway? V6 never needed a servlet for portlets…