[
https://jira.jboss.org/browse/WELD-576?page=com.atlassian.jira.plugin.sys...
]
Pete Muir updated WELD-576:
---------------------------
Summary: User reports that resolution is rejecting Object.class as a
valid type of a bean (was: Can't get produces bean instance from bean name)
Description:
Set<Bean<?>> beans = manager.getBeans("mybean");
Bean<?> sourceBean = beans.iterator().next();
manager.getReference(sourceBean, Object.class,
manager.createCreationalContext(sourceBean));
WELD-001305 The given type class java.lang.Object is not a type of the bean
org.jboss.weld.bean-flat-ProducerMethod-com.yofc.jcdi.produces.ProducesUtil.method
getUserInfo()
public class ProducesUtil {
@Produces @SessionScoped @Named("myBean")
UserInfo getUserInfo()
{
SpringUser
springUser\=(SpringUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
return new
UserInfo(springUser.getUsername(),springUser.getName(),springUser.getPassword(),springUser.getRoles(),springUser.getRights());
}
}
was:see
http://seamframework.org/Community/HowToGetProducesBeanInstanceInWeld102s...
Component/s: Resolution (Typesafe and by Name)
JBoss Forum Reference:
http://seamframework.org/Community/HowToGetProducesBeanInstanceInWeld102s...
User reports that resolution is rejecting Object.class as a valid
type of a bean
--------------------------------------------------------------------------------
Key: WELD-576
URL:
https://jira.jboss.org/browse/WELD-576
Project: Weld
Issue Type: Bug
Components: Resolution (Typesafe and by Name)
Affects Versions: 1.1.0.BETA1
Reporter: he youlin
Set<Bean<?>> beans = manager.getBeans("mybean");
Bean<?> sourceBean = beans.iterator().next();
manager.getReference(sourceBean, Object.class,
manager.createCreationalContext(sourceBean));
WELD-001305 The given type class java.lang.Object is not a type of the bean
org.jboss.weld.bean-flat-ProducerMethod-com.yofc.jcdi.produces.ProducesUtil.method
getUserInfo()
public class ProducesUtil {
@Produces @SessionScoped @Named("myBean")
UserInfo getUserInfo()
{
SpringUser
springUser\=(SpringUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
return new
UserInfo(springUser.getUsername(),springUser.getName(),springUser.getPassword(),springUser.getRoles(),springUser.getRights());
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira