我已經配置在Maven的插件,如下圖所示:的JBoss AS 7自動部署插件無法連接到本地主機:8080
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.0.2.Final</version>
<configuration>
<hostname>localhost</hostname>
<port>8080</port>
<filename>target/TestApp.war</filename>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
然後我用用
mvn -U clean install package
它建立行家觸發它並且一切正常,但在啓動自動部署時失敗。
INFO]
INFO] --- jboss-as-maven-plugin:7.0.2.Final:deploy (default) @ TestApp ---
INFO] Executing goal deploy on server localhost (127.0.0.1) port 8080.
9-Feb-2012 16:18:46 org.jboss.remoting3.EndpointImpl <clinit>
NFO: JBoss Remoting version 3.2.0.Beta2
9-Feb-2012 16:18:46 org.xnio.Xnio <clinit>
NFO: XNIO Version 3.0.0.Beta2
9-Feb-2012 16:18:46 org.xnio.nio.NioXnio <clinit>
NFO: XNIO NIO Implementation Version 3.0.0.Beta2
INFO] ------------------------------------------------------------------------
INFO] BUILD FAILURE
INFO] ------------------------------------------------------------------------
INFO] Total time: 58.768s
INFO] Finished at: Thu Feb 09 16:18:52 GMT 2012
INFO] Final Memory: 7M/18M
INFO] ------------------------------------------------------------------------
ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.0.2.Final:deploy (default) on project TestApp: Could not execute goal deploy on TestApp.war. Reason: Could not connect to remote://localhost:8080 in 5000ms. Make sure the server is running and/or consider setting a longer timeout by setting -Dorg.jboss.as.client.connect.timeout=<timeout in ms>. -> [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]
該錯誤似乎表明它無法連接到localhost:8080上的應用程序服務器。它正在運行,我可以訪問它。有任何想法嗎?
JBoss應用服務器版本7.0.2 Maven的版本是3.0.4
謝謝@詹姆斯。你說得對,我正在使用錯誤的端口號。你的文件名也是正確的,因爲我必須按照你的描述改變它。 - 謝謝 – ziggy 2012-02-10 09:09:56
@ziggy沒問題。我很高興它爲你工作。 – 2012-02-10 16:52:38