Java 重复资源 Wildfly
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28254956/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Duplicate resource Wildfly
提问by Passionate Engineer
I'm getting below error in Wildfly 8.2:
我在 Wildfly 8.2 中遇到以下错误:
05:17:12,202 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
05:17:12,285 INFO [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.2.0.Final "Tweek" starting
05:17:13,199 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 12) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "ExampleDS")
]) - failure description: "JBAS014803: Duplicate resource [
(\"subsystem\" => \"datasources\"),
(\"data-source\" => \"ExampleDS\")
]"
How can I remove duplicate?
如何删除重复项?
回答by DeepNightTwo
This is a bug about jboss. Please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1169239for details.
这是一个关于 jboss 的错误。详情请参考https://bugzilla.redhat.com/show_bug.cgi?id=1169239。
To resolve the problem, try to find and remove the * < app >.war.failed*file.
要解决此问题,请尝试查找并删除* < app >.war.failed*文件。
回答by Brahim Hasni
You can use 2 method in this kind of error :
您可以在这种错误中使用 2 种方法:
- in standalone.xml and remove the duplicate resource or in localhost:19990/console/App.html, you can too remove the duplicate resource
- 在standalone.xml中删除重复的资源或者在localhost:19990/console/App.html中,你也可以删除重复的资源
回答by i2ijeya
Under standalone/configuration/standalone-full.xml remove the duplicate deployment value.
在 standalone/configuration/standalone-full.xml 下删除重复的部署值。
Remove the below if mywar.war is the duplicate one.
如果 mywar.war 是重复的,请删除以下内容。
<deployments>
<deployment name="mywar.war" runtime-name="mywar.war">
<content sha1="d642ffaa51228ab567439653a0923c69b7972cf5"/>
</deployment>
</deployments>
回答by Pankaj Kalra
I also face this same issue, this is bug in JBOSS 8 version for this i follow the below steps to resolve this
我也面临同样的问题,这是 JBOSS 8 版本中的错误,我按照以下步骤解决此问题
- remove *.failed files from deployments folder
comments below lines in standalone.xml file
<extension module="org.wildfly.extension.undertow"/>
- 从部署文件夹中删除 *.failed 文件
在standalone.xml 文件中的行下面的注释
<extension module="org.wildfly.extension.undertow"/>
and this complete subsystem tag
和这个完整的子系统标签
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
</subsystem>
- restart JBoss
- again remove
*.failed
files from deployement folder uncomment step 2 means uncomment this tag
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
- 重启 JBoss
- 再次
*.failed
从部署文件夹中删除文件 取消注释步骤 2 表示取消注释此标签
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
and
和
`<extension module="org.wildfly.extension.undertow"/>`
this line from standalone.xtml.
这行来自standalone.xml。
If you found removed this subsystem tag and above line from standalone.xml then copies these from standalone-full.xhtml.
如果您发现从 standalone.xml 中删除了这个子系统标签和上面的行,那么从 standalone-full.xhtml 复制这些。
- restart the jboss and now this duplicate resource issue is resolved :)
- 重新启动 jboss,现在解决了这个重复资源问题:)
回答by ?ɑ??????
Maybe some .jar was corrupted inside your maven local repository.
也许某些 .jar 在您的 Maven 本地存储库中已损坏。
Delete all in %UserProfile%\.m2\repository
directory, build and try again.
删除%UserProfile%\.m2\repository
目录中的所有内容,构建并重试。
回答by bimal srivastava
I ran into the same issue. wildfly was also creating .failed files in standalone/configuration folder. To fix this,
我遇到了同样的问题。Wildfly 还在独立/配置文件夹中创建 .failed 文件。为了解决这个问题,
i removed all the .failed files.
cleaned up the contents from deployments, tmp and data folders.
started the server without any war/ear deployed. It was able to start clean.
stopped the jboss and added the war/ear and started again
我删除了所有 .failed 文件。
清理部署、tmp 和数据文件夹中的内容。
在没有部署任何战争/耳朵的情况下启动了服务器。它能够开始干净。
停止了 jboss 并添加了战争/耳朵并重新开始
now it works fine. Looks like this is a known issue in WildFly https://issues.jboss.org/browse/WFCORE-495
现在它工作正常。看起来这是 WildFly https://issues.jboss.org/browse/WFCORE-495 中的一个已知问题
Hope this helps..
希望这可以帮助..
If this does not help. Next action to perform would be: - Open the standalone.xml or standalone-full.xml (depending on which one is being used)
如果这没有帮助。下一步要执行的操作是: - 打开 standalone.xml 或 standalone-full.xml (取决于使用的是哪一个)
find deployment-scanner tag. Most certainly it will have two or more entries.
keep the entry mentioned below and remove all others:
找到部署扫描仪标签。肯定会有两个或更多条目。
保留下面提到的条目并删除所有其他条目:
deployment-scanner path="deployments" relative-to="jboss.server.base.dir" ....
部署扫描器路径="部署"相对于="jboss.server.base.dir" ....
clear all the .failed files as well as tmp and data folders.
try now to start jboss wildfly (you can add the war/ear again from eclipse jboss plugin).
清除所有 .failed 文件以及 tmp 和 data 文件夹。
现在尝试启动 jboss wildfly(您可以从 eclipse jboss 插件再次添加 war/ear)。
回答by bü?ra ?elik
Thanks to @i2ijeya, I could solve thr problem.
In my case, the XML block of deploymentswas in standalone/configuration/standalone-full.xml
path.
感谢 @i2ijeya,我可以解决 thr 问题。就我而言,部署的 XML 块在standalone/configuration/standalone-full.xml
路径中。