Vaadin 7 as a portlet in Weblogic 10.3 portal server

Hi,

I’m trying to get Vaadin 7 working as a local portlet in Weblogic 10.3.0.0 portal server. I have Vaadin 6 configured the same way and I managed to get it working. I’m hoping someone can help me out…
First off, the Vaadin application deploys and runs fine as long as it’s not a portlet (i.e. navigating directly to the servlet mapping in the web.xml that I assigned to the Vaadin application).
However, once I configure the portal, portlet, and portlet.xml to point to the Vaadin application, when I navigate to the portal page that contains the Vaadin application, I get an error loading the Vaadin static resources…similar to this post:

https://vaadin.com/forum#!/thread/2438273

I worked around that by following the lead from this post:

https://vaadin.com/forum#!/thread/2732876

which allowed me to specify where the static resources located. This leaves me at the point I’m at now…Vaadin tries to perform a JSON.parse(text) on the HTML it gets back from the portal wrapping the portlet when I assume it’s expecting to parse JSON formatted text. JSON.parse fails if the parameter isn’t JSON formatted text.

I realize this may not be solvable because JSR286 is the only portlet spec supported by Vaadin 7 (Weblogic 10.3.0.0 only supports JSR168). I don’t want to fall back to Vaadin 6 because support is dwindling for that version.

Does anyone have any ideas how I can get Vaadin 7 to work in my environment?

Thanks…

WebLogic Portal 10.3.2
introduced JSR-286 support
.

Unfortunately, I don’t have any advice on how to make 10.3.0.0 work with Vaadin portlets. The support for JSR-168 involved a complex tightrope balancing act trying to keep servlet/portlet/Vaadin session lifecycles synchronized etc. and that was removed in Vaadin 7.

You might be able to run Vaadin 7 applications as servlets on WebLogic Portal 10.3.0.0 and embed them e.g. in iframes in HTML portlets. This is not a perfect workaround but might be sufficient for you if you don’t need any of the special features of the portlet API.

thanks, I appreciate the complexity involved in Vaadin 6 to support JSR-168.

Are you sure that just because 10.3.2 adds support for JSR-286 that it won’t have same problem as 10.3.0? If so, then that upgrade (which we’ve been avoiding) may not be as avoidable anymore.

Weblogic Portal has “clipper portlets” and “browser (url) portlets”…here’s how they differ:

http://docs.oracle.com/cd/E15919_01/wlp.1032/e14244/clipper.htm#i1102265

Clippers don’t use iframes…when I tried that, Vaadin still doesn’t work. Browser portlets use iframes which makes Vaadin work but then some of the things I still want to work don’t work anymore (i.e. session synchronization, etc.).

Clippers seem promising because they allow you to just render part of the response as the portlet content. But I don’t know what I would need to do to “clip” in the Vaadin response to get Vaadin to work. Possibly multiple clipper portlets on the same page pointing to Vaadin resources?

Maybe someone out there with a good handle on both Vaadin 7 and Weblogic Portal Clipper portlets can offer a recipe for combining the 2 technologies to get a Vaadin portlet solution for Weblogic Portal?

I know we have been running JSR-286 integration tests with Vaadin 7 portlets on WebLogic Portal 10.3.2. It might have required some tweaking to set up (how to serve static file requests etc) but should work.

As for the clipper portlets: most requests (such as those for mycontext/UIDL, mycontext/APP etc. should come through to the Vaadin servlet unmangled. Also, static resources from /VAADIN (or other location configured for it, with the themes and widgetset) should be served appropriately.

Only the initial request for the context root (the HTML bootstrap page) should be customized either by hand or modified by the clipper portlet. It might be easiest to write it by hand in this case. Some pointers for embedding a Vaadin application on a page
in the book
and
in this thread
.

If you want Vaadin to generate the startup page but in a customized form, see the mini-tutorials on startup page customization
here
.

I cannot say directly what will happen with session management in the older WebLogic portal with such setups, though, so you’ll need to test session expiration handling etc. once everything is set up.

I’m sorry I don’t have enough time to dig deeper into this.

Thanks, this gives me a few more things to try.

When I do try to generate the startup page in a customized form, I can’t get Jsoup to output the “altered” Javascript without escaping HTML entities. The way I understand it is in the modifyBootstrapFragment method I can get the list of nodes to manipulate from Jsoup. When I manipulate the part I want, Jsoup escapes the output. After looking into Jsoup a little bit, it looks like you can tell it to not escape by doing something like this:
element.ownerDocument().outputSettings().escapeMode(EscapeMode.base);

But ownerDocument() returns null. How do I get Jsoup to stop escaping the Javascript?

I was able to get Jsoup to not escape the Javascript by using this:

element.childNode(0).attr("data", html);

So that makes my application render in the portal as a portlet. When I click on a button to test if it works, I get a Vaadin communication error:

com.vaadin.client.VConsole
SEVERE: Communication error: (SyntaxError)
stack: kda@http://myserver:7001/Vaadin7Portal/portal.portal:331
GR@http://myserver:7001/Vaadin7Portal/portal.portal:316
@http://myserver:7001/Vaadin7Portal/portal.portal:340
@http://myserver:7001/Vaadin7Portal/portal.portal:124
@http://myserver:7001/Vaadin7Portal/portal.portal:300
@http://myserver:7001/Vaadin7Portal/portal.portal:1961

fileName: http://myserver:7001/Vaadin7Portal/portal.portal
lineNumber: 336: missing } in XML expression - Original JSON-text: html>

so, it appears my next hurdle is to get Vaadin use /Vaadin7Portal/HelloWorld instead of /Vaadin7Portal/portal.portal. I’m not familiar at all with this deep into Vaadin’s internals…can someone advise?