Vaadin 7 And WebSphere Portal Server 7

Hi everyone… I am testing Vaadin 7 in WebSphere Portal Server, according to the documentation Vaadin supports every container that works with JSR-286 for Portlets, in that way WebSphere Portal Server 7 satisfies the requeriments.

I have created a simple Vaadin 7 Project, but when i try to deploy it on my server i get this error “Failed to load the bootstrap javascript: /html/VAADIN/vaadinBootstrap.js”, I’ve been looking for posible solutions about this but none works for my portal server (they only apply to liferay), if I test the same application in WebSphere Application Server 7, it works.

Any Ideas…

I’m not familiar with WebSphere Server Portal itself, but with portals in general you need to make sure the static resources are there to be found. So, please make sure you can actually get hold on the vaadinBootstrap.js with a request. Usually you have to add a manual servlet mapping in the config for the Vaadin resources if they can’t be found in default folder.


<servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>/html/VAADIN/*</url-pattern>
    </servlet-mapping>

If this does not help, you can try to google on the specific error message and you’ll get a number of posts on Vaadin forum which hopefully helps you too.

Thank you Jonas, I’ve been looking for some clue of this error for a while, i’ve not found anything useful so i decided to put my question in this forum, when we worked with vaadin 6, we were able to build a portlet project just making a simple modification to getStaticFilesLocation method of ApplicationPortlet2, but with this new version I’ve not been able to find the light

@Override
protected String getStaticFilesLocation(PortletRequest request) {
return request.getContextPath();
}

can you explain me how vaadin loads this resources, for example vaadinBootstrap.js and where it is located? maybe it can give me a clue of what I need to do in WebSphere Portal

Paul,

getStaticFileLocation is now located in VaadinPortletService [1]
. The default value is “/html”.

If you can set javax.portlet.PortalContext properties with Websphere then you can change the default static file location setting “vaadin.resources.path” property.

If this option is not available for Webpshere you could override VaadinPortletService and VaadinPortlet (createVaadinRequest and create a new class to extend VaadinHttpAndPortletRequest) and portlet.xml will need to use your custom PortalVaadin class.

I had to use this option with another Portal vendor to get Vaadin7 serving static files in a different location.

[1]
-
https://github.com/vaadin/vaadin/blob/master/server/src/com/vaadin/server/VaadinPortletService.java#L114

Thanks,
Richard.

I work with Paul, and wanted to post here in case someone else has the same problem. Basically, Richard’s solution worked, we had to re-create a Vaadin6-style folder structure, copying the widgetset, themes and vaadinBootstrap.js to a folder under WebContent of ouf application (WebContent/VAADIN).

After that, we created a class that extended VaadinPortletService, and overrode the method getStaticFileLocation like this

@Override
public String getStaticFileLocation(VaadinRequest request) {
return request.getContextPath();
}

Then we created a class that extended VaadinPortlet and overrode the method createPortletService to return the new Service class we created before

@Override
protected VaadinPortletService createPortletService(
DeploymentConfiguration deploymentConfiguration) {
return new MyVaadinPortletService(this, deploymentConfiguration);
}

This was the class we configured in the portlet.xml file, and it worked.

Given the new way Vaadin7 stores the themes and .js files in several jars, this might not be the best solution architecture-wise, but it’s the only one we could find that worked.