java WELD-000119:由于底层类加载错误,未生成任何 bean 定义
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36287993/
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
WELD-000119: Not generating any bean definitions from because of underlying class loading error
提问by Maha
I'm new in using MyEclipse and Java EE
我是使用 MyEclipse 和 Java EE 的新手
I'm trying to deploy my web application on wildfly 8.0.0. in MyEclipse.
我正在尝试在 Wildfly 8.0.0 上部署我的 Web 应用程序。在 MyEclipse 中。
Unfortunately, I'm getting this error after I took some code changes from SVN (I'm not sure this is the reason), before that it was working fine:
不幸的是,在我从 SVN 进行了一些代码更改后,我收到了这个错误(我不确定这是不是原因),在此之前它工作正常:
[org.jboss.weld.Bootstrap] (weld-worker-2) WELD-000119: Not generating any bean definitions from (.....) because of underlying class loading error: Type WebArchive from [Module "deployment.Test.war:main" from Service Module Loader] not found. If this is unexpected, enable DEBUG logging to see the full error.
When I (Run) the server, the deployment succeeded although the console produces some lines of the same error, but when i (Debug) the server, it keeps generating the same error.
当我(运行)服务器时,部署成功虽然控制台产生了一些相同的错误行,但是当我(调试)服务器时,它不断产生相同的错误。
Can someone help me please
有人能帮助我吗
Thanks.
谢谢。
采纳答案by Maha
The problem was because I'm starting my server in debug mode and the breakpoints were activated
问题是因为我在调试模式下启动我的服务器并且断点被激活
回答by rakehell
It may be that the class loader can't find "WebArchive" because it needs to be added as a module to the WildFly configuration. You do that like this:
可能是类加载器找不到“WebArchive”,因为它需要作为模块添加到 WildFly 配置中。你这样做:
module add --name=org.apache.commons.lang3.commons-lang3 --resources=C:\Users\b\.m2\repository\org\apache\commons\commons-lang3.4\commons-lang3-3.4.jar
In addition, you'll probably need to add WebArchive as a dependency in the <build>
section of your pom.xml.
此外,您可能需要在<build>
pom.xml 部分添加 WebArchive 作为依赖项。
Here's the relevant section of my pom.xml:
这是我的 pom.xml 的相关部分:
<build>
<!-- Maven will append the version to the finalName (which is the name
given to the generated WAR, and hence the context root) -->
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${version.war.plugin}</version>
<configuration>
<!-- Java EE doesn't require web.xml, Maven needs to catch up! -->
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifestEntries>
<Dependencies>com.fasterxml.Hymanson.datatype.Hymanson-datatype-jsr310,org.hibernate,org.apache.commons.lang3.commons-lang3</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
<!-- The WildFly plug-in deploys the WAR to a local WildFly container -->
<!-- To use, run: mvn package wildfly:deploy -->
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
</plugin>
</plugins>
</build>
If you can't figure it out, try posting your pom.xml and jboss-deployment-structure.xml (if you have one).
如果您无法弄清楚,请尝试发布您的 pom.xml 和 jboss-deployment-structure.xml(如果您有的话)。
回答by user140547
This error message does not hint to start your server in debug mode, but to set the log level of org.jboss.weld.Bootstrap or the root logger to debug. See WildFly 8 Logging Levelsfor how to do that
此错误消息并不暗示以调试模式启动您的服务器,而是将 org.jboss.weld.Bootstrap 或根记录器的日志级别设置为调试。请参阅WildFly 8 Logging Levels了解如何做到这一点