weld

How to retrieve all existing long-running conversations in Weld?

我的未来我决定 提交于 2019-12-11 11:26:03
问题 I'm writing application in JBoss 7.1.1.Final, Weld, Seam 3. I have following bean: @ConversationScoped public class ConversationBean implements Serializable { @Inject Conversation conversation; private Article article; ... } Now, the user might create multiple conversations, each conversation will be associated with the instance of ConversationBean. I need to be able to get all those instances that are associated with long-running conversation. The reason why I need an access to them is that

Omnifaces 2.x fails when used in a Spring Boot environment with Weld

筅森魡賤 提交于 2019-12-11 03:14:30
问题 Finally I successfully bootstrapped Weld in a Spring Boot environment as explained here. CDI works with no problem both for JSF using Mojarra and for Web Services using Jersey. But now I encountered a problem when trying to include Omnifaces 2.6 in my application. My application start fails with this message: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly. at com.sun.faces.config.processor.FactoryConfigProcessor

Why are Producers not inherited in CDI

痞子三分冷 提交于 2019-12-11 01:32:17
问题 Given the following classes private static class ProducedInSubClass { } private static class ProducedInSuperClass { } public static class SuperClass { @Produces public ProducedInSuperClass producedInSuperClass = new ProducedInSuperClass(); } public static class SubClass extends SuperClass { @Produces ProducedInSubClass producedInSubClass = new ProducedInSubClass(); } public static class BeanWithSubClass { @Inject SubClass subClass; @Inject ProducedInSuperClass producedInSuperClass; @Inject

how to embed weld into jetty 9 to have cdi in my java maven project?

社会主义新天地 提交于 2019-12-11 00:35:20
问题 I have a JEE7 project using CDI. I want to test that project on Jetty 9, which implements Java EE 7 Web Profile. The following link indicate that we can plug Weld into Jetty, but how ? Thanks EDIT: And, how do that with jetty-maven-plugin ? Jetty and Java EE 7 Web Profile 回答1: I tried many things but this is what worked. http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#_embedded_jetty Just be sure to include the appropriate libraries like weld-servlet, cdi-api, el-api

WELD-001409 Ambiguous dependencies for type [EagerBeansRepository]

ぃ、小莉子 提交于 2019-12-10 15:54:14
问题 I'm trying to migrate my JSF application to CDI. I have implented the following changes: Added an empty beans.xml file to WEB-INF Changed @ManagedBean 's to @Named Changed All the scopes I have to CDI Scopes (Session, View, Request) Changed all @EJB and @ManagedProperty to @Inject However, an Omnifaces error is preventing deployment as I'm getting the following error three times: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [EagerBeansRepository]

Seed value in Weld CDI custom scope

给你一囗甜甜゛ 提交于 2019-12-10 12:57:01
问题 Coming from a Guice background, I know that it is possible to seed an object value from a scope using. scope.seed(Key.get(SomeObject.class), someObject); I suppose one could do this by registering a Bean that gets a value from an AbstractBoundContext , but examples just seeding one value from a Custom Scope seem hard to find. How do I create a custom scope that seeds a value that can be injected elsewhere? Edit: I am currently using the following workaround, that can be injected in an

WARNING: Parameter 1 of type List<Bean<?>> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setXxx is not resolvable to a concrete type

早过忘川 提交于 2019-12-10 12:50:03
问题 I'm using Omnifaces 1.8.1 and Whenever I deploy my application to Glassfish I get the following warning which causes some delay in the deploy process. Warning: WELD-001519 An InjectionTarget implementation is created for an abstract class org.omnifaces.eventlistener.DefaultHttpSessionListener. It will not be possible to produce instances of this type! Warning: WELD-001519 An InjectionTarget implementation is created for an abstract class org.omnifaces.eventlistener

How to hunt down obscure HA clustering bug in Wildfly 8.2.0.Final

拥有回忆 提交于 2019-12-10 12:36:13
问题 The setup I have a Wildfly 8.2.0.Final application server running a cluster in domain mode using the full-ha profile. The cluster consists of two instances of wildfly, master and slave, each running on its own virtual machine. The application My project is deployed as a war-file on the application server. For test purposes my loadbalancer distributes the requests using round-robin. Anonymous users can use the service provided by this project using a button, which will call in two steps first

Inject producer method that returns String CDI

心已入冬 提交于 2019-12-10 02:23:37
问题 I would like to inject constant string message to managed bean in JSF web application using CDI, here is producer class: @Named @RequestScoped public class StringProducer { @Produces @Named("message") @RequestScoped public String getMessage() { return "Hello World"; } } and here is how it is injected in another managed bean: @Inject Named("message") String message; but this always result in exception: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435 Normal scoped bean int

CDI object not proxyable with injected constructor

本秂侑毒 提交于 2019-12-10 01:23:26
问题 When trying to inject arguments into the constructor of a CDI bean (ApplicationScoped), I'm encountering the following issue: Caused by: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435: Normal scoped bean class xx.Config is not proxyable because it has no no-args constructor - Managed Bean [class xx.Config] with qualifiers [@Default @Named @Any]. at org.jboss.weld.bean.proxy.DefaultProxyInstantiator.validateNoargConstructor(DefaultProxyInstantiator.java:50) at org.jboss