[jboss-jira] [JBoss JIRA] Created: (AS7-1297) Weld claims to be able to inject Principal, but throws RuntimeException("not implemented") at runtime
Craig Ringer (JIRA)
jira-events at lists.jboss.org
Fri Jul 15 11:14:27 EDT 2011
Weld claims to be able to inject Principal, but throws RuntimeException("not implemented") at runtime
-----------------------------------------------------------------------------------------------------
Key: AS7-1297
URL: https://issues.jboss.org/browse/AS7-1297
Project: Application Server 7
Issue Type: Bug
Components: CDI / Weld, Security
Affects Versions: 7.0.0.Final, 7.1.0.Alpha1
Environment: Windows 7 x64, JDK 6 and 7 both tested. JBoss AS 7.0.0 release, and Jboss AS 7.1.0.Alpha1 nightly build 2011-07-15.
Reporter: Craig Ringer
Assignee: Stuart Douglas
In JBoss AS 7, Weld claims to be able to inject instances of java.security.Principal. CDI archives that try to inject it do not fail at deployment time with unsatisfied dependencies. Instead, they fail later, at runtime, when injection is attempted. At this point a runtime exception indicating that principal injection isn't supported is thrown.
This prevents user code, or external frameworks like Seam 3 Security, from providing their own producers for javax.security.Principal without requiring a qualifier to be used.
If JBoss AS 7's weld integration doesn't support container managed security yet (perhaps because container managed security is not supported in JBoss AS 7 at all yet?) then it should not offer an injection point for the security principal.
Backtrace when calling toString() on an injected proxy for a Principal:
Caused by: java.lang.RuntimeException: not implemented
at org.jboss.as.weld.services.bootstrap.WeldSecurityServices.getPrincipal(WeldSecurityServices.java:53)
at org.jboss.weld.bean.builtin.ee.PrincipalBean$PrincipalCallable.call(PrincipalBean.java:48)
at org.jboss.weld.bean.builtin.ee.PrincipalBean$PrincipalCallable.call(PrincipalBean.java:34)
at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:50)
at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)
at org.jboss.weld.security.Principal$1263393769$Proxy$_$$_Weld$Proxy$.toString(Principal$1263393769$Proxy$_$$_Weld$Proxy$.java)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list