0

我正在尝试在 Weblogic 10.3 上运行基于 Weld、JPA2、Vaadin 的应用程序。

我的问题是 Weld 似乎注册了所有 Bean,但它们没有注入到我的 servlet 中。

以下日志消息是可疑的:

1433 [[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO  org.jboss.weld.environment.gwtdev.GwtDevHostedModeContainer  - Jetty detected, JSR-299 injection will be available in Servlets and Filters. Injection into Listeners is not supported.
30.08.2012 16:09:20 org.jboss.weld.environment.jetty.MortbayWeldServletHandler process
INFO: Cannot find matching WebApplicationContext, no default CDI support: use jetty-web.xml

基本上我关注了这个博客: http: //jianmingli.com/wp/ ?p=4373进行焊接集成。

可能我需要根据http://docs.jboss.org/weld/reference/1.0.0/en-US/html/environments.html#d0e5036配置beanmanager,但我不知道如何。

有没有人有任何想法?

/亲切的问候

4

1 回答 1

1

did you do these steps speechified in tutorial?

  • You have to place beans.xml in src/META-INF. Place it in WEB-INF won't work.
  • You have to create a weblogic.xml in WEB-INF directory and set wls:prefer-web-inf-classes to true. Otherwise, WEB-INF/lib jar files won't get loaded properly.

Weblogic is a wired App server! I'm using the version 12.1.1 and have many problems with CDI !

If reading that tutorial is for learning purposes I suggest not to use Weblogic, use Glassfish of jBoss AS instead.

JBoss developer framework has many great examples and tutorials in this scope.

于 2012-08-30T20:45:50.710 回答