1 Reply Latest reply on May 13, 2014 5:43 AM by Mathias Deshayes

    WARNING: Exception encountered during export of archive caused by FileNotFoundException(access is denied)

    Brandon Holmes Newbie

      Hello,

       

      Any ideas on the following error?  I see the directory (war\com.example.mywebapp.MyWebAppJUnit.JUnit\gwt) in my eclipse project that it is complaining about not existing.  Not sure why it says FileNotFound. 

       

      Any help is greatly appreciated.

       

      Brandon

       

      (Including my pom.xml, arquillian.xml, testcase)

       

      log4j:WARN No appenders could be found for logger (org.jboss.logging).

      log4j:WARN Please initialize the log4j system properly.

      Jun 18, 2013 5:03:29 PM org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternal

      INFO: Starting container with: ["C:\Program Files (x86)\Java\jdk1.7.0_21\bin\java", -Xmx512m, -XX:MaxPermSize=128m, -ea, -Djboss.home.dir=C:/jboss-as-7.1.1.Final, -Dorg.jboss.boot.log.file=C:/jboss-as-7.1.1.Final/standalone/log/boot.log, -Dlogging.configuration=file:C:/jboss-as-7.1.1.Final/standalone/configuration/logging.properties, -Djboss.modules.dir=C:\jboss-as-7.1.1.Final\modules, -Djboss.bundles.dir=C:\jboss-as-7.1.1.Final\bundles, -jar, C:\jboss-as-7.1.1.Final\jboss-modules.jar, -mp, C:/jboss-as-7.1.1.Final\modules, -jaxpmodule, javax.xml.jaxp-provider, org.jboss.as.standalone, -server-config, standalone.xml]

      17:03:30,658 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA

      17:03:30,759 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA

      17:03:30,796 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting

      17:03:31,263 INFO  [org.xnio] XNIO Version 3.0.3.GA

      17:03:31,263 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)

      17:03:31,269 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA

      17:03:31,272 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA

      17:03:31,278 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers

      17:03:31,280 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem

      17:03:31,281 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.

      17:03:31,289 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem

      17:03:31,292 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem

      17:03:31,303 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension

      17:03:31,305 INFO  [org.jboss.as.connector] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)

      17:03:31,307 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem

      17:03:31,317 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013100: Current PicketBox version=4.0.7.Final

      17:03:31,324 INFO  [org.jboss.as.naming] (MSC service thread 1-7) JBAS011802: Starting Naming Service

      17:03:31,331 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-11) JBAS015400: Bound mail session [java:jboss/mail/Default]

      17:03:31,408 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      17:03:31,445 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-4) JBoss Web Services - Stack CXF Server 4.0.2.GA

      17:03:31,575 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-12) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

      17:03:31,598 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-12) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7.1.1.Final\standalone\deployments

      17:03:31,598 INFO  [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on /127.0.0.1:4447

      17:03:31,598 INFO  [org.jboss.as.remoting] (MSC service thread 1-8) JBAS017100: Listening on /127.0.0.1:9999

      17:03:31,666 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

      17:03:31,760 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990

      17:03:31,762 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 1248ms - Started 133 of 208 services (74 services are passive or on-demand)

      Compiling com.example.mywebapp.MyWebAppJUnit

      17:03:38,389 INFO  [org.jboss.as.repository] (management-handler-thread - 2) JBAS014900: Content added at location C:\jboss-as-7.1.1.Final\standalone\data\content\a2\8392839c6c2ec822d51fd849edd43b3bfb3a1b\content

      17:03:38,398 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-10) JBAS015876: Starting deployment of "arquillian-service"

      17:03:38,590 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-12) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.jmx:main") which may be changed or removed in future versions without notice.

      17:03:38,594 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-12) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.server:main") which may be changed or removed in future versions without notice.

      17:03:38,596 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-12) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.as.osgi:main") which may be changed or removed in future versions without notice.

      17:03:38,597 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-12) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.jandex:main") which may be changed or removed in future versions without notice.

      17:03:38,598 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-12) JBAS018567: Deployment "deployment.arquillian-service" is using a private module ("org.jboss.osgi.framework:main") which may be changed or removed in future versions without notice.

      17:03:38,985 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "arquillian-service"

      Jun 18, 2013 5:03:39 PM org.jboss.shrinkwrap.impl.base.exporter.zip.JdkZipExporterDelegate$1 call

      WARNING: Exception encountered during export of archive

      java.lang.RuntimeException: Could not open file war\com.example.mywebapp.MyWebAppJUnit.JUnit\gwt

          at org.jboss.shrinkwrap.api.asset.FileAsset.openStream(FileAsset.java:68)

          at org.jboss.shrinkwrap.impl.base.exporter.StreamExporterDelegateBase.processNode(StreamExporterDelegateBase.java:227)

          at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.processNode(AbstractExporterDelegate.java:105)

          at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.doExport(AbstractExporterDelegate.java:95)

          at org.jboss.shrinkwrap.impl.base.exporter.StreamExporterDelegateBase.access$001(StreamExporterDelegateBase.java:50)

          at org.jboss.shrinkwrap.impl.base.exporter.StreamExporterDelegateBase$1.call(StreamExporterDelegateBase.java:121)

          at org.jboss.shrinkwrap.impl.base.exporter.StreamExporterDelegateBase$1.call(StreamExporterDelegateBase.java:116)

          at org.jboss.shrinkwrap.impl.base.exporter.zip.JdkZipExporterDelegate$1.call(JdkZipExporterDelegate.java:124)

          at org.jboss.shrinkwrap.impl.base.exporter.zip.JdkZipExporterDelegate$1.call(JdkZipExporterDelegate.java:118)

          at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

          at java.util.concurrent.FutureTask.run(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

      Caused by: java.io.FileNotFoundException: war\com.example.mywebapp.MyWebAppJUnit.JUnit\gwt (Access is denied)

          at java.io.FileInputStream.open(Native Method)

          at java.io.FileInputStream.<init>(Unknown Source)

          at org.jboss.shrinkwrap.api.asset.FileAsset.openStream(FileAsset.java:66)

          ... 13 more

       

      17:03:39,243 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment arquillian-service in 6ms

      17:03:39,318 INFO  [org.jboss.as.repository] (management-handler-thread - 1) JBAS014901: Content removed from location C:\jboss-as-7.1.1.Final\standalone\data\content\a2\8392839c6c2ec822d51fd849edd43b3bfb3a1b\content

      17:03:39,321 INFO  [org.jboss.as.server] (management-handler-thread - 1) JBAS018558: Undeployed "arquillian-service"

       

       

      TestCase:

       

      package com.example.mywebapp.client;

       

      import static org.junit.Assert.*;

       

      import org.jboss.arquillian.container.test.api.Deployment;

      import org.jboss.arquillian.core.api.annotation.Inject;

      import org.jboss.arquillian.gwt.RunAsGwtClient;

      import org.jboss.arquillian.junit.Arquillian;

      import org.jboss.shrinkwrap.api.ShrinkWrap;

      import org.jboss.shrinkwrap.api.asset.EmptyAsset;

      import org.jboss.shrinkwrap.api.spec.WebArchive;

      import org.junit.Test;

      import org.junit.runner.RunWith;

       

      import com.example.mywebapp.server.GreetingServiceImpl;

      import com.example.mywebapp.shared.Greeter;

      import com.google.gwt.event.logical.shared.ValueChangeEvent;

      import com.google.gwt.event.logical.shared.ValueChangeHandler;

      import com.google.gwt.user.client.ui.TextBox;

       

      @RunWith(Arquillian.class)

      public class GreeterTest {

         

            @Inject

            Greeter greeter;

       

            @Deployment

            public static WebArchive createDeployment() {

              return ShrinkWrap.create(WebArchive.class, "test.war")

                  .addClass(Greeter.class)

                  .addClass(GreetingService.class)

                  .addClass(GreetingServiceImpl.class)

                  .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

            }   

       

       

            @Test

            public void testCreateGreeting() {

              assertEquals("Hello, Earthling!", greeter.createGreeting("Earthling"));

             

            }

       

            @Test

            @RunAsGwtClient(moduleName = "com.example.mywebapp.MyWebAppJUnit")

            public void testCopyTextBoxValues() {

              final TextBox textBox1 = new TextBox();

              final TextBox textBox2 = new TextBox();

              textBox1.addValueChangeHandler(new ValueChangeHandler<String>() {

                @Override

                public void onValueChange(ValueChangeEvent<String> newValueEvent) {

                  textBox2.setText(newValueEvent.getValue());

                }

              });

              textBox1.setValue("Hello, Earthling!", true);

              assertEquals("TextBox values do not match!", textBox1.getText(), textBox2.getText());

            }

       

          }

       

       

      arquillian.xml:

       

      <arquillian xmlns="http://jboss.org/schema/arquillian"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="

              http://jboss.org/schema/arquillian

              http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

          <container qualifier="jbossas-managed" default="true">

              <configuration>

                  <property name="jbossHome">C:/jboss-as-7.1.1.Final</property>

                  <property name="allowConnectingToRunningServer">true</property>

              </configuration>

          </container>

      </arquillian>

       

      pom.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

       

        <!-- POM file generated with GWT webAppCreator -->

        <modelVersion>4.0.0</modelVersion>

        <groupId>com.example.mywebapp</groupId>

        <artifactId>MyWebApp</artifactId>

        <packaging>war</packaging>

        <version>1.0-SNAPSHOT</version>

        <name>com.example.mywebapp.MyWebApp</name>

       

        <properties>

          <!-- Convenience property to set the GWT version -->

          <gwtVersion>2.5.1</gwtVersion>

          <!-- GWT needs at least java 1.6 -->

          <maven.compiler.source>1.6</maven.compiler.source>

          <maven.compiler.target>1.6</maven.compiler.target>

        </properties>

        <dependencyManagement>

            <dependencies>

                <dependency>

                    <groupId>org.jboss.arquillian</groupId>

                    <artifactId>arquillian-bom</artifactId>

                    <version>1.0.4.Final</version>

                    <type>pom</type>

                </dependency>

            </dependencies>

        </dependencyManagement>

        <dependencies>

        <dependency>

              <groupId>org.jboss.arquillian.extension</groupId>

              <artifactId>arquillian-gwt</artifactId>

              <version>1.0.0.Alpha2</version>

          </dependency>

          <dependency>

            <groupId>com.google.gwt</groupId>

            <artifactId>gwt-servlet</artifactId>

            <version>${gwtVersion}</version>

            <scope>runtime</scope>

          </dependency>

          <dependency>

            <groupId>com.google.gwt</groupId>

            <artifactId>gwt-user</artifactId>

            <version>${gwtVersion}</version>

            <scope>provided</scope>

          </dependency>

          <dependency>

            <groupId>com.google.gwt</groupId>

            <artifactId>gwt-dev</artifactId>

            <version>${gwtVersion}</version>

            <scope>test</scope>

          </dependency>

          <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.8.1</version>

            <scope>test</scope>

          </dependency>

          <dependency>

              <groupId>org.jboss.arquillian.junit</groupId>

              <artifactId>arquillian-junit-container</artifactId>

              <version>1.0.4.Final</version>

              <scope>test</scope>

          </dependency>

          <dependency>

            <groupId>javax.validation</groupId>

            <artifactId>validation-api</artifactId>

            <version>1.0.0.GA</version>

            <scope>provided</scope>

          </dependency>

          <dependency>

            <groupId>javax.validation</groupId>

            <artifactId>validation-api</artifactId>

            <version>1.0.0.GA</version>

            <classifier>sources</classifier>

            <scope>provided</scope>

          </dependency>

        </dependencies>

       

          <profiles>

          <profile>

              <id>arquillian-jbossas-managed</id>

              <activation>

                  <activeByDefault>true</activeByDefault>

              </activation>

              <dependencies>

                  <dependency>

                      <groupId>org.jboss.spec</groupId>

                      <artifactId>jboss-javaee-6.0</artifactId>

                      <version>3.0.2.Final</version>

                      <type>pom</type>

                      <scope>provided</scope>

                  </dependency>

                  <dependency>

                      <groupId>org.jboss.as</groupId>

                      <artifactId>jboss-as-arquillian-container-managed</artifactId>

                      <version>7.1.1.Final</version>

                      <scope>test</scope>

                  </dependency>

                  <dependency>

                      <groupId>org.jboss.arquillian.protocol</groupId>

                      <artifactId>arquillian-protocol-servlet</artifactId>

                      <version>1.0.3.Final</version>

                      <scope>test</scope>

                  </dependency>

              </dependencies>

          </profile>

        </profiles>

        <repositories>

          <repository>

            <id>JBOSS_NEXUS</id>

            <url>http://repository.jboss.org/nexus/content/groups/public</url>

          </repository>

        </repositories>

       

       

        <build>

          <!-- Generate compiled stuff in the folder used for developing mode -->

          <outputDirectory>target/www/WEB-INF/classes</outputDirectory>

         

          <plugins>

           

            <!-- GWT Maven Plugin-->

            <plugin>

              <groupId>org.codehaus.mojo</groupId>

              <artifactId>gwt-maven-plugin</artifactId>

          <version>2.2.0</version>

          <dependencies>

                <dependency>

                  <groupId>com.google.gwt</groupId>

                  <artifactId>gwt-user</artifactId>

                  <version>${gwtVersion}</version>

                </dependency>

                <dependency>

                  <groupId>com.google.gwt</groupId>

                  <artifactId>gwt-dev</artifactId>

                  <version>${gwtVersion}</version>

                </dependency>

                <dependency>

                  <groupId>com.google.gwt</groupId>

                  <artifactId>gwt-servlet</artifactId>

                  <version>${gwtVersion}</version>

                </dependency>

          </dependencies>

              <!-- JS is only needed in the package phase, this speeds up testing -->

              <executions>

                <execution>

                  <phase>prepare-package</phase>

                  <goals>

                    <goal>compile</goal>

                  </goals>

                </execution>

              </executions>

              <!-- Plugin configuration. There are many available options,

                   see gwt-maven-plugin documentation at codehaus.org -->

              <configuration>

                <!-- URL that should be automatically opened in the GWT shell (gwt:run). -->

                <runTarget>MyWebApp.html</runTarget>

                <!-- Location of the develop-mode web application structure (gwt:run). -->

                <hostedWebapp>target/www</hostedWebapp>

                <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->

                <compileReport>true</compileReport>

              </configuration>

            </plugin>

       

            <!-- Add source folders to test classpath in order to run gwt-tests as normal junit-tests -->

            <plugin>

              <artifactId>maven-surefire-plugin</artifactId>

          <version>2.5</version>

              <configuration>

                <additionalClasspathElements>

                  <additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>

                  <additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>

                </additionalClasspathElements>

                <useManifestOnlyJar>false</useManifestOnlyJar>

                <forkMode>always</forkMode>

       

                <!-- Folder for generated testing stuff -->

                <systemProperties>

                  <property>

                    <name>gwt.args</name>

                    <value>-out target/www</value>

                  </property>

                </systemProperties>

              </configuration>

            </plugin>

           

            <!-- Copy static web files before executing gwt:run -->

            <plugin>

              <artifactId>maven-resources-plugin</artifactId>

              <version>2.4.2</version>

              <executions>

                <execution>

                  <phase>compile</phase>

                  <goals>

                    <goal>copy-resources</goal>

                  </goals>

                  <configuration>

                    <outputDirectory>target/www</outputDirectory>

                    <resources>

                      <resource>

                        <directory>src/main/webapp</directory>

                      </resource>

                    </resources>

                  </configuration>

                </execution>

              </executions>

            </plugin>

       

            <!-- Delete gwt generated stuff -->

            <plugin>

              <artifactId>maven-clean-plugin</artifactId>

          <version>2.3</version>

              <configuration>

                <filesets>

                  <fileset><directory>src/main/webapp/mywebapp</directory></fileset>

                  <fileset><directory>src/main/webapp/WEB-INF/classes</directory></fileset>

                  <fileset><directory>tomcat</directory></fileset>

                  <fileset><directory>www-test</directory></fileset>

                  <fileset><directory>.gwt-tmp</directory></fileset>

                </filesets>

              </configuration>

            </plugin>

       

            <plugin>

          <artifactId>maven-eclipse-plugin</artifactId>

          <version>2.7</version>  <!--  Note 2.8 does not work with AspectJ aspect path -->

          <configuration>

                <downloadSources>true</downloadSources>

                <downloadJavadocs>false</downloadJavadocs>

                <wtpversion>2.0</wtpversion>

                <additionalBuildcommands>

                  <buildCommand>

                    <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>

                  </buildCommand>

                </additionalBuildcommands>

                <additionalProjectnatures>

                  <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>

                </additionalProjectnatures>

          </configuration>

            </plugin>

       

          </plugins>

        </build>

      </project>