aspose file tools*
The moose likes JBoss/WildFly and the fly likes unable to process injections in jboss EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "unable to process injections in jboss EJB" Watch "unable to process injections in jboss EJB" New topic
Author

unable to process injections in jboss EJB

Prateek Kumar Singh
Greenhorn

Joined: Jan 21, 2011
Posts: 29

Hi i''m getting error when i running my simple EJB , JSF application


com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection on managed bean questionJSFBean
com.sun.faces.mgbean.BeanBuilder.injectResources(BeanBuilder.java:211)
com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:103)
com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)

root cause

com.sun.faces.spi.InjectionProviderException: unable to process injections.
org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider.inject(JBossDelegatingInjectionProvider.java:81)
com.sun.faces.mgbean.BeanBuilder.injectResources(BeanBuilder.java:205)
com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:103)
com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)

by: java.lang.IllegalArgumentException: failed to set value Proxy to jboss.j2ee:jar=EJBDemo_EJB.jar,name=QBean,service=EJB3 implementing [interface com.demo.ejb.QuestioSessionRemote] on field private com.demo.ejb.QuestionSessionBean com.ejbdemo.controller.QuestionController.bean; Reason: ClassLoaders of value: org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader@d9628f and target field BaseClassLoader@a191be are not equal
at org.jboss.injection.injector.util.FieldInjectionPoint.set(FieldInjectionPoint.java:73) [:1.0.0-alpha-7]
at org.jboss.injection.injector.EEInjector.inject(EEInjector.java:159) [:1.0.0-alpha-7]
at org.jboss.injection.injector.EEInjector.inject(EEInjector.java:133) [:1.0.0-alpha-7]
at org.jboss.injection.injector.EEInjector.inject(EEInjector.java:81) [:1.0.0-alpha-7]
at org.jboss.injection.manager.core.DefaultInjectionContext.proceed(DefaultInjectionContext.java:58) [:1.0.0-alpha-7]
at org.jboss.injection.manager.core.DefaultInjectionManager.inject(DefaultInjectionManager.java:58) [:1.0.0-alpha-7]
at org.jboss.injection.manager.core.DefaultInjectionManager.inject(DefaultInjectionManager.java:64) [:1.0.0-alpha-7]
at org.jboss.web.tomcat.service.TomcatInjectionContainer.processInjectors(TomcatInjectionContainer.java:410) [:6.1.0.Final]
at org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider.inject(JBossDelegatingInjectionProvider.java:77) [:1.0.3]
... 41 more



my controller is--
@EJB(mappedName="QBean/remote-com.demo.ejb.QuestioSessionRemote")
private QuestionSessionBean bean;

my ejb is-

@Stateless(name="QBean")
@Remote({QuestioSessionRemote.class})
@RemoteBinding(jndiBinding="ServiceUserBinding")
public class QuestionSessionBean implements QuestioSessionRemote{

private QuestionSessionBean() {
}
@Resource
private UserTransaction transaction;

@PersistenceContext(name="EJBDemo_EJB")
private EntityManagerFactory entityManagerFactory;
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
The part of the error message that says
"ClassLoaders of value: org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader@d9628f and target field BaseClassLoader@a191be are not equal
at org.jboss.injection.injector.util.FieldInjectionPoint.set(FieldInjectionPoint.java:73) [:1.0.0-alpha-7]
suggests that you have classpath pollution issues possibly caused by duplicate jars on the classpath.
Start by checking that your deployment file doesn't contain multiple versions of the same jar at different locations and that it doesn't contain jars that are already provided by your container.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: unable to process injections in jboss EJB