Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何取消对使用intelliJ IDE构建的Spring MVC应用程序的旧Wildfly 9.0.1部署工件的引用?_Java_Spring_Hibernate_Maven_Intellij Idea - Fatal编程技术网

Java 如何取消对使用intelliJ IDE构建的Spring MVC应用程序的旧Wildfly 9.0.1部署工件的引用?

Java 如何取消对使用intelliJ IDE构建的Spring MVC应用程序的旧Wildfly 9.0.1部署工件的引用?,java,spring,hibernate,maven,intellij-idea,Java,Spring,Hibernate,Maven,Intellij Idea,我正在使用intelliJ-IDE-14创建一个名为app的SpringMVC项目,该项目最初作为app.war部署到JBoss Wildfly 9.0.1.Final上 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "app.war" (runtime-name: "app.war") INFO [org.jboss.as.server.d

我正在使用intelliJ-IDE-14创建一个名为
app
的SpringMVC项目,该项目最初作为
app.war
部署到JBoss Wildfly 9.0.1.Final上

INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "app.war" (runtime-name: "app.war")
INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) WFLYDS0013: Started FileSystemDeploymentService for directory C:\jBoss\wildfly-9.0.1.Final\standalone\deployments
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160:
Failed to mount deployment content
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:95)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156)
... 5 more
Caused by: java.io.FileNotFoundException: C:\project-path\demo\target\app.war (The system cannot find the file specified)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:51)
    at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:254)
    at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:533)
    at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:108)
    at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91)
    ... 6 more

[INFO]...//(omitted for brevity)

ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "app.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"app.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"app.war\".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"app.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160: Failed to mount deployment content
    Caused by: java.io.FileNotFoundException: C:\\project-path\\demo\\target\\app.war (The system cannot find the file specified)"}}
21:08:21,658 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "app.war" (runtime-name : "app.war")
21:08:21,667 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"

INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
20:32:13,137 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
20:32:13,137 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 9.0.1.Final (WildFly Core 1.0.1.Final) started (with errors) in 7442ms - Started 205 of 383 services (1 services failed or missing dependencies, 211 services are lazy, passive or on-demand)
Connected to server
[2015-10-24 08:32:15,100] Artifact demo:war: Artifact is being deployed, please wait...

[INFO]... //(omitted for brevity)

WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"
[2015-10-24 08:32:30,629] Artifact demo:war: Artifact is deployed successfully
Caused by: java.io.FileNotFoundException: C:\project-path\demo\target\app.war (The system cannot find the file specified)
INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "app.war" (runtime-name: "app.war")
以下是导致我的问题的逐步方案

  • 在完成项目配置以利用Maven | Spring | Hibernate | Wildfly | Velocity之后,我制作了一个项目副本,将新副本重构为
    演示
    ,并继续进行
    演示。这样,我就可以随时重复使用
    app
    作为基本的启动模板

  • 完成后,我继续进行演示

  • 我将maven配置为将
    demo的输出war文件命名为
    ROOT.war

  • INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "app.war" (runtime-name: "app.war")
    INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) WFLYDS0013: Started FileSystemDeploymentService for directory C:\jBoss\wildfly-9.0.1.Final\standalone\deployments
    ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160:
    Failed to mount deployment content
    at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:95)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156)
    ... 5 more
    Caused by: java.io.FileNotFoundException: C:\project-path\demo\target\app.war (The system cannot find the file specified)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:51)
        at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:254)
        at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:533)
        at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:108)
        at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91)
        ... 6 more
    
    [INFO]...//(omitted for brevity)
    
    ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "app.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"app.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"app.war\".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"app.war\"
        Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160: Failed to mount deployment content
        Caused by: java.io.FileNotFoundException: C:\\project-path\\demo\\target\\app.war (The system cannot find the file specified)"}}
    21:08:21,658 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "app.war" (runtime-name : "app.war")
    21:08:21,667 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
    WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"
    
    INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
    20:32:13,137 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
    20:32:13,137 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 9.0.1.Final (WildFly Core 1.0.1.Final) started (with errors) in 7442ms - Started 205 of 383 services (1 services failed or missing dependencies, 211 services are lazy, passive or on-demand)
    Connected to server
    [2015-10-24 08:32:15,100] Artifact demo:war: Artifact is being deployed, please wait...
    
    [INFO]... //(omitted for brevity)
    
    WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"
    [2015-10-24 08:32:30,629] Artifact demo:war: Artifact is deployed successfully
    
    Caused by: java.io.FileNotFoundException: C:\project-path\demo\target\app.war (The system cannot find the file specified)
    
    INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "app.war" (runtime-name: "app.war")
    
  • 另外,为了让我不要忘记,我也回到了
    app
    ,并将maven配置为将
    app
    的输出war文件命名为
    ROOT.war

  • INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "app.war" (runtime-name: "app.war")
    INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) WFLYDS0013: Started FileSystemDeploymentService for directory C:\jBoss\wildfly-9.0.1.Final\standalone\deployments
    ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160:
    Failed to mount deployment content
    at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:95)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156)
    ... 5 more
    Caused by: java.io.FileNotFoundException: C:\project-path\demo\target\app.war (The system cannot find the file specified)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:51)
        at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:254)
        at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:533)
        at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:108)
        at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91)
        ... 6 more
    
    [INFO]...//(omitted for brevity)
    
    ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "app.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"app.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"app.war\".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"app.war\"
        Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160: Failed to mount deployment content
        Caused by: java.io.FileNotFoundException: C:\\project-path\\demo\\target\\app.war (The system cannot find the file specified)"}}
    21:08:21,658 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "app.war" (runtime-name : "app.war")
    21:08:21,667 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
    WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"
    
    INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
    20:32:13,137 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
    20:32:13,137 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 9.0.1.Final (WildFly Core 1.0.1.Final) started (with errors) in 7442ms - Started 205 of 383 services (1 services failed or missing dependencies, 211 services are lazy, passive or on-demand)
    Connected to server
    [2015-10-24 08:32:15,100] Artifact demo:war: Artifact is being deployed, please wait...
    
    [INFO]... //(omitted for brevity)
    
    WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."app.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "app.war"
    [2015-10-24 08:32:30,629] Artifact demo:war: Artifact is deployed successfully
    
    Caused by: java.io.FileNotFoundException: C:\project-path\demo\target\app.war (The system cannot find the file specified)
    
    INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "app.war" (runtime-name: "app.war")
    
  • 现在我运行
    demo
    ,它被部署,点击控制器并显示登录页。一切都很好,除了检查日志时,我看到在部署时抛出以下异常

见StackTrace

现在这很奇怪,因为这个文件
app.war
甚至不应该存在于
demo
的上下文中,因为我已经完成了完整的重构。在检查了整个
demo
目录后,没有找到对
app.war
的任何引用,然后我认为这可能只是一个intelliJ引用问题,所以我取消了部署
demo
清理了项目,关闭了intelliJ,删除了.idea文件夹,并从现有源创建了一个新的maven项目。希望这能清除
中可能存在的
演示中的任何残留,我再次运行
,但再次遇到相同的异常

另外,请注意粘贴的StackTrace中的第一行

这表明Wildfly首先尝试部署
app.war
,而应该部署的是
demo.war
,因为我正在运行的是
demo
项目

毕竟,这让我怀疑问题必须在Wildfly的范围内,并且我可能需要删除Wildfly中的某个地方的旧引用,但我对潜在问题的想法迷失了方向。非常感谢您的帮助


谢谢。

已经解决了这个问题。事实证明,这并不是一个特别的intellij问题

出于某种原因,我发现在standalone.xml中,通常在运行时自动添加(并在应用程序停止时自动删除)的以下行只是拒绝执行

<deployments>
    <deployment name="app.war" runtime-name="app.war">
            <fs-archive path="C:\project-path\demo\target\app.war"/>
    </deployment>
</deployments>


所以我就直接进去删除了那些行,所以瞧!错误消失了已经解决了这个问题。事实证明,这并不是一个特别的intellij问题

出于某种原因,我发现在standalone.xml中,通常在运行时自动添加(并在应用程序停止时自动删除)的以下行只是拒绝执行

<deployments>
    <deployment name="app.war" runtime-name="app.war">
            <fs-archive path="C:\project-path\demo\target\app.war"/>
    </deployment>
</deployments>


所以我就直接进去删除了那些行,所以瞧!错误消失了

我也有这个问题,我使用IntelliJ,所以可能是IntelliJ引起的?嗯。。。也许intelli-j负责插入这些行。。。我永远也不会知道,因为这是很久以前的事了,据我所知,这个问题没有再发生过。我在这一节中有5个条目:/我也有这个问题,我使用IntelliJ,所以可能是IntelliJ引起的?嗯。。。也许intelli-j负责插入这些行。。。我永远也不会知道,因为这是很久以前的事了,据我所知,这个问题没有再发生过。我在这一节中有5个条目:/