The inimitable Bruno Borges picked up tweet earlier today commenting on a problem using @Produces with non-CDI libraries with WebLogic Server 12.1.3.
The tweeter put his example up on a github repository to share - quite a nice example of using JAX-RS, CDI integration and of using Arquillian to verify it works correctly. Ticked a couple of boxes for what I've been looking at lately
Forking his project to have a look at it locally:
https://github.com/buttso/weblogic-producers
Turns out that the issue was quite a simple and common one - a missing
reference to the jax-rs:2.0 shared-library that is needed to use JAX-RS
2.0 on WebLogic Server 12.1.3. Needs a weblogic.xml to reference that library.
I made the changes in a local branch and tested it again:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] producers .......................................... SUCCESS [ 0.002 s]
[INFO] bean ............................................... SUCCESS [ 0.686 s]
[INFO] web ................................................ SUCCESS [ 7.795 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
With the tests now passing, pushed the branch to my fork and sent Kuba a pull request to have a look at the changes I made:
https://github.com/buttso/weblogic-producers/tree/steve_work
I now just hope it works in his environment too :-)
The GitHub model is pretty magical really.
No comments:
Post a Comment