• Programmatically added observer methods and lifecycles

    I had a question about what happens when you programmatically add an observer method to a bean.   In my case, I am programmatically adding an observer method that @Observes @Initialized(ApplicationScoped.class) ...
    Profile Photo
    last modified by ljnelson
  • What's the difference between @Singleton and @ApplicationScoped? Confused.

    public static void main(String[] args) {   CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();    cdiContainer.boot();    // Starting the application-context enables use of @A...
    Profile Photo
    last modified by seto
  • ObservesAsync: reception not guaranteed?

    I have a bean like this:   @ApplicationScoped public class Foo {    private Bar bar;    @Inject    public void initMethod(final Bar bar) {      System.out.println...
    Profile Photo
    last modified by ljnelson
  • Can Weld Cdi omit @Inject annotation in favour of HK2

    Hello Discussion is moved from here. I really wanted to make things simple but it seems that it is not possible to not give more details.   I am operating on glassfish 4.1.1 using WELD-000900: 2.2.13 (Final), d...
    Profile Photo
    last modified by maciekjboss
  • Beans with a dependent scope and an observer method - weird behavior

    Considering the following environment: Weld SE (2.4.0) A Main class starting Weld SE An application scoped class named Application A dependent scope class named Child   And the following binding: Applicati...
    Profile Photo
    last modified by steappe
  • Assisted injection - I have a working prototype, but...

    I'm currently in the process of integrating a DI framework in an old Java SE legacy application. As you can imagine, this application has many classes with multiple constructors that are not eligible for injections. A...
    Profile Photo
    last modified by steappe
  • Adding an annotation to a method via an extension: surprises

    For posterity I thought I would record this here.   I am futzing around with an extension that programmatically turns JSR-330 Providers into producer methods.  I am not entirely sure where I'm going with th...
    Profile Photo
    last modified by ljnelson
  • AnnotatedTypeConfigurator::add: what is this supposed to do?

    The documentation on the AnnotatedTypeConfigurator::add method says, in total: Add an annotation to the field. What field?  I thought AnnotatedType represented a, well, type.   Best, Laird
    Profile Photo
    last modified by ljnelson
  • Should CDI.current() work in code called by a portable extension?

    Admittedly I am deep in the weeds here.  This is with Weld SE 3.0.0.Alpha17.   I am writing a portable extension that is reacting to the AfterDeploymentValidation event.  This means the container, so f...
    Profile Photo
    last modified by ljnelson
  • In a Portable Extension, how do I obtain an instance of the bean required to be created for it?

    I am in a portable extension.  I am aware that when my extension is instantiated, it is via the ordinary old ServiceLoader mechanism; consequently, my default constructor is called and obviously no dependency inj...
    Profile Photo
    last modified by ljnelson
  • Updating WELD in glassfish 4

    Hi there,   I would like to upgrade the version of WELD glassfish 4.1.1 uses.  I've done this before for glassfish 3.1.1, but it was a long time ago, my memory is foggy.  I know normally you need to ov...
    Profile Photo
    last modified by bobbotron
  • Inject custom security principal (via login module)

    Hello   I am part of a team developing a thin framework to provide some basic JavaEE features for you applications (web & ejb). Part of this framework includes a custom Wildfly login module, which createa a...
    Profile Photo
    last modified by mimra
  • Specializing a bean you don't control?

    How do you specialize a bean you don't control? I hope this is a sensible question.   What I mean is: suppose a colleague hands me a bean archive with a FrobnicatorImpl bean in it (that implements Frobnicator). ...
    Profile Photo
    last modified by ljnelson
  • Accessing class annotation on a Weld-made proxy?

    (This is tangentially related to WELD-1131 and this forum thread.)   When Weld hands me a bean instance, and I want to inspect that instance's class for a class-level annotation, I cannot, because the class of t...
    Profile Photo
    last modified by ljnelson
  • TypeLiteral and Instance::select(TypeLiteral): limitations?

    (I have also asked this question on StackOverflow.) Suppose I have an interface like this: public interface Converter<T> { /*...*/ }And suppose in a CDI environment I have successfully done this: @Inject @Any pr...
    Profile Photo
    last modified by ljnelson
  • WELD-001456: Argument resolvedBean must not be null?

    Hello; I'm using Weld 3.0.0 Alpha17 (using it in a unit test, so Weld SE, if it matters).   I have a @Produces method annotated like this:   @Produces @Dependent @Foo public String getFoo(final InjectionPoi...
    Profile Photo
    last modified by ljnelson
  • org.jboss.jandex.Index cannot be cast to org.jboss.jandex.IndexView

    I am getting an error when I try to initialize a WeldContainer:   java.lang.ClassCastException: org.jboss.jandex.Index cannot be cast to org.jboss.jandex.IndexView     at org.jboss.weld.environme...
    Profile Photo
    last modified by brucespringfield
  • WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped

    I have class that is injecting another class that is @ApplicationScoped and am getting this error:   org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enter...
    Profile Photo
    last modified by brucespringfield
  • Working with huge class hierarchy

    Hello,   I have a huge class hierarchy and the child class has to be decorated. There are no big methods in classes, but ca. 1800 methods in total. In ProxyFactory I get the exception   java.lang.RuntimeEx...
    Profile Photo
    last modified by jackdan
  • how do I get the container?

    I have the id of the running container through getRunningContainerIds(). But now that I have the id of the container, how do I grab the container itself?
    Profile Photo
    last modified by brucespringfield