-
1. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
maderhan Oct 31, 2012 2:55 AM (in response to connie.yang)Hi,
if you are deploying to a remote host you have to specify the hostname!
Your error look like that you try to deploy on localhost "Could not connect to remote://localhost:9999".
-
2. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
connie.yang Oct 31, 2012 2:58 AM (in response to maderhan)Yes, I did use -Dhostname in my mvn command
mvn jboss-as:deploy -Dhostname=my-remote-host-name
And yet, the plugin tries to deploy to localhost. What am I missing?
-
3. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
nickarls Oct 31, 2012 3:13 AM (in response to connie.yang)Hmm, tried -Dhostname=foo -Djboss-as.hostname=foo and -Djboss-as.jboss-as.hostname=foo but it still hit localhost. The code says
@Parameter(defaultValue = "localhost", property = "jboss-as.hostname")
so I thought it would "just work". Perhaps Jamez P can shed some light on the issue when he wakes up. You could of course try a plugin configure in pom.xml as a workaround.
-
4. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
connie.yang Oct 31, 2012 3:22 AM (in response to nickarls)Thanks for the reply. Do you have an example of the configuration usage? This is what I have in my pom,
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.3.Final</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
-
5. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
nickarls Oct 31, 2012 3:30 AM (in response to connie.yang)Try
<configuration>
<hostname>thehost</hostname>
<port>9999</port>
<username>user</username>
<password>password</password>
</configuration>in the execution
-
6. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
jamezp Oct 31, 2012 11:16 AM (in response to nickarls)Using -Djboss-as.hostname=foo seems to work for me. At least on Linux and OS X it does.
mvn jboss-as:deploy -Djboss-as.hostname=foo ... [ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Final:deploy (default-cli) on project jboss-as-helloworld: Could not execute goal deploy on /home/jperkins/projects/jboss/jdf/quickstart/helloworld/target/jboss-as-helloworld.war. Reason: Host name 'foo' is invalid. Unknown host foo -> [Help 1]
--
James R. Perkins
-
7. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
connie.yang Oct 31, 2012 2:18 PM (in response to jamezp)Thanks.
I got through that point, but came across another problem...
Deployment seems to hang with the following messages and I eventually have to quit it.
[INFO] >>> jboss-as-maven-plugin:7.3.Final:deploy (default-cli) @ mds-parent >>>
[INFO]
[INFO] >>> maven-source-plugin:2.2:jar (attach-sources) @ mds-parent >>>
[INFO]
[INFO] <<< maven-source-plugin:2.2:jar (attach-sources) @ mds-parent <<<
[INFO]
[INFO] --- maven-source-plugin:2.2:jar (attach-sources) @ mds-parent ---
[INFO]
[INFO] <<< jboss-as-maven-plugin:7.3.Final:deploy (default-cli) @ mds-parent <<<
[INFO]
[INFO] --- jboss-as-maven-plugin:7.3.Final:deploy (default-cli) @ mds-parent ---
Oct 31, 2012 10:57:18 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.7.GA
Oct 31, 2012 10:57:18 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.7.GA
Oct 31, 2012 10:57:18 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.12.GA
Authenticating against security realm: ManagementRealm
-
8. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
nickarls Oct 31, 2012 4:36 PM (in response to connie.yang)Did you use the add-user script for adding a user to be used in deployment?
-
9. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
connie.yang Oct 31, 2012 4:57 PM (in response to nickarls)Yes, I did. I created a management user using the add-user when I brought up the admin console.
Here's the mvn command I use
mvn jboss-as:deploy -Djboss-as.hostname=<my-remote-host-name> -Djboss-as.username=<my-management-realm-user> -Djboss-as.password=<my-management-realm-password> -Djboss-as.deployment.filename=<my-war>
Also, another interesting behavior I see is that the plugin assumes the war file sits under the target folder of the maven project that the plugin definition exists. In my case, since I have all my dependencies and build plugins defined in a master/parent pom, the plugin expects to find the war there and it can't find the war file because the only thing I have where my parent pom reside is the the pom itself. Is there a way to work around this?
Thanks,
Connie
-
10. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
nickarls Nov 1, 2012 2:32 AM (in response to jamezp)Must be an old issue since I didn't see those @Parameter annotations on the source for the 7.1.1 AbstractServerConnection
-
11. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
nickarls Nov 1, 2012 2:36 AM (in response to connie.yang)Wonder if this can be applied?
/**
* The target directory the application to be deployed is located.
*/
@Parameter(defaultValue = "${project.build.directory}/", property = "jboss-as.deployment.targetDir")
private File targetDir;
-
12. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
jamezp Nov 1, 2012 11:12 AM (in response to connie.yang)As Nicklas suggests you can use the jboss-as.deployment.targetDir property as well. Another option is to define the plugin in both POM's and have it skip the parent POM.
Parent POM definition:
<plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>${version.org.jboss.as.plugins.maven.plugin}</version> <configuration> <skip>true</skip> </configuration> </plugin>
WAR POM definition:
<plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>${version.org.jboss.as.plugins.maven.plugin}</version> <configuration> <filename>jboss-as-ejb-in-ear.ear</filename> <skip>false</skip> </configuration> </plugin>
--
James R. Perkins
-
13. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
connie.yang Nov 1, 2012 1:19 PM (in response to jamezp)Thank Nicholas and James for your replies. I will give those maven configuration a try. What you suggested makes sense.
WRT jboss-as.deployment.targetDir, is it a URL or a relative path?
Also, do you any suggestion to the appear-to-be hanging war deployment to a remote endpoint? The deployment was successful in the end even though it appears to be "hanging" from the CLI. -
14. Re: How to deploy a WAR to AS 7.1.1-Final running on a remote endpoint?
jamezp Nov 1, 2012 4:35 PM (in response to connie.yang)We had an issue with a hang deploying from 7.2.Final to upstream versions of JBoss AS and JBoss EAP, but I haven't seen any issues with 7.3.Final. I'll give it a shot though and see what happens.
--
James R. Perkins