Glassfish built with Maven - License FileNotFoundException

I am using Netbeans 8.0, Windows 8, Java EE 7, the Maven web application project, and glassfish 4.

When I try to run unit tests with an embedded EJB container, the container creation completes with the following exception:

SEVERE: Error while expanding archive file
java.io.FileNotFoundException: C:\Users\...\AppData\Local\Temp\gfembed1338945565251414358tmp\applications\classes\license\LICENSE (The system cannot find the file specified)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
    at com.sun.enterprise.deploy.shared.FileArchive.putNextEntry(FileArchive.java:716)
    at org.glassfish.internal.deployment.GenericHandler.expand(GenericHandler.java:99)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.getContext(ApplicationLifecycle.java:1807)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.access$200(ApplicationLifecycle.java:115)
    at com.sun.enterprise.v3.server.ApplicationLifecycle$DeploymentContextBuidlerImpl.build(ApplicationLifecycle.java:1670)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:424) at  com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:356)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
    at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:109)
    at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:138)
    at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:134)
    at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)

When I try to run a simple unit test with a netbeans web application project (without a maven project), everything works fine (uses the same temporary folder). Both unit tests do nothing more than create an embedded EJB container.

+4
source share

All Articles