gpt4 book ai didi

eclipse - 部署目录中的war文件名错误

转载 作者:行者123 更新时间:2023-12-01 03:36:36 26 4
gpt4 key购买 nike

我在访问时收到“404 Not found”错误消息:
http://localhost:8080/bword在 Eclipse 中。

此应用程序在 Wildfly 中提供。在 POM.xml 中,它定义了:

<artifactId>bword</artifactId>
<packaging>war</packaging>
<name>bword</name>

然而,奇怪的是,当我在 Eclipse 中运行应用程序并将 Wildfly 9.0 配置为服务器时,部署到 wildfly/standone/deployments/的是 bbword.war,如下所示:
[abigail@localhost wildfly-9.0.2.Final]$ ls standalone/deployments/
bbword.war/ bbword.war.deployed

这是错误的,应该是“bword.war/”和“bword.war.deployed”。

在Eclipse之外,如果我在项目“bword”下“mvn clean package”,我可以得到target/目录下的“bword.war”。

请参阅附件截图以供引用。我怀疑在我的 pom、eclipse 或任何地方的某个地方,“bbword”而不是“bword”的配置错误,但我真的找不到它。我找不到任何“bbword”的痕迹。部署下部署的war文件的名称是什么?

见附件。

enter image description here

编辑(POM.xml 的一部分):
<build>
<!-- Set the name of the war, used as the context root when the app
is deployed -->
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${version.war.plugin}</version>
<configuration>
<!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! -->
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!-- WildFly plugin to deploy war -->
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
</plugin>
<!-- Compiler plugin enforces Java 1.6 compatibility and activates
annotation processors -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</build>

补充一点:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
17:32:35,508 INFO [org.jboss.modules] (main) JBoss Modules version 1.4.3.Final
17:32:35,702 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
17:32:35,761 INFO [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: WildFly Full 9.0.2.Final (WildFly Core 1.0.2.Final) starting
17:32:36,573 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 22) WFLYCTL0028: Attribute 'job-repository-type' in the resource at address '/subsystem=batch' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
17:32:36,594 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found bbword.war in deployment directory. To trigger deployment create a file called bbword.war.dodeploy
17:32:36,625 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
17:32:36,647 INFO [org.xnio] (MSC service thread 1-5) XNIO version 3.3.1.Final

......

这是我在 Wildfly 上单击“作为服务器运行”后控制台消息的最初部分。似乎显示“在部署目录中找到 bbword.war”。在运行它之前,我删除了 standalone/deployments/* 中的所有内容。它从一个空目录开始。每当我运行服务器时,似乎“bbword.war”都会被复制到这个目录中。我想不通。我在我的电脑上使用“find/-name bbword.war”但是找不到这个文件。真的很纳闷。

更新:

最终发现了问题:在项目'bword'下,有一个“.setting”目录,里面有这个文件:
bword/.settings/org.eclipse.wst.common.component

其中有一行: ,其中“bbword”是我之前使用的部署名称。删除此目录并在 Maven 中运行“更新”似乎可以解决此问题。特别是我需要两者都做,先删除这个目录,.setting,然后更新maven。

浪费了几天时间,但很高兴知道这一点。

最佳答案

有同样的问题并通过更正这两个文件来修复它:

.settings/org.eclipse.wst.common.component
=> 部署名称等

。项目
=>名称

关于eclipse - 部署目录中的war文件名错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34237534/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com