I'm using the primefaces framework to realise a lazy data table.
I imported the package:
import org.primefaces.model.LazyDataModel;
in my EventViewer ManagedBean class.
I put the primefaces-6.1.jar in the WEB-INF/lib folder.
After deploying the project on JBoss AS, when loading the page I get the following exception:
2017-07-25 18:12:13,817 ERROR [javax.enterprise.resource.webcontainer.jsf.managedbean] JSF will be unable to create managed bean eventViewer when it is requested. The following problems where found:
- Bean or property class com.imnet.oam.fe.event.EventViewer for managed bean eventViewer cannot be loaded due to a missing dependency: org/primefaces/model/LazyDataModel.
2017-07-25 18:12:13,817 ERROR [javax.enterprise.resource.webcontainer.jsf.application] Error Rendering View[/event.xhtml]
com.sun.faces.mgbean.ManagedBeanCreationException: Unable to create managed bean eventViewer. The following problems were found:
- Bean or property class com.imnet.oam.fe.event.EventViewer for managed bean eventViewer cannot be loaded due to a missing dependency: org/primefaces/model/LazyDataModel.
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:265)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIData.getValue(UIData.java:732)
at org.primefaces.component.api.UIData.getDataModel(UIData.java:764)
at org.primefaces.component.datatable.DataTable.loadLazyData(DataTable.java:1097)
[...]
This is the main error:
- Bean or property class com.imnet.oam.fe.event.EventViewer for managed bean eventViewer cannot be loaded due to a missing dependency: org/primefaces/model/LazyDataModel.
How do I solve it?
Related
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.omnifaces.cdi" and commented out things from sub packages like #Param but the problem remains.
Also I don't understand why the ambiguousity seem to be from the 2 exact same classes:
Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default],
Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default]
[2016-06-25 03:13:59,430] Artifact core:war: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"core-0.0.1-SNAPSHOT.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"core-0.0.1-SNAPSHOT.war\".WeldStartService: Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 4 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type SocketSessionManager with qualifiers #Default
at injection point [BackedAnnotatedField] #Inject private org.omnifaces.cdi.push.SocketPushContextProducer.socketSessions
at org.omnifaces.cdi.push.SocketPushContextProducer.socketSessions(SocketPushContextProducer.java:0)
Possible dependencies:
- Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default],
- Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default]
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:367)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type SocketSessionManager with qualifiers #Default
at injection point [BackedAnnotatedField] #Inject private org.omnifaces.cdi.push.SocketChannelManager.socketSessions
at org.omnifaces.cdi.push.SocketChannelManager.socketSessions(SocketChannelManager.java:0)
Possible dependencies:
- Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default],
- Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default]
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:367)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type SocketUserManager with qualifiers #Default
at injection point [BackedAnnotatedField] #Inject private org.omnifaces.cdi.push.SocketSessionManager.socketUsers
at org.omnifaces.cdi.push.SocketSessionManager.socketUsers(SocketSessionManager.java:0)
Possible dependencies:
- Managed Bean [class org.omnifaces.cdi.push.SocketUserManager] with qualifiers [#Any #Default],
- Managed Bean [class org.omnifaces.cdi.push.SocketUserManager] with qualifiers [#Any #Default]
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:367)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Exception 0 :
org.jboss.weld.exceptions.AmbiguousResolutionException: WELD-001318: Cannot resolve an ambiguous dependency between:
- Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default],
- Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default]
at org.jboss.weld.manager.BeanManagerImpl.resolve(BeanManagerImpl.java:1235)
at org.jboss.weld.bootstrap.Validator.validatePseudoScopedInjectionPoint(Validator.java:926)
at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:902)
at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:917)
at org.jboss.weld.bootstrap.Validator.validatePseudoScopedBean(Validator.java:879)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:138)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
"}}
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type SocketSessionManager with qualifiers #Default
at injection point [BackedAnnotatedField] #Inject private org.omnifaces.cdi.push.SocketPushContextProducer.socketSessions
Basically, Weld discovered multiple CDI managed beans which could be injected in private SocketSessionManager socketSessions field of the SocketPushContextProducer class. They are listed thereafter:
Possible dependencies:
Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default]
Managed Bean [class org.omnifaces.cdi.push.SocketSessionManager] with qualifiers [#Any #Default]
In this specific case they are however exactly the same. This means that there are multiple SocketSessionManager classes in the runtime classpath. This in turn means that there are multiple OmniFaces libraries/dependencies present in the runtime classpath (or a dirty build/(hot)deploy which could be solved by trashing server's work/temp folders or spawning a clean server instance).
You need to make sure that there's only one OmniFaces library in the runtime classpath and that it ends up in WAR's /WEB-INF/lib.
This is not specifically related to websockets. It just happened to be the first OmniFaces-related class which is scanned by Weld. It could occur on any other CDI managed bean bundled in OmniFaces.
It could also be just a version change in pom, and maven build cache inconsistency.
A
mvn clean
helped in my case.
I have Faces-Config.xml set to web-facesconfig_2_3.xsd. Got the latest jars for JSF 2.3. Using CDI annotations for JSF and Spring, created two beans with request scope and tries to inject managed property from another bean paymentBean.
Followed this link.
import javax.inject.Inject;
import javax.inject.Named;
import javax.faces.annotation.ManagedProperty;
#Named("myBean")
#RequestScoped
public class MyBean implements Serializable {
#Inject #ManagedProperty("#{paymentBean.amount}")
private BigDecimal amount;
}
#Named(value = "paymentBean")
#RequestScoped
public class paymentBean implements Serializable {
private BigDecimal amount;
}
It throws following exception:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyBean': Unsatisfied dependency expressed through field 'amount'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.payment.amount})}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:592)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:370)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:198)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.payment.amount})}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1466)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1097)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:589)
... 25 more
15:03:12,496 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 81) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./VTOL: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./VTOL: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyBean': Unsatisfied dependency expressed through field 'amount'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.payment.amount})}
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyBean': Unsatisfied dependency expressed through field 'amount'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.payment.amount})}
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:231)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyBean': Unsatisfied dependency expressed through field 'amount'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.payment.amount})}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:592)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:370)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:198)
... 8 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.amount})}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1466)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1097)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:589)
... 25 more
15:03:12,506 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "VTOL.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./VTOL" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./VTOL: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyBean': Unsatisfied dependency expressed through field 'amount'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.payment.amount})}
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyBean': Unsatisfied dependency expressed through field 'amount'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.payment.amount})}
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyBean': Unsatisfied dependency expressed through field 'amount'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.amount})}
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.amount})}"}}
15:03:12,536 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0010: Deployed "VTOL.war" (runtime-name : "VTOL.war")
15:03:12,536 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./VTOL: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./VTOL: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyBean': Unsatisfied dependency expressed through field 'amount'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.math.BigDecimal' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#javax.inject.Inject(), #javax.faces.annotation.ManagedProperty(value=#{paymentBean.amount})}
Under payara I found that faces config with
<faces-config version="2.3"
does not work,
I used
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
</faces-config>
And all problems solved.
Try this
https://github.com/armdev/jsf-rulebook/blob/master/web-flow/src/main/webapp/WEB-INF/faces-config.xml
The first try run project without Spring, if all ok, integrate your preferred frameworks.
I'm using JBoss EAP 6.4 (and Weld 1.1.28) and trying to get rid of Seam 2. One part of that is switching over to CDI. I get the following (anonymized) error:
org.jboss.weld.exceptions.DeploymentException: WELD-001443 Pseudo scoped bean
has circular dependencies. Dependency path
[Managed Bean [A] with qualifiers [#Default #Any #Named],
Managed Bean [B] with qualifiers [#Default #Any],
Managed Bean [C] with qualifiers [#Default #Any],
Managed Bean [D] with qualifiers [#Default #Any],
Managed Bean [C] with qualifiers [#Default #Any]]
Every single one of these is #SessionScoped, however, so it seems like this should work since #SessionScoped is a "normal" scope. Why doesn't this work?
#SessionScoped for CDI is javax.enterprise.context.SessionScoped. If you happen to annotate class with javax.faces.bean.SessionScoped then your class is not managed by CDI. When you try to #Inject it then it will be #Dependent pseudo-scoped.
I am testing JSF 2.2 Faces flows in a PrimeFaces application and when I replace h:button with p:button the link stops working.
In JSF 2.2 you can specify, for example, the flow_id in the "outcome" of a h:button. This seems not to work in PF . The exception I'm getting is:
[ERROR ] SRVE0315E: An exception occurred: java.lang.Throwable: javax.servlet.ServletException: WELD-001303: No active contexts for scope type javax.faces.flow.FlowScoped
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4898)
at [internal classes]
Caused by: javax.servlet.ServletException: WELD-001303: No active contexts for scope type javax.faces.flow.FlowScoped
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:230)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)
at [internal classes]
at com.servengine.servlet.EncodingFilter.doFilter(EncodingFilter.java:44)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
at [internal classes]
at com.servengine.servlet.ServengineWebFilter.doFilter(ServengineWebFilter.java:136)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
... 1 more
Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.faces.flow.FlowScoped
at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:708)
... 7 more
I have also got other exceptions when including flow ids in p:commandButton action, which work in h:commandButton.
Thanks.
Edit: I'm using PF version 5.2.6.
I am trying to assign values to my dropdown during page load. I followed the way which is given in this link.
Invoke JSF managed bean action on page load
As per the link, i have tried using both the annotation and constructor type.
but its an exception for me,
SEVERE: An exception occurred
javax.faces.FacesException: java.lang.reflect.InvocationTargetException
Caused by: java.lang.reflect.InvocationTargetException
Caused by: javax.el.ELException: Detected cyclic reference to managedBean loginBean
Caused by: javax.faces.el.EvaluationException: Detected cyclic reference to managedBean loginBean
I have just tried to call a function, in that annotated method or constructor,
that is,
#PostConstruct
public void init()
{
receiveclass r=new receiveclass();
r.retrieve();
}
i cant able to figure out the problem.
Detected cyclic reference to managedBean loginBean
You're injecting two different managed beans in each other as #ManagedProperty. This isn't allowed. It should be an one-way injection. Remove the #ManagedProperty referencing the one bean from the other bean.