cdi

CDI/Weld unable to do constructor injection of RESTEasy resource

江枫思渺然 提交于 2020-02-21 14:06:04
问题 I'm trying to combine RESTEasy with Weld on AppEngine but having troubles to do constructor injection. I've added the RESTEasy CdiInjectorFactory context param and the Weld servlet listener. My RESTEasy application class looks like: public class MyApplication extends Application { @Override public Set<Class<?>> getClasses() { HashSet<Class<?>> classes = new HashSet<Class<?>>(); classes.add(CustomerResource.class); return classes; } } and the CustomerResource: @Path("/rest/app/customers")

Can MyFaces + CDI be used on WebLogic 12c?

二次信任 提交于 2020-02-20 06:51:07
问题 I've been trying to get this setup running for a couple of days now but still no luck. Here's the test application i've been using: @Named @RequestScoped public class Test { private String test = "test"; public String getTest() { return test; } public void setTest(String test) { this.test = test; } } And in the jsf page: <h:outputText value="#{test.test}"/> Running this sample without MyFaces works fine (renders "test" like it should), but when i deploy MyFaces in the WAR file and do the

Can MyFaces + CDI be used on WebLogic 12c?

那年仲夏 提交于 2020-02-20 06:50:44
问题 I've been trying to get this setup running for a couple of days now but still no luck. Here's the test application i've been using: @Named @RequestScoped public class Test { private String test = "test"; public String getTest() { return test; } public void setTest(String test) { this.test = test; } } And in the jsf page: <h:outputText value="#{test.test}"/> Running this sample without MyFaces works fine (renders "test" like it should), but when i deploy MyFaces in the WAR file and do the

CDI extension, altering processed type

ε祈祈猫儿з 提交于 2020-02-07 05:17:24
问题 Using Weld 1.1.13.Final in test with Arquillian.... Let's say I inject into a field something volatile. Something like a property subject to change that I want the bean owning the injection point to receive change events. Thought about creating a CDI extension. Caught ProcessAnnotatedType event and looking for all fields that have an custom annotation on field injection points: <T> void pat(@Observes ProcessAnnotatedType<T> event, BeanManager bm) { final AnnotatedType<T> target = event

Invalidate specific jsf bean session

岁酱吖の 提交于 2020-02-04 23:10:33
问题 How I invalidate a specific bean in a session? I have this example code. I test with ExternalContext.invalidateSession(); but it destroy all beans in the session in the application since it destroys the full session. @Named @SessionScoped class Managed implements Serializable { public void invalidate (){ // lines // externalContext.invalidateSession(); } } but, with invalidateSession all beans in the session are destroyed, I want to invalidate only the one specific "Managed" bean, how I do

Invalidate specific jsf bean session

☆樱花仙子☆ 提交于 2020-02-04 23:03:52
问题 How I invalidate a specific bean in a session? I have this example code. I test with ExternalContext.invalidateSession(); but it destroy all beans in the session in the application since it destroys the full session. @Named @SessionScoped class Managed implements Serializable { public void invalidate (){ // lines // externalContext.invalidateSession(); } } but, with invalidateSession all beans in the session are destroyed, I want to invalidate only the one specific "Managed" bean, how I do

org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type Bean with qualifiers @Default

孤者浪人 提交于 2020-02-03 10:16:30
问题 My project was working fine yesterday. The only thing I did was to change the structure from a single war to a multi module pom. If I understand correctly the stacktrace there is ambiguousity between weld and omnifaces websocket lib. However there doesn't seem to be any call to any of my methods on the stacktrace. So maybe it's a problem with omnifaces ? I don't even use omnifaces websockets, I use javax.websocket. I did however try it out in this project in the past, and I did a search on

org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type Bean with qualifiers @Default

亡梦爱人 提交于 2020-02-03 10:16:07
问题 My project was working fine yesterday. The only thing I did was to change the structure from a single war to a multi module pom. If I understand correctly the stacktrace there is ambiguousity between weld and omnifaces websocket lib. However there doesn't seem to be any call to any of my methods on the stacktrace. So maybe it's a problem with omnifaces ? I don't even use omnifaces websockets, I use javax.websocket. I did however try it out in this project in the past, and I did a search on

Invalidating session with CDI+JSF not working

末鹿安然 提交于 2020-02-03 09:21:15
问题 I'm trying to implement a logout in my application, so I made this: public String logout(){ try{ FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext ex = facesContext .getExternalContext(); ex.invalidateSession(); return "success"; }catch(Exception e){ return "error"; } } But when I check if the user is logged, it says yes: public class AuthenticateListener implements PhaseListener { @Override public void afterPhase(PhaseEvent event) { AuthorizedUser authorized =

Is @javax.annotation.ManagedBean a CDI bean defining annotation?

前提是你 提交于 2020-02-03 04:59:04
问题 The Question Given that the archive we deploy is an "implicit bean archive" (see below), using @javax.inject.Inject to inject a @javax.annotation.ManagedBean into another managed bean work in WildFly 8.1.0, but it won't work in GlassFish 4.0.1-b08 nor GlassFish 4.1-b13. GlassFish crash with this message: WELD-001408: Unsatisfied dependencies for type... Do I misunderstand the following outlined specifications or do GlassFish have a bug? CDI 1.1 Part 1 CDI 1.1 (JSR-346) section 12.1 "Bean