wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes WebLogic 12c: beans.xml breaks MDB / EJB injection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "WebLogic 12c: beans.xml breaks MDB / EJB injection" Watch "WebLogic 12c: beans.xml breaks MDB / EJB injection" New topic
Author

WebLogic 12c: beans.xml breaks MDB / EJB injection

Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
For a first WebLogic test, I have setup a WAR project. Inside this WAR I have some servlets, stateless and singleton beans, and an MDB. These work just fine.

However, as soon as I add a beans.xml file (empty apart from the root element) to the WEB-INF folder, most of this breaks:
- @EJB annotations inside my servlets don't work anymore. All fields annotated with @EJB remain null. If I switch those to @Inject I get the following error:
WELD-001408 Unsatisfied dependencies for type [TestDAO] with qualifiers [@Default] at injection point [[field] @Inject private nl.isaac.test.TestServlet.testDAO]
I can work around this by adding @ManagedBean to the servlets but that should not be necessary.

- My MDB stops working completely. The sending code doesn't fail, but the MDB is never triggered again. My MDB annotation:
My sending code:


My question: why do these two things break when I add a beans.xml file, and more importantly, how can I solve this.
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 155

It looks to be a bug, there are several patches for CDI for 12.1.1

You need to connect to MOS


http://devwebcl.blogspot.com/
Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
We're using the latest version, 12.1.2.1. I don't think the 12.1.1 patches will work on that.

And can you tell me what MOS is?
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 155

yes, a patch for 12.1.1 only works for that version, however a patch could exist for different WLS versions (different files).

MOS = My Oracle Support.

There are patches for CDI issues, in particular one similar for CDI when beans.xml is added to META-INF



Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
Apparently this is indeed a bug in WL 12.1.2. According to http://balusc.blogspot.nl/2013_09_01_archive.html:
The WebLogic guys were however very supportive and mentioned that this problem is already identified and fixed in upcoming 12.1.3. Commercial WebLogic 12.1.2 users can currently patch their server with patch ID 16785005 (which they can download by going to https://support.oracle.com and then go to the patches section). After that, all CDI features work flawlessly.

Now I just have to wait for our client to provide us with their support information...
Rob Isaacs
Greenhorn

Joined: Mar 12, 2014
Posts: 20
Right, I've installed the patch, and I can now inject beans (using @Inject in servlets, @EJB still won't work). JMS still doesn't work though, but we may be able to live with that.
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 155

probably, there is another patch that resolves all the issues (accumulative patch).
I've seen similar situations before.
Alexandru Iovan
Greenhorn

Joined: Jun 02, 2014
Posts: 4
Hello,

I have a similar problem, but i am not able to find the patch 16785005 (or a similar one oriented on this problem) when browsing through Oracle Support, Patches section. Can you point me in the right direction? Please and thank you.
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 155

Alexandru Iovan wrote:Hello,

I have a similar problem, but i am not able to find the patch 16785005 (or a similar one oriented on this problem) when browsing through Oracle Support, Patches section. Can you point me in the right direction? Please and thank you.


The best will be to create an SR.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebLogic 12c: beans.xml breaks MDB / EJB injection
 
Similar Threads
Error while using MDB with JMS
Handle Exceptions in MDB (EJB) [how to handle the exceptions control before coming to MDB ]
Who creates destination Queueor Topic
problemwith MessageDriven Bean
I can't see ejbCreat(),ejbRemove or initialize() methods in this MDB.