jboss-weld

Inject a stateless EJB with @Inject into CDI Weld ManagedBean (JSF 1.2 EJB Application on jboss 6 AS)

↘锁芯ラ 提交于 2019-12-29 04:51:12
问题 Currently I am trying to inject a stateless EJB into a CDI managed controller on Jboss 6 AS Final. The controller is managed in the context an accessible from the JSF pages. If I inject the stateless bean with @EJB it is working. If I inject the stateless EJB with @Inject I get the following Exception: My controller: @Named("TestController") public class TestController { @Inject private TestManagerLocal myTestManager; ... } } My stateless bean: @SuppressWarnings("unchecked") @Stateless public

JSF 2.0: use Enum values for selectOneMenu [duplicate]

南笙酒味 提交于 2019-12-29 02:48:14
问题 This question already has answers here : How to use enum values in f:selectItem(s) (4 answers) Closed 4 years ago . I'm using JSF 2.0 and want to fill a selectOneMenu with the values of my Enum. A simple example: // Sample Enum public enum Gender { MALE("Male"), FEMALE("Female"); private final String label; private Gender(String label) { this.label = label; } public String getLabel() { return this.label; } } Unfortunately, i can't use Seam for my current project, which had a nice <s

WELD-001408: Unsatisfied dependencies for type HttpSession

时间秒杀一切 提交于 2019-12-25 07:39:30
问题 I have this (notorious by now) @SessionScoped bean in my JSF project: @Named(value = "appointmentFormBean") @SessionScoped public class AppointmentFormBean implements Serializable { @Inject private transient AppointmentService service; public AppointmentFormBean() { bookedAlready = new ArrayList<>(); types = new LinkedHashMap<>(4, (float) 0.75); } public AppointmentService getService() { return service; } public void setService(AppointmentService service) { this.service = service; } ... /

CDI Weld and AspectJ - org.jboss.weld.exceptions.UnproxyableResolutionException

空扰寡人 提交于 2019-12-25 06:32:10
问题 I get this error when using AspectJ and CDI. org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class myPackageName.myClassName is not proxyable because the type is final or it contains a final method static final java.lang.String myPackageName.myClassName.myMethodName_aroundBody0(myPackageName.myClassName.,org.aspectj.lang.JoinPoint). If I remove AspectJ it works, but I don't want that. Please Help. 回答1: I got an answer from AspectJ's mailing list, they

CDI Beans Serialization issue on Cluster

本小妞迷上赌 提交于 2019-12-24 17:28:22
问题 I'm facing a big issue when I tried to run my EJB+CDI+JSF application on Wildfly 9.2 (Also I tried 10.0) on Standalone Clustered mode. The issue happens when my cluster container tries to deserialize my session scoped CDI beans, it throws the following exception : 2016-02-06 02:17:22,650 ERROR [io.undertow.request] (default task-9) UT005071: Undertow request failed HttpServerExchange{ GET /login.xhtml request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8]

startup class in Weld

拈花ヽ惹草 提交于 2019-12-23 21:16:42
问题 I am trying to define a startup class for my application in Weld CDI with @Singleton and @Startup annotations (running on tomcat 7), but my PostConstruct method is never called. Here is my Startup class: import java.util.List; import java.util.logging.Logger; import javax.annotation.PostConstruct; import javax.ejb.Startup; import javax.inject.Inject; import javax.ejb.Singleton; import javax.persistence.EntityManager; import se.raindance.squid.core.domain.SquidSettings; @Singleton @Startup

Passivation issue with Stateful Session Bean

痞子三分冷 提交于 2019-12-23 19:55:34
问题 I'm using JBoss 6.1 Final, and get the following error message after my web application is running for a while (note the application doesn't crash), followed by a very long stack trace. I notice that this problem only occurs with stateful session beans that have other stateful session beans injected into them. 16:10:59,769 ERROR [org.jboss.ejb3.cache.simple.SimpleStatefulCache.UutSerialNumberServiceBean] problem passivation thread: javax.ejb.EJBException: Could not passivate; failed to save

Weld using alternative producer from src/test/META-INF/beans.xml

≯℡__Kan透↙ 提交于 2019-12-21 21:34:24
问题 I am trying to use Weld SE 2.3.0.Final to swap an alternative implementation of an injected dependency during testing by supplying a different beans.xml in src/test/resources/META-INF It always seems to use the main version of beans.xml though and I'm not sure why. First of all here are the supporting classes Engine.java public interface Engine { void start(); void stop(); } DefaultEngine.java @Vetoed public class DefaultEngine implements Engine { public void start() { System.out.println(

what is the purpose of including empty beans.xml in CDI implemenations projects?

て烟熏妆下的殇ゞ 提交于 2019-12-21 17:43:38
问题 I am using weld ,a RI of CDI as dependency injection component in my JSF-EJB-JPA web app. I see in my project we have empty beans.xml in META-INF/beans.xml in ejb.jar and WEB-INF/beans.xml in my WAR. I don't get it why we need to keep empty beans.xml when there nothing defined in that file? 回答1: CDI needs to scan all the classes of a bean archive at start-up and fire a bunch of events because almost any class is automatically a managed bean (read more here), even if it doesn't have any

“Unable to convert ejbRef for ejb” on CDI (Weld) injection of @Stateless EJB into @SessionScoped JSF2 bean in Glassfish

99封情书 提交于 2019-12-21 12:33:10
问题 [ UPDATE : After discussion on the Glassfish forums/ML at http://forums.java.net/jive/thread.jspa?messageID=480532 a bug was filed against Glassfish https://glassfish.dev.java.net/issues/show_bug.cgi?id=13040 for this issue.] I'm trying to inject a local no-interface view of a @Stateless EJB into a JSF2 @Named @javax.enterprise.context.SessionScoped backing bean. The EJB is one of several that extend an abstract generic base class. Injection of "@Inject TheEJBClass varName" fails with "Unable