org.jboss.weld.exceptions.IllegalArgumentException: WELD-001305 The given type class org.jboss.weld.bean.ManagedBean is not a type of the bean Managed Bean in JBoss EAP 6.2

Solution In Progress - Updated -

Issue

We are getting this error after updating from JBoss AS 7.1.1 to JBoss EAP 6.2.0 :

12:11:38,351 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 66) Critical error during deployment: : com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001305 The given type class org.jboss.weld.bean.ManagedBean is not a type of the bean Managed Bean [class com.jboss.examples.beans.ExampleBean] with qualifiers [@Named @Any @Default]
  at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
  at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
  at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
  at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
  at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_19]
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_19]
  at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_19]
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_19]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_19]
  at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_19]
  at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001305 The given type class org.jboss.weld.bean.ManagedBean is not a type of the bean Managed Bean [class com.jboss.examples.beans.ExampleBean] with qualifiers [@Named @Any @Default]
  at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:637) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
  at com.jboss.examples.jsf.JSFUtil.findBeanByName(JSFUtil.java:264) [example-jsf-dev.jar:dev]
  at com.jboss.examples.jsf.FacesAppListener.processEvent(FacesAppListener.java:19) [example-jsf-dev.jar:dev]
  at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
  at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2161) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2137) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:303) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at org.jboss.as.weld.webtier.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:288) [jboss-as-weld-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
  at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:601) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:370) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  ... 13 more
...
12:11:38,367 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/ctolrs]] (ServerService Thread Pool -- 66) JBWEB000287: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001305 The given type class org.jboss.weld.bean.ManagedBean is not a type of the bean Managed Bean [class com.jboss.examples.beans.ExampleBean] with qualifiers [@Named @Any @Default]
  at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:276) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
  at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
  at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
  at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
  at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_19]
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_19]
  at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_19]
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_19]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_19]
  at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_19]
  at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001305 The given type class org.jboss.weld.bean.ManagedBean is not a type of the bean Managed Bean [class com.jboss.examples.beans.ExampleBean] with qualifiers [@Named @Any @Default]
  at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  ... 12 more
Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001305 The given type class org.jboss.weld.bean.ManagedBean is not a type of the bean Managed Bean [class com.jboss.examples.beans.ExampleBean] with qualifiers [@Named @Any @Default]
  at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:637) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
  at com.jboss.examples.jsf.JSFUtil.findBeanByName(JSFUtil.java:264) [example-jsf-dev.jar:dev]
  at com.jboss.examples.jsf.FacesAppListener.processEvent(FacesAppListener.java:19) [example-jsf-dev.jar:dev]
  at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
  at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2161) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2137) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:303) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at org.jboss.as.weld.webtier.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:288) [jboss-as-weld-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
  at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:601) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:370) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
  ... 13 more

I did notice that most of the references on the web we about problems with the BeanManager.getReference call, our code looks like this:

  public static <T> T findBeanByName(String beanName) {

    BeanManager bm = getBeanManager();
    Bean bean = bm.getBeans(beanName).iterator().next();
    CreationalContext ctx = bm.createCreationalContext(bean);
    Object o = bm.getReference(bean, bean.getClass(), ctx);
    return (T) o;
  }

Environment

Red Hat JBoss Enterprise Application Platform (EAP) 6.2.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content