接缝焊料(以前的焊接扩展项目)未初始化
我想在我的 java web 应用程序中使用记录器。
我正在使用 JBossAS 6.0.0.final、cdi (weld)、jsf ...等。Seam焊接建议使用抽象记录器,而不是使用jboss-logging api绑定到具体实现(slf4j、log4j等)。
为了在您的代码中获取此记录器,需要编写
@ Inject
org.jboss.logging.Logger log
具有此记录器生产者的seam-solder.jar。
package org.jboss.seam.solder.log;
...
class LoggerProducers
{
@ Produces
org.jboss.logging.Logger produceLog (InjectionPoint injectionPoint) {}
}
当我部署我的应用程序时,出现错误
15:51:18,300 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///C:/Java/jboss-6.0.0.Final/server/default/deploy/kamis-web-client.5.0.0-SNAPSHOT.ear_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private ru.kamis.suite.webclient.web.breadcrumbs.BreadcrumbsManager.log]
这是由于 seam-solder.jar 没有 META-INF/beans.xml 文件,而它是 cdi 容器所必需的。
如果手动在seam-solder.jar中添加beans.xml文件,那么应用程序可以正常工作。
没有黑客怎么办?
为了构建我的应用程序,我使用 Maven,所以我的解决方案不舒服而且不好。
PS:以前的焊接扩展项目在 jar 中包含 META-INF/beans.xml 文件。
I want to use logger in my java web application.
I'm using JBossAS 6.0.0.final, cdi (weld), jsf ... etc. Seam solder proposes to use an abstract logger is not tying to a concrete implementation (slf4j, log4j, etc) using jboss-logging api.
In order to get this logger in your code will need to write
@ Inject
org.jboss.logging.Logger log
seam-solder.jar has the producer for this logger.
package org.jboss.seam.solder.log;
...
class LoggerProducers
{
@ Produces
org.jboss.logging.Logger produceLog (InjectionPoint injectionPoint) {}
}
When I deploying my application, I get an error
15:51:18,300 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///C:/Java/jboss-6.0.0.Final/server/default/deploy/kamis-web-client.5.0.0-SNAPSHOT.ear_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private ru.kamis.suite.webclient.web.breadcrumbs.BreadcrumbsManager.log]
This is due to the seam-solder.jar has not META-INF/beans.xml file, and it is necessary for cdi container.
If to add beans.xml file in seam-solder.jar manually, then the application works WELL.
How to do without hacks?
To build my application I use maven, so my solution is not comfortable and NOT fine.
PS: Former weld-extensions project contained META-INF/beans.xml file in jar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用seam-solder-3.0.0.Beta1 应该不需要修改jar
with seam-solder-3.0.0.Beta1 there should be no need to modify the jar