JBoss AS 7 自动部署插件无法连接到 localhost:8080

发布于 2025-01-03 16:56:31 字数 2508 浏览 4 评论 0原文

我已经在 Maven 中配置了插件,如下所示:

<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>

然后我使用 Maven 使用它触发它,

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

I have configured the plugin in maven as shown below:

<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>

I then trigger it using maven using

mvn -U clean install package

It does build and everything works fine but fails when it starts the auto deployment.

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]

The error seems to suggest that it could not connect to the application server on localhost:8080. It is running and i can access it. Any ideas?

JBoss Application Server version is 7.0.2
Maven version is 3.0.4

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

笔芯 2025-01-10 16:56:31

默认情况下,8080 端口不是管理端口。该插件要求您使用默认为 9999 的管理。

此外,您的文件名元素也不太正确。在开头添加target会导致找不到文件。

该插件默认在构建目录中查找文件名。在大多数情况下,甚至不需要使用文件名元素。默认情况下,该插件将假定文件名是 ${project.build.finalName}.${project.packaging},这可能适用于您的情况。

假设您没有更改默认管理端口,您希望它看起来像这样。

<plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.0.2.Final</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                </execution>
            </executions>
</plugin>

By default port 8080 is not the management port. The plugin requires you to use the management which is 9999 by default.

Also your filename element isn't quite right. Adding target at the beginning will cause the file not to be found.

The plugin looks in the build directory by default for the file name. In most cases the filename element doesn't even need to be used. The plugin will assume the file name is the ${project.build.finalName}.${project.packaging} by default, which will likely work in your case.

Assuming you haven't changed the default management port you'd want it to look something like this.

<plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.0.2.Final</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                </execution>
            </executions>
</plugin>
逆蝶 2025-01-10 16:56:31

根据这个页面,您不应该指定Web端口(8080),但是管理端口(默认为 9999),这是用于部署的端口。

According to this page, you should not specify the web port (8080), but the administration port (defaults to 9999), which is the one used for deployments.

暖伴 2025-01-10 16:56:31

我遇到了非常相似的情况,并通过简单地编辑 standalone.xml 文件来为管理界面添加适当的socket-binding 来解决它。

您可以在我的博客查看更多信息。

I had a very similar situation and solved it by simply editing standalone.xml file to add a proper socket-binding for management interface.

You can check out more at my blog.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文