简体   繁体   English

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

[英]JBoss AS 7 auto deploy plugin cannot connect to localhost:8080

I have configured the plugin in maven as shown below: 我在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>

I then trigger it using maven using 然后我使用maven触发它

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. 该错误似乎表明它无法连接到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 JBoss Application Server版本是7.0.2 Maven版本是3.0.4

By default port 8080 is not the management port. 默认情况下,端口8080不是管理端口。 The plugin requires you to use the management which is 9999 by default. 该插件要求您使用默认的9999管理。

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. 在大多数情况下,甚至不需要使用filename元素。 The plugin will assume the file name is the ${project.build.finalName}.${project.packaging} by default, which will likely work in your case. 默认情况下,该插件将假定文件名为${project.build.finalName}.${project.packaging} ,这可能适用于您的情况。

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>

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

I had a very similar situation and solved it by simply editing standalone.xml file to add a proper socket-binding for management interface. 我有一个非常相似的情况,只需编辑standalone.xml文件就可以为管理界面添加一个合适的socket-binding来解决它。

You can check out more at my blog . 您可以在我的博客上查看更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM