Problem with errai tutorial
alex122 Nov 25, 2013 8:28 AMHi,
I am new to erra however with some GWT experience. I decided that I will start my adventure by configuring development environment and installing tutorial. So this is what I have on board:
- errai tutorial 2.4.2.Final
 - jboss as 7.1.1.Final
 - maven 3
 - jdk 1.7
 - IntelliJ Idea
 - Windows
 
This is my pom content. Basically the standard one with only <errai.jboss.home variable set (also JBOSS_HOME environment variable):
<?xml version="1.0" encoding="UTF-8"?>
<project
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
        xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.jboss.errai.demo</groupId>
    <artifactId>errai-tutorial</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>Errai::Tutorial</name>
    <properties>
        <errai.version>2.4.2.Final</errai.version>
        <errai.devmode.version>3.0.0.20131101-M2</errai.devmode.version>
        <gwt.version>2.5.1</gwt.version>
        <slf4j.version>1.5.11</slf4j.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <javaee.version>3.0.2.Final</javaee.version>
        <errai.dev.context>${project.artifactId}</errai.dev.context>
        <errai.jboss.home>C:\Users\alex\Programy\jboss</errai.jboss.home>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.errai.bom</groupId>
                <artifactId>errai-version-master</artifactId>
                <version>${errai.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.errai</groupId>
                <artifactId>errai-parent</artifactId>
                <version>${errai.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec</groupId>
                <artifactId>jboss-javaee-6.0</artifactId>
                <version>${javaee.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.weld</groupId>
                <artifactId>weld-core</artifactId>
                <version>1.1.5.Final</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.weld.servlet</groupId>
                <artifactId>weld-servlet-core</artifactId>
                <version>1.1.5.Final</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.errai</groupId>
                <artifactId>errai-cdi-jboss</artifactId>
                <version>${errai.devmode.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.errai</groupId>
                <artifactId>errai-client-local-class-hider</artifactId>
                <version>${errai.devmode.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.errai</groupId>
            <artifactId>errai-javaee-all</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.errai</groupId>
            <artifactId>errai-cordova</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-6.0</artifactId>
            <version>${javaee.version}</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.errai</groupId>
            <artifactId>errai-cdi-jboss</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.errai</groupId>
            <artifactId>errai-client-local-class-hider</artifactId>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>JBOSS_NEXUS</id>
            <url>http://repository.jboss.org/nexus/content/groups/public</url>
        </repository>
    </repositories>
    <build>
        <finalName>${project.artifactId}</finalName>
        <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
        <resources>
            <resource>
                <directory>src/main/java</directory>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>gwt-maven-plugin</artifactId>
                                        <versionRange>[2.4.0,)</versionRange>
                                        <goals>
                                            <goal>resources</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${gwt.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>resources</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <extraJvmArgs>-Xmx712m -XX:CompileThreshold=7000 -XX:MaxPermSize=128M -Derrai.jboss.home=${errai.jboss.home} -Derrai.dev.context=${errai.dev.context} -Derrai.jboss.javaagent.path=${settings.localRepository}/org/jboss/errai/errai-client-local-class-hider/${errai.devmode.version}/errai-client-local-class-hider-${errai.devmode.version}.jar</extraJvmArgs>
                    <logLevel>INFO</logLevel>
                    <noServer>false</noServer>
                    <server>org.jboss.errai.cdi.server.gwt.JBossLauncher</server>
                    <disableCastChecking>true</disableCastChecking>
                    <runTarget>${errai.dev.context}/index.html</runTarget>
                    <hostedWebapp>src/main/webapp</hostedWebapp>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}</directory>
                            <includes>
                                <include>src/main/webapp/app/</include>
                                <include>src/main/webapp/WEB-INF/deploy/</include>
                                <include>src/main/webapp/WEB-INF/lib/</include>
                                <include>**/gwt-unitCache/**</include>
                                <include>.errai/</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>jboss7</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.2</version>
                        <configuration>
                            <packagingExcludes>**/javax/**/*.*,**/client/local/**/*.class</packagingExcludes>
                            <outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jboss.as.plugins</groupId>
                        <artifactId>jboss-as-maven-plugin</artifactId>
                        <version>7.1.1.Final</version>
                        <extensions>false</extensions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.errai</groupId>
                    <artifactId>errai-jboss-as-support</artifactId>
                </dependency>
                <!-- TODO figure out how to force all these things to provided scope without doing it explicitly in EVERY SINGLE ERRAI PROJECT!!!!111!!!!1 -->
                <!-- Don't deploy any of this -->
                <dependency><groupId>com.google.guava</groupId><artifactId>guava-gwt</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>hsqldb</groupId><artifactId>hsqldb</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>javax.annotation</groupId><artifactId>jsr250-api</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>javax.enterprise</groupId><artifactId>cdi-api</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>javax.inject</groupId><artifactId>javax.inject</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>javax.validation</groupId><artifactId>validation-api</artifactId><classifier>sources</classifier><scope>provided</scope></dependency>
                <dependency><groupId>javax.validation</groupId><artifactId>validation-api</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>junit</groupId><artifactId>junit</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.hibernate.common</groupId><artifactId>hibernate-commons-annotations</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.hibernate.javax.persistence</groupId><artifactId>hibernate-jpa-2.0-api</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.hibernate</groupId><artifactId>hibernate-core</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.hibernate</groupId><artifactId>hibernate-entitymanager</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.hibernate</groupId><artifactId>hibernate-validator</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.hibernate</groupId><artifactId>hibernate-validator</artifactId><classifier>sources</classifier><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-cdi-jetty</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-cdi-jboss</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-client-local-class-hider</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-codegen-gwt</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-data-binding</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-javax-enterprise</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-jaxrs-client</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-jpa-client</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-navigation</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai</groupId><artifactId>errai-tools</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.logging</groupId><artifactId>jboss-logging</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.resteasy</groupId><artifactId>jaxrs-api</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.spec.javax.interceptor</groupId><artifactId>jboss-interceptors-api_1.1_spec</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.spec.javax.transaction</groupId><artifactId>jboss-transaction-api_1.1_spec</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.weld.servlet</groupId><artifactId>weld-servlet-core</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.weld</groupId><artifactId>weld-core</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.weld</groupId><artifactId>weld-api</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.weld</groupId><artifactId>weld-spi</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>xml-apis</groupId><artifactId>xml-apis</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.jboss.errai.io.netty</groupId><artifactId>netty</artifactId><scope>provided</scope></dependency>
                <dependency><groupId>org.mortbay.jetty</groupId><artifactId>jetty-naming</artifactId><scope>provided</scope></dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mobile</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jboss.errai</groupId>
                        <artifactId>cordova-maven-plugin</artifactId>
                        <version>2.4.1.Final</version>
                        <executions>
                            <execution>
                                <id>build</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>build-project</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <pluginRepositories>
                <pluginRepository>
                    <id>snapshots.jboss.org</id>
                    <name>JBoss Snapshot Repository</name>
                    <url>http://snapshots.jboss.org/maven2</url>
                    <layout>default</layout>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
</project>
Unfortunately this standard setting does not work. I have spent some time now with no success. I have pinned point the problem to hostedWebapp setting. Somehow path delimiters are removed and of course JBoss can not deploy application if it can not find it. I have tried many combinations to fix this:
- /src/main/webapp
 - \src\main\webapp
 - \\src\\main\webapp
 - c:/Users/alex/workspace_priv/nn_new/errai-tutorial-master/src/main/webapp
 - c:\\Users\\alex\\workspace_priv\\nn_new\\errai-tutorial-master\\src\\main\\webapp
 - C:\Users\alex\workspace_priv\nn_new\errai-tutorial-master\src\main\webapp
 - /Users/alex/workspace_priv/nn_new/errai-tutorial-master/src/main/webapp
 
I thought that the problem is that I develop on Windows, however I am stuck and can not move forward. It is probably not related with IntelliJ as I get exactly the same error running mvn clean gwt:run from command line
The JBoss error:
[INFO] 14:14:53,680 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 633ms - Started 169 of 248 services (78 services are passive or on-demand)
[INFO] {"outcome" => "success"}
[INFO] 14:14:54,353 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-14) JBAS015876: Starting deployment of "errai-tutorial.war"
[INFO] 14:14:54,368 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC00001: Failed to start service jboss.deployment.unit."errai-tutorial.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."errai-tutorial.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "errai-tutorial.war"
[INFO] at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[INFO] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
[INFO] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
[INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
[INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
[INFO] at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
[INFO] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to mount deployment content
[INFO] at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[INFO] at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[INFO] ... 5 more
[INFO] Caused by: java.io.FileNotFoundException: C:\Users\alex\workspace_priv\nn_new\errai-tutorial-master\Usersalexworkspace_privnn_newerrai-tutorial-mastersrcmainwebapp (Nie mo�na odnale�� okre�lonego pliku)
[INFO] at java.io.FileInputStream.open(Native Method) [rt.jar:1.7.0_17]
[INFO] at java.io.FileInputStream.<init>(FileInputStream.java:138) [rt.jar:1.7.0_17]
[INFO] at org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:57) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[INFO] at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:238) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[INFO] at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:567) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[INFO] at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:97) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[INFO] at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:87) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[INFO] ... 6 more
[INFO]
[INFO] 14:14:54,383 INFO  [org.jboss.as.server] (management-handler-thread - 3) JBAS015870: Deploy of deployment "errai-tutorial.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"errai-tutorial.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"errai-tutorial.war\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"errai-tutorial.war\""}}
[INFO] 14:14:54,383 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment errai-tutorial.war in 0ms
[INFO] 14:14:54,386 INFO  [org.jboss.as.controller] (management-handler-thread - 3) JBAS014774: Service status report
[INFO] JBAS014777:   Services which failed to start:      service jboss.deployment.unit."errai-tutorial.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."errai-tutorial.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "errai-tutorial.war"
[INFO]
[INFO] {"outcome" => "success"}
[ERROR] Unable to start embedded HTTP server
[ERROR] com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
[ERROR] at org.jboss.errai.cdi.server.gwt.JBossLauncher.start(JBossLauncher.java:120)
[ERROR] at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
Has anyone an idea what is wrong?