This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 231886 - Unable to deploy to JBoss AS 7 when using outputDirectory in maven-war-plugin
Summary: Unable to deploy to JBoss AS 7 when using outputDirectory in maven-war-plugin
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.4
Hardware: Other Other
: P3 normal with 1 vote (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-27 01:26 UTC by satory
Modified: 2013-12-10 14:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description satory 2013-06-27 01:26:51 UTC
[ BUILD # : 201306252301 ]
[ JDK VERSION : 1.7.0_21 ]

[OS: Windows 8]

When running a maven web application against JBoss AS 7, I am unable to deploy
my application to the server when I have specified a location for the war file
in the maven-war-plugin configuration settings.

I have tested this with Tomcat and I have no problem using the outputDirectory
configuration element in the maven-war-plugin.

Steps to reproduce:
1. Create default maven web application.
2. Assign the web application to an instance of JBoss AS 7.
3. Add the line, "<outputDirectory>deployments</outputDirectory>" to you pom
file like so:
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.1.1</version>
    <configuration>
        <failOnMissingWebXml>false</failOnMissingWebXml>
        <outputDirectory>deployments</outputDirectory>
    </configuration>
</plugin>
4. Press the Run Project button so that the maven goal "package"  is executed,
the console will output the following:
...
--- maven-war-plugin:2.1.1:war (default-war) @ mavenproject1 ---
Packaging webapp
Assembling webapp [mavenproject1] in
[C:\Users\john\Documents\NetBeansProjects\mavenproject1\target\mavenproject1-1.0
-SNAPSHOT]
Processing war project
Copying webapp resources
[C:\Users\john\Documents\NetBeansProjects\mavenproject1\src\main\webapp]
Webapp assembled in [49 msecs]
Building war:
C:\Users\john\Documents\NetBeansProjects\mavenproject1\deployments\mavenproject1
-1.0-SNAPSHOT.war
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 3.058s
Finished at: Thu Jun 27 02:11:09 BST 2013
Final Memory: 11M/163M
------------------------------------------------------------------------
NetBeans: Deploying on JBoss Application Server
    profile mode: false
    debug mode: false
    force redeploy: true
Starting JBoss Application Server
JBoss Application Server Started
Deployment error: No archive for deployment
See the server log for details.
	at
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment
.java:245)
	at
org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.
java:184)
	at
org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecke
r.java:135)
	at
org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLine
Executor.java:235)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by:
org.netbeans.modules.j2ee.deployment.impl.TargetServer$NoArchiveException: No
archive for deployment
	at
org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:
677)
	at
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment
.java:197)
	... 4 more

Further Notes:
If I remove the outputDirectory line from my pom file the web application is
deployed correctly in JBoss, with the war file being pulled from the targets
directory.
This bug is not reproducible using Tomcat(I don't have Glassfish installed so I
haven't checked that.)
This bug exists in 7.3.1.
Comment 1 Martin Janicek 2013-07-22 13:02:48 UTC
Thanks for the report! The issue is valid and reproducible..
Comment 2 Martin Janicek 2013-07-22 13:08:47 UTC
Fixed in: web-main #fe7479a27bfc
Comment 3 Quality Engineering 2013-07-23 02:39:51 UTC
Integrated into 'main-silver', will be available in build *201307222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/fe7479a27bfc
User: Martin Janicek <mjanicek@netbeans.org>
Log: #231886 - Unable to deploy to JBoss AS 7 when using outputDirectory in maven-war-plugin
Comment 4 helderneres 2013-10-22 20:08:04 UTC
I'm passing through the same problem, when I change the name of the ear to be deployed via the final-name attribute of maven-ear-plugin.

Maven configuration:

...
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <finalName>treinamento</finalName>
                <modules>
                    <ejbModule>
                        <groupId>${project.groupId}</groupId> 
                        <artifactId>treinamento-negocio</artifactId> 
                        <bundleFileName>treinamento-ejb.jar</bundleFileName> 
                    </ejbModule>
                </modules>
            </configuration>
        </plugin>
    </plugins>
</build>
...

Error message:

Erro de Implantação:Sem arquivo compactado para implantação
Verifique o log do servidor para obter mais detalhes.
	at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:273)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:205)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:123)
	at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:235)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: org.netbeans.modules.j2ee.deployment.impl.TargetServer$NoArchiveException: Sem arquivo compactado para implantação
	at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:677)
	at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:225)
	... 4 more

Enviroment info:

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.5.0-41-generic running on i386; UTF-8; pt_BR (nb)
Comment 5 Martin Janicek 2013-12-10 14:23:57 UTC
(In reply to helderneres from comment #4)
> I'm passing through the same problem, when I change the name of the ear to
> be deployed via the final-name attribute of maven-ear-plugin.

This works for me. Could you please share your project so I will be able to reproduce the issue?