0

I have a new project, and I want to run Wildfly from Maven. Command: mvn wildfly:run

What I excpect to happen, is that maven will pack my project to a WAR file, start Wildfly, and then deploy it.

The problem is that it works the first time I run it. It is downloading Wildfly, building and deploying the POM file. If I stop Wildfly, and start it again with the same command, I get a FileNotFoundException and Access is denied message (se below). The strange thing is that I copied this small project over from another computer, where it works all the time. I also tried to make a new project, but still getting the same error.

Exception:

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 53.197 s [INFO] Finished at: 2016-05-02T16:23:11+02:00 [INFO] Final Memory: 19M/212M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Alpha7:run (default-cli) on project new-test: The server failed to start: Deployment failed: Operation failed: {"WFLYCTL0062: Composite operation faile d and was rolled back. Steps that failed:" => {"Operation step-2" => {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./pg" => "org.jboss.msc.service.StartException in service jboss.undert ow.deployment.default-server.default-host./pg: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.File NotFoundException: D:\Skole\New folder\target\wildfly-run\wildfly-10.0.0.Final\standalone\tmp\vfs\temp\tempf818abf44afbab25\content-393c76ecb03dd1d6\content-30131585882030325.tmp (Access is denied) [ERROR] Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: D:\Skole \New folder\target\wildfly-run\wildfly-10.0.0.Final\standalone\tmp\vfs\temp\tempf818abf44afbab25\content-393c76ecb03dd1d6\content-30131585882030325.tmp (Access is denied) [ERROR] Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: D:\Skole\New folder\target\wildfl y-run\wildfly-10.0.0.Final\standalone\tmp\vfs\temp\tempf818abf44afbab25\content-393c76ecb03dd1d6\content-30131585882030325.tmp (Access is denied) [ERROR] Caused by: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: D:\Skole\New folder\target\wildfly-run\wildfly-10.0.0.Final\ \standalone\tmp\vfs\temp\tempf818abf44afbab25\content-393c76ecb03dd1d6\content-30131585882030325.tmp (Access is denied) [ERROR] Caused by: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: D:\Skole\New folder\target\wildfly-run\wildfly-10.0.0.Final\standalone\tmp\vfs\temp\tempf818abf44afb ab25\content-393c76ecb03dd1d6\content-30131585882030325.tmp (Access is denied) [ERROR] Caused by: javax.faces.FacesException: java.io.FileNotFoundException: D:\Skole\New folder\target\wildfly-run\wildfly-10.0.0.Final\standalone\tmp\vfs\temp\tempf818abf44afbab25\content-393c76ecb03dd1d6\content-3 0131585882030325.tmp (Access is denied) [ERROR] Caused by: java.io.FileNotFoundException: D:\Skole\New folder\target\wildfly-run\wildfly-10.0.0.Final\standalone\tmp\vfs\temp\tempf818abf44afbab25\content-393c76ecb03dd1d6\content-30131585882030325.tmp (Access is denied)"}}}} [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

POM file:

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

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>new.test</groupId>
<artifactId>new-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>


<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-7.0</artifactId>
            <version>1.0.3.Final</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.moxy</artifactId>
        <version>2.5.0</version>
    </dependency>

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.glassfish.main.extras</groupId>
        <artifactId>glassfish-embedded-all</artifactId>
        <version>4.1.1</version>
        <scope>test</scope>
    </dependency>


    <!-- JEE for WildFly -->
    <dependency>
        <groupId>org.jboss.spec.javax.faces</groupId>
        <artifactId>jboss-jsf-api_2.2_spec</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jboss.spec.javax.ejb</groupId>
        <artifactId>jboss-ejb-api_3.2_spec</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.1-api</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.spec.javax.annotation</groupId>
        <artifactId>jboss-annotations-api_1.2_spec</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.spec.javax.servlet</groupId>
        <artifactId>jboss-servlet-api_3.1_spec</artifactId>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>

    <finalName>pg</finalName>


    <plugins>


        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.1.0.Alpha7</version>
            <configuration>
                <add-user>
                    <users>
                        <user>
                            <username>admin</username>
                            <password>admin</password>
                        </user>
                    </users>
                </add-user>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

    </plugins>
</build>

Anyone have any ideas? I'm running Windows 10 on both computers.

Kims
  • 405
  • 1
  • 5
  • 15
  • Which kind of drive is D:? Have you tried using C:? – user140547 May 02 '16 at 18:15
  • I was actually using D:, but tried to change to C:. It didnt work. Then I removed some lines from the configuration file, as someone suggested here. Then it worked one time (It didnt work when the project was on D:), and but got the same error message the next time. I can also see that the lines that I removed was back after I started it the first time. So maybe it is something there? – Kims May 02 '16 at 19:26

4 Answers4

1

please remove this from your configuration if you have them

<extension module="org.jboss.as.jsf"/>  



<subsystem xmlns="urn:jboss:domain:jsf:1.0"/>  
suulisin
  • 1,414
  • 1
  • 10
  • 17
  • Thanks, but I tried it. I saw some other posts from people with the same problem. I removed these lines from: Standalone/configuration/standalone.xml. It didnt help. – Kims May 02 '16 at 14:54
  • 1
    I wouldn't advise this since it looks like you're using JSF. This would remove JSF support from the container. – James R. Perkins May 03 '16 at 15:09
1

It's really hard to read that stack trace, but it looks like the user that started WildFly doesn't have the correct access to the WildFly install. The user would need read/write access.

Also the org.jboss.spec.javax.faces:jboss-jsf-api_2.2_spec should be <scope>provided</scope>.

<dependency>
    <groupId>org.jboss.spec.javax.faces</groupId>
    <artifactId>jboss-jsf-api_2.2_spec</artifactId>
    <scope>provided</scope>
</dependency>
James R. Perkins
  • 16,800
  • 44
  • 60
0

For future reference:

I tried removing these lines from the configuration file:

<extension module="org.jboss.as.jsf"/>  

<subsystem xmlns="urn:jboss:domain:jsf:1.0"/> 

I removed them from Standalone/configuration/standalone.xml. This didnt seem to help.

I also moved my project over from D: to C:. It then worked some times it seems. But I also got the errormessage sometimes. But worth checking out if someone have the same problem.

The thing that I think made it work is by fixing my POM file, as one suggested in the accepted answer. I dont know if it was this alone that fixed it, but I think so.

If someone have the same problem, and have a POM file with a missing scope, then I would recomend deleting wildfly, and let maven install it again after you fix the POM file.

Kims
  • 405
  • 1
  • 5
  • 15
  • I ran into the same problem and got it working by commenting out and . – Max Jul 29 '16 at 12:02
  • Actually what worked in the end was to turn off Windows Defenders "Real-time protection". Im positive it was the source for my problems, cause it would turn back on after a while (maybe after a restart, I dont remember), and then it would start to fail again. And after I turned it off, it would work. No commenting out or anything like that needed. – Kims Jul 30 '16 at 17:02
  • Sadly my company's policy doesn't let me turn off real time protection - so I guess I'll stick with that solution. I noticed the same, by the way - in some very rare cases (like everey 15th time or so) it would just work... – Max Aug 02 '16 at 13:04
0

please check Filipe P Goes's answer in this post: Wildfly fails to deploy application (FileNotFoundException - Access is Denied) simply add wildfly folder to the exclude list of your windows antivirus/defender

ameen
  • 686
  • 5
  • 12