Questions tagged [bean-manager]

Allows a portable extension to interact directly with the container. Provides operations for obtaining contextual references for beans, along with many other operations of use to portable extensions.

public interface BeanManager Allows a portable extension to interact directly with the container. Provides operations for obtaining contextual references for beans, along with many other operations of use to portable extensions.

Any bean may obtain an instance of BeanManager by injecting it:

@Inject BeanManager manager;

Java EE components may obtain an instance of BeanManager from JNDI by looking up the name java:comp/BeanManager.

Any operation of BeanManager may be called at any time during the execution of the application.

10 questions
8
votes
2 answers

How to pass an Annotation as a parameter?

The CDI class BeanManager has several methods which take parameters of type Annotation or Annotation.... For example BeanManager.getBeans(...). I would like to know how I'm supposed to pass my annotations as parameters to those methods. I've tried…
noone
  • 19,520
  • 5
  • 61
  • 76
4
votes
1 answer

Unable to find CDI BeanManager in a basic JSF project

I'm trying to set up a basic project using JSF (using IntelliJ's default "hello world" project), but I keep on getting a javax.faces.FacesException: Unable to find CDI BeanManager exception when deploying to GlassFish. Is there something I forgot…
hummusw
  • 123
  • 2
  • 7
2
votes
1 answer

using Java EE BeanManager as Singleton

In my Java EE aplication I use the following snippet to obtain BeanManager public static BeanManager getBeanManager() { try { InitialContext initialContext = new InitialContext(); return (BeanManager)…
0
votes
0 answers

Can you programmatically switch between existing Session Contexts

I have multiple existing Stateful Session Beans. I want to use a new library/framework that instantiates objects (outside the container manager). This framework does not conceptually have 'sessions'. I'm trying to develop a proof of concept to route…
0
votes
1 answer

BeanManager is not boud in this Context

We took ownership of a java web application that current runs in WebLogic. We're now trying to deploy this in Tomcat using OCP. When we drop the .war file into the Tomcat/webapps directory, the application did not start and the error we received…
escee999
  • 109
  • 2
  • 10
0
votes
0 answers

How to manually inject dependencies into a bean in a AfterBeanDiscovery event listener (CDI)

I am using CDI 1.2 (Weld 2.3.5) and want to manually instantiate a bean and inject its dependencies during an AfterBeanDiscovery event listener. I'm expecting that this would allow me to ensure that its Initialization would precede the…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
0
votes
1 answer

How to retrieve a bean by classname from CDI BeanManager? (an not any children)

I'm trying to understand a snippet of code and don't understand the documentation for CDI BeanManager Bean resolve(Set> beans) Apply the ambiguous dependency resolution rules to a set of beans. What are the ambiguous dependency resolution…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
0
votes
1 answer

Bean not found by its interface after migration to WildFly

After the migration of a JEE application (from JBoss 7.1.1 to WildFly 8.2.1) our method to get CDI Beans stopped working. The application have several modules (independent JAR files) grouped into one WAR file deployed now on WildFly. The Bean to be…
Daniel Rodríguez
  • 548
  • 1
  • 10
  • 30
0
votes
0 answers

IntelliJ IDEA + Tomee 1.7.1 - Bean Manager not found error

I'm getting a strange error when starting up tomee in IntelliJ and deploying my web app (as war). I'm not referencing any bean manager or weld classes in my pom.xml file and so far this is just a "bare bones" web application that I'm using to try…
Nena
  • 681
  • 1
  • 10
  • 27
0
votes
1 answer

Websphere V8.5 get BeanManager over JNDI

I have a custom ConstraintValidatorFactory which shall get a BeanManager over JNDI. I use a custom factory to inject ressources in my validator classes. The application getting deployed on a Websphere V8.5. But when i use my validator the injected…
nik the lion
  • 458
  • 1
  • 9
  • 22