Vaadin with Liferay 6.1 and VAADIN directory is changing

Hi all

I have a problem.

Vaadin with Liferay 6.1 and VAADIN directory is changing from
/html/VAADIN/.
to
/myapp/VAADIN/.
.

IT should use Liferay’s Vaadin directory at
/html/VAADIN/.
.

So how the Vaadin decides which
VAADIN
directory to use under Liferay plugins.

Best regards

Sampsa Sohlman

Some more infromation:

When I restart tomcat (version 7) and removing temp and work files the result is that it is reading
VAADIN/
directory under
/myapp/VAADIN/

When I stop tomcat, delete temp and work + my application from webapp and redeploy it again through Liferay deployment cycle it is working again and reading
VAADIN/
files under
/html/VAADIN/

Feels like magic, but these are computers and they do not do it. So what is happening?

I don’t really understand what you describe as the problem. Does the browser make requests to an incorrect URL? Or how does the myapp/VAADIN path get used?

This could be an issue with the system you use to deploy the application, or maybe you are sometimes connecting to a servlet running on the same tomcat instance (does your application also have a web.xml?) The latter would at least explain such symptoms. Note that many project creation templates for Liferay include both *portlet.xml and web.xml for ease of testing.

The client gets the directory to use in the configuration on the bootstrap (loader) page or page fragment it gets from the server.

Knowing the Vaadin version in use would also be useful.

I should write my questions more carefully … not just flow of thoughts.

So let’s try again.

At Liferay VAADIN directory is located at


/html/VAADIN

When I create Vaadin portlet application named
myapp
and deploy that to Liferay 6.1 CE it works fine and reads resources from
/html/VAADIN
directory.

But when I redeploy exactly same thing to Liferay again, then it tries to read resources from
/myapp/VAADIN
which does not exists.

If I remove the
/webapps/myapp
directory and do the deploy, it works again.

This might be a bug or I’m missing some configurations. So how does Vaadin decides the location of
VAADIN
directory at server.

See AbstractApplicationPortlet and especially the method getStaticFilesLocation(…). A portal level parameter is used (“vaadin.resources.path”), a default value for which should be present in the portal configuration for recent Liferay versions (found in portal.properties inside WEB-INF/lib/portal-impl.jar). You can also set/override it in your portal-ext.properties file. If the parameter is not present in any of the configuration files, “/html” is used as the default resource path.

As noted earlier, the server sends this information to the client upon the first page load (portlet HTML fragment load to be more accurate), and the client uses the value it received in the first request. It should not get overridden except upon page reload, and normally the same value should be returned again.

Thanks for helping

Now I can debug this problem and let’s see what is the reason.