Giter Club home page Giter Club logo

Comments (11)

bbilger avatar bbilger commented on June 14, 2024

Hi @marciodel ,
Can you provide some minimal example, then I'll check.
Isn't it sufficient when the package (jar/zip) you create contains META-INF/beans.xml?

Thanks!

from jrestless.

marciodel avatar marciodel commented on June 14, 2024

Hi @bbilger,

I have included "org.jboss.weld.se:weld-se-core:2.4.2.SP1" and "org.glassfish.jersey.ext.cdi:jersey-weld2-se:2.25.1" in my project dependencies .

In the request handler I have added Weld initialization.

		Weld weld = new Weld();
		weld.initialize();
		
               config = new JAXRSApplication().register(GatewayFeature.class);

		init(config); 
		start();

Adding META-INF/beans.xml in each .jar made it work. I've dowloaded the project and made the changes to include it.

I'm not a CDI expert, just a regular user. :) But what I've understood is that Weld (I don´t know about other CDI implementation) scans the .jar implementations that contains the META-INF/beans.xml.

Best regards

from jrestless.

bbilger avatar bbilger commented on June 14, 2024

Hi @marciodel ,
Thanks!
I am a little busy at the moment but I will try to take a look as soon as possible.

from jrestless.

marciodel avatar marciodel commented on June 14, 2024

Just a remark. I am deploying to AWS lambda a zip file containing a lib folder with the dependencies inside it.

my.zip:
   com/
      ... 
   lib/
      *.jar

from jrestless.

marciodel avatar marciodel commented on June 14, 2024

Thanks!

Take your time. I have managed to make my project work with those changes.

Congratulations for this great project!

from jrestless.

bbilger avatar bbilger commented on June 14, 2024

I think I found the issue: the filters injected the request using @Inject which does not seem to work when using CDI/Weld (http://stackoverflow.com/questions/13419887/injection-of-httpservletrequest/13420108#13420108). So I switched to inject it using @context (I used @Inject by mistake).
As far as I can see so far we do not need to have a beans.xml in every module.

(I hope to be finally able to release JRestless 0.5.0 at the end of this week or at the beginning of next week; I will provide an example for CDI afterwards - will leave the bug open until then)

from jrestless.

bbilger avatar bbilger commented on June 14, 2024

Hi @marciodel ,
I just released 0.5.0 including this fix and added a CDI/Weld example: https://github.com/bbilger/jrestless-examples/tree/master/aws/gateway/aws-gateway-cdi

Hope this solves your problem!

from jrestless.

bbilger avatar bbilger commented on June 14, 2024

assuming fixed - if not, then please re-open

from jrestless.

marciodel avatar marciodel commented on June 14, 2024

Hi bbilger, sorry for the delayed answer. I was on vacation. I'll test it and provide a feedback as soon as possible. Thanks!

from jrestless.

marciodel avatar marciodel commented on June 14, 2024

I've tested with the version 0.5.1 and it is working flawlessly.

Thanks!

from jrestless.

bbilger avatar bbilger commented on June 14, 2024

Hi @marciodel ,
thanks for the feedback.

from jrestless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.