Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDI Support for the Jersey/JAX-RS container? #20

Closed
dasniko opened this issue Apr 3, 2017 · 7 comments
Closed

CDI Support for the Jersey/JAX-RS container? #20

dasniko opened this issue Apr 3, 2017 · 7 comments

Comments

@dasniko
Copy link

dasniko commented Apr 3, 2017

Ok guys, this is really awesome!
Thanks for doing this.

I've got the Spring integration up and running in minutes. It really works like a charme with all the Spring functionality included like autowiring etc.

The Jersey/JAX-RS integration also works quite good, but I would love to see some CDI support here as well. Is this somehow possible to provide a simple/small/lightweight CDI integration with Weld, Guice or something similar?

thx + regards,
Niko

@sapessi
Copy link
Collaborator

sapessi commented Apr 3, 2017

Hi Niko,

Thanks for the compliments and feedback. I will look into this. To help us narrow down the scope for a first release, is there something specific you are looking for? Could you give us some mock code of how you would like your tests to work like?

S

@dasniko
Copy link
Author

dasniko commented Apr 3, 2017

Hi @sapessi,
thanks for your quick reply.

Meanwhile, I started to implement the aws-serverless-java-container-jersey with some jersey-weld2-se here: https://github.com/serverlessbuch/lambda-jaxrs-cdi
(this is the repository for my upcoming book on serverless computing, but german-language only)

However, the unit-tests work fine, even with CDI.
But as soon as I run it on AWS Lambda (through API Gateway), I run into a timeout and get some long logs. Currently I've no real idea what this might be. Perhaps you can test my implementation and reproduce the behaviour? Then, we can go any further with my example as a start!?

N.

@dasniko
Copy link
Author

dasniko commented Apr 24, 2017

I got my example now working with Weld as CDI implementation.
This works very well, but I have to build it with Gradle. As soon I build it with Maven, Weld won't work.

Yet, I don't know why this occurs, but I keep investigating and will compare classpaths...

@sapessi
Copy link
Collaborator

sapessi commented Apr 24, 2017

Let me know how it goes. I'll pick this issue up after I've added support for the Play framework.

@dasniko
Copy link
Author

dasniko commented Apr 25, 2017

With the help from @bbilger, who has a similar project as yours https://github.com/bbilger/jrestless we found the solution in proper configuration of beans.xml, @...Scoped annotations and extended maven-shade-plugin: bbilger/jrestless-examples#9 (comment)

I've updated my above mentioned project and it's working pretty good.

@sapessi
Copy link
Collaborator

sapessi commented May 18, 2017

ah, good to hear. I'll keep this open to see if there is something we can include in the project to make the process easier. If not, I'll at least update the wiki to document this.

@sapessi
Copy link
Collaborator

sapessi commented Mar 15, 2018

In the 1.0 release of the library, we updated Jersey to 2.6. The latest version of Jersey can support multiple CDI methods. Resolving this.

@sapessi sapessi closed this as completed Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants