vaadin-maven-plugin compiling widgetset fails in Linux OS

I am new to Vaadin and we have been not successful deploying vaadin applicatioin in production; we set the productionMode=true as context-param in web.xml

vaadin-maven-plugin takes so long time and finally sucks at the following and never completes. Pls let me know and prod environment’s OS is ‘Linux’.

[INFO]
— vaadin-maven-plugin:7.3.3:compile (default) @ srisaisilks —
[INFO]
auto discovered modules [com.srisaisilks.view.AppWidgetSet]

[WARNING]
Failed to retrieve com.vaadin:vaadin-client-compiler based on project POM
[INFO]
Using com.vaadin:vaadin-client-compiler version 7.3.3
[ERROR]
Nov 03, 2014 11:21:38 PM java.util.prefs.FileSystemPreferences$1 run
[ERROR]
WARNING: Couldn’t create user preferences directory. User preferences are unusable.
[ERROR]
Nov 03, 2014 11:21:38 PM java.util.prefs.FileSystemPreferences$1 run
[ERROR]
WARNING: java.io.IOException: No such file or directory
[INFO]
Compiling module com.srisaisilks.view.AppWidgetSet
[ERROR]
Nov 03, 2014 11:22:10 PM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode
[ERROR]
WARNING: Could not lock User prefs. Unix error code 2.
[ERROR]
Nov 03, 2014 11:22:10 PM java.util.prefs.FileSystemPreferences syncWorld
[ERROR]
WARNING: Couldn’t flush user prefs: java.util.prefs.BackingStoreException: Couldn’t get file lock.

I faced this problem when deploying in openshift. The problem in that environment is that the user’s home directory is “read only”, and the JVM is thus unable to write user (or system) preferences.

Since I use maven to build the project, I added this to the pom.xml file:

<project>
...
    <profiles>
...
        <profile>
            <id>openshift</id>
...
            <build>
...
                <plugins>
...
                    <plugin>
                        <groupId>com.vaadin</groupId>
                        <artifactId>vaadin-maven-plugin</artifactId>
                        <configuration>
                                <extraJvmArgs>-Djava.util.prefs.userRoot=~/app-root/data/.java/.systemPrefs</extraJvmArgs>
                        </configuration>
                    </plugin>
...
                </plugins>
...
            </build>
        </profile>
...
    </profiles>
...
</project>

This provides the vaadin-maven-plugin the capacity to create a user preferences storage, which in a read-only home directory (the case in openshift) would be impossible to have.

I am getting an error from OpenShift with the above modification:

fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer

Is there a complete working OpenShift example available?

After adding Bruno Unna’s change to plugin configuration,
I keep getting ‘Connection closed by remote host’

[INFO]
Scanning for projects…
[INFO]

[INFO]

[INFO]
Building Example.com 1.0
[INFO]

[INFO]

[INFO]

vaadin-maven-plugin:7.3.0:compile (default-cli) @ bapp >>>
[INFO]

[INFO]
— maven-resources-plugin:2.5:resources (default-resources) @ bapp —
[debug]
execute contextualize
[INFO]
Using ‘UTF-8’ encoding to copy filtered resources.
[INFO]
Copying 4 resources
[INFO]

[INFO]
<<< vaadin-maven-plugin:7.3.0:compile (default-cli) @ bapp <<<
[INFO]

[INFO]
— vaadin-maven-plugin:7.3.0:compile (default-cli) @ bapp —
[INFO]
auto discovered modules [com.example.AppWidgetSet]

[WARNING]
Failed to retrieve com.vaadin:vaadin-client-compiler based on project
POM
[INFO]
Using com.vaadin:vaadin-client-compiler version 7.3.0
[INFO]
Compiling module com.example.AppWidgetSet
Connection to bapp-example.rhcloud.com closed by remote host.
Connection to bapp-example.rhcloud.com closed.

Hello,

I uploaded the following repository as an openshift app and I am having the same problem.

https://github.com/montoyaedu/vaadin-forum-openshift-issue
remote: [INFO]
 Using com.vaadin:vaadin-client-compiler version 7.6.5
remote: [ERROR]
 Apr 26, 2016 9:23:43 AM java.util.prefs.FileSystemPreferences$1 run
remote: [ERROR]
 INFO: Created user preferences directory.
remote: [INFO]
 Compiling module it.ethiclab.web.app1.App1Widgetset
Connection to app1-ethiclab.rhcloud.com closed by remote host.
fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer

It could be a timeout issue as stated here:

https://bugzilla.redhat.com/show_bug.cgi?id=962801 I tried to increase timeouts by modifying .ssh/config as suggested by the previous link, but it did not work. But at some point I realized that it was indeed a timeout problem.

So I decided to avoid widgetset recompilation by following this howto:

http://www.jorambarrez.be/blog/2011/04/28/howto-vaadin-addon-maven/ The latest commits are available at:

https://github.com/montoyaedu/vaadin-forum-openshift-issue

I finally could deploy this vaadin application to openshift and speed up the building process at the same time!!!

the sample app running on openshift is:

http://app1-ethiclab.rhcloud.com/

Cheers,

Edu.