• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rob Isaacs
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 263
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks to be a bug, there are several patches for CDI for 12.1.1

You need to connect to MOS
 
Rob Isaacs
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 263
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 263
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
probably, there is another patch that resolves all the issues (accumulative patch).
I've seen similar situations before.
 
Alexandru Iovan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 263
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic