Java Webアプリケーションでロガーを使用したいと思います。シームはんだ(以前の溶接拡張プロジェクト)は初期化されていません
私はJBossAS 6.0.0.final、cdi(weld)、jsf ...などを使用しています。Seamはんだは、jbossを使って具体的な実装(slf4j、log4jなど)に結びついていない抽象ログを使用することを提案しています。ロギングAPI。あなたのコード内でこのロガーを得るために
は
@ Inject
org.jboss.logging.Logger log
シーム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]
を得るこれは、シームsolder.jarにあるではないMETA-INF/beans.xmlファイルがあり、それがために必要ですCDIコンテナ。
beans.xmlファイルをseam-solder.jarに手動で追加する場合は、アプリケーションが正常に動作します。
ハッキングなしで行う方法は?
私のアプリケーションをビルドするには、私の解決策が快適ではなく、うまくいかないようにmavenを使用します。
PS:以前のweld-extensionsプロジェクトには、jarのMETA-INF/beans.xmlファイルが含まれていました。