[jbossseam-issues] [JBoss JIRA] Reopened: (JBSEAM-286) SeamTest - Add support for authenticated user
by Bradley Smith (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-286?page=all ]
Bradley Smith reopened JBSEAM-286:
----------------------------------
I really need the principal - not the name of a Principal, also, I would prefer to be able to use a Principal class for the roles instead of a Set<String>.
The goal of this feature request was to have a Principal impl. available in the request so that the org.jboss.seam.core.userPrincipal component works. Furthermore, I wanted to be able to produce an instance of Principal (my app's specific Principal impl.) and have that instance be used by the MockHttpServletRequest. Is it too much too ask? say it ain't so....
I tried using the 1.1.0 CR1 release of SeamTest - I overrode the getPrincipalName() method, the userPrincipal is not set on my EJB using @In Principal userPrincipal.
11:27:47,580 ERROR org.jboss.seam.interceptors.ExceptionInterceptor.(handle:367) - redirecting to debug page
javax.ejb.EJBException: java.lang.IllegalArgumentException: could not set field value: mailConfigurationEditor.userPrinc
ipal
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
at $Proxy98.getMailConfiguration(Unknown Source)
at com.evergreen.accesscontrol.MailConfigurationEditor$$FastClassByCGLIB$$b5b2a641.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:69)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:78)
at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
at com.evergreen.accesscontrol.MailConfigurationEditor$$EnhancerByCGLIB$$19081219.getMailConfiguration(<generate
d>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
at org.jboss.seam.Component.callComponentMethod(Component.java:1759)
at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1647)
at org.jboss.seam.Component.getInstance(Component.java:1590)
at org.jboss.seam.Component.getInstance(Component.java:1567)
at org.jboss.seam.Component.getInstance(Component.java:1561)
at org.jboss.seam.mock.SeamTest.getInstance(SeamTest.java:112)
at com.evergreen.accesscontrol.MailConfigurationEditorTest.access$000(MailConfigurationEditorTest.java:15)
at com.evergreen.accesscontrol.MailConfigurationEditorTest$1.updateModelValues(MailConfigurationEditorTest.java:
31)
at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:465)
at com.evergreen.accesscontrol.MailConfigurationEditorTest.test_saveMailConfiguration(MailConfigurationEditorTes
t.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:407)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:778)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:682)
at org.testng.TestRunner.run(TestRunner.java:566)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:220)
at org.testng.SuiteRunner.run(SuiteRunner.java:146)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:713)
at org.testng.TestNG.runSuitesLocally(TestNG.java:676)
at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG(TestNGExecutor.java:64)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
Caused by: java.lang.IllegalArgumentException: could not set field value: mailConfigurationEditor.userPrincipal
at org.jboss.seam.Component.setFieldValue(Component.java:1526)
at org.jboss.seam.Component.injectFields(Component.java:1317)
at org.jboss.seam.Component.inject(Component.java:1087)
at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor
.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerIntercep
tor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
... 73 more
Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection: MailConfigurationEditorBean.user
Principal on: com.evergreen.accesscontrol.impl.MailConfigurationEditorBean with value: class org.jboss.seam.mock.MockHtt
pServletRequest$1
at org.jboss.seam.util.Reflections.set(Reflections.java:75)
at org.jboss.seam.Component.setFieldValue(Component.java:1522)
... 115 more
Caused by: java.lang.IllegalArgumentException
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at org.jboss.seam.util.Reflections.set(Reflections.java:61)
... 116 more
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 17.5 sec <<< FAILURE!
> SeamTest - Add support for authenticated user
> ---------------------------------------------
>
> Key: JBSEAM-286
> URL: http://jira.jboss.com/jira/browse/JBSEAM-286
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.0.1
> Environment: All
> Reporter: Bradley Smith
> Assigned To: Gavin King
> Fix For: 1.1.0.CR1
>
> Attachments: MockExternalContext.java, MockExternalContext.java, MockHttpServletRequest.java, MockHttpServletRequest.java, SeamTest.java, SeamTest.java
>
>
> Add a property of type Principal and another property (maybe of type Group []?) to Script. The Principal should be used by the MockHttpServletRequest to represent and authenticated user. The Group [] property should be used by the MockHttpServletRequest to support the isUserInRole() implementation.
> These properties ideally should be settable by overriding the setup() method of Script.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 2 months
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-397) page parameters for wildcarded view-ids
by Dave Whittaker (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-397?page=comments#action_12347704 ]
Dave Whittaker commented on JBSEAM-397:
---------------------------------------
Sorry about that. I incorporated changes that I myself had been using and I had a feeling it might be a bit much to process on a short timeline. 1 was an unwanted result of my change to the action behavior. It didn't seem to me that it would cause an unnecessary tx, but I'm not that familiar with the related tx handling. 2 should not break viewId.pages.xml at all. If you look at the addPage method it checks to see if the Page component has been initialized and changes its behaviour accordingly. As for 3, maybe we could discuss this further on or offline for a future patch. I haven't taken a look at your reimplementation yet but I'd really like to see the conversational attribute and the immediate redirects from non-null actions.
> page parameters for wildcarded view-ids
> ---------------------------------------
>
> Key: JBSEAM-397
> URL: http://jira.jboss.com/jira/browse/JBSEAM-397
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: JSF
> Reporter: Gavin King
> Assigned To: Gavin King
> Fix For: 1.1.0.CR2
>
> Attachments: Seam Pages Patch.txt
>
>
> Currently it is not possible to specify a page parameter for a wilcard view-id in pages.xml.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 2 months
[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-397) page parameters for wildcarded view-ids
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-397?page=all ]
Gavin King updated JBSEAM-397:
------------------------------
Fix Version/s: (was: 1.1.0.GA)
Assignee: Gavin King
I am slipping this because:
(1) There is at least one unwanted orthogonal change to behavior here (a txn begins and ends even when no page actions were found and called)
(2) Work is done in an @Create method, which means that this will break with the new support for viewId.page.xml files, which are read lazily
(3) In general there seem to be simply more code changes than are justified by the advertised functionality
It may be that apart from (1) and (2), this patch is completely good and correct, but it is simply too big for me to trust it.
> page parameters for wildcarded view-ids
> ---------------------------------------
>
> Key: JBSEAM-397
> URL: http://jira.jboss.com/jira/browse/JBSEAM-397
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: JSF
> Reporter: Gavin King
> Assigned To: Gavin King
> Attachments: Seam Pages Patch.txt
>
>
> Currently it is not possible to specify a page parameter for a wilcard view-id in pages.xml.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-524) Lifecycle.isAttributeDirty(Object attribute) doesn't like null attributes
by jarkko Lietolahti (JIRA)
Lifecycle.isAttributeDirty(Object attribute) doesn't like null attributes
-------------------------------------------------------------------------
Key: JBSEAM-524
URL: http://jira.jboss.com/jira/browse/JBSEAM-524
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 1.1.0.CR1
Reporter: jarkko Lietolahti
Priority: Blocker
Sometimes (because of living inside portal environment), WebSessionContext.flush fails when attribute obtained from Session (experimental session handling required for the portal env) is null, which is something that Lifecycle.isAttributeDirty(attribute) doesn't like and throws NPE.
A simple fix is to check for null attribute values (others might require changing getNames() or WebSessionContext /PortletSessionImpl.getAttributeNames() ):
public void flush() {
for ( String name: getNames() )
{
Object attribute = session.getAttribute(name);
if( attribute == null) {
continue;
}
if ( Lifecycle.isAttributeDirty(attribute) )
{
session.setAttribute(name, attribute);
}
}
}
And the custom PortletSessionImpl which stores everything in APPLICATION_SCOPE instead of PORTLET_SCOPE
/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.seam.portlet;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import javax.portlet.PortletSession;
import org.apache.commons.collections.ListUtils;
import org.jboss.seam.ScopeType;
import org.jboss.seam.contexts.ContextAdaptor;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute </a>
* @version $Revision: 1.4 $
*/
public class PortletSessionImpl extends ContextAdaptor {
private PortletSession session;
public PortletSessionImpl(PortletSession session) {
this.session = session;
}
protected String getPrefix() {
return ScopeType.CONVERSATION.getPrefix() + '#';
}
protected int getScope(String key) {
// if (key.startsWith(getPrefix())) {
// return PortletSession.PORTLET_SCOPE;
// }
//
return PortletSession.APPLICATION_SCOPE;
}
public Object getAttribute(String key) {
int scope = getScope(key);
Object o = session.getAttribute(key, scope);
return o;
}
public void removeAttribute(String key) {
int scope = getScope(key);
session.removeAttribute(key, scope);
}
public void setAttribute(String key, Object value) {
int scope = getScope(key);
session.setAttribute(key, value, scope);
}
public Enumeration getAttributeNames() {
// if (1 == 1) {
// Enumeration portletAttributeNamesEnumOnly = session
// .getAttributeNames();
// Enumeration koje = session
// .getAttributeNames(PortletSession.APPLICATION_SCOPE);
// return koje;
// }
Enumeration portletAttributeNamesEnum = session.getAttributeNames();
Enumeration portalAttributeNamesEnum = session
.getAttributeNames(PortletSession.APPLICATION_SCOPE);
List portletAttributeNames = Collections
.list(portletAttributeNamesEnum);
List portalAttributeNames = Collections.list(portalAttributeNamesEnum);
// TODO: Is this correct?
List allNames = ListUtils.sum(portletAttributeNames,
portalAttributeNames);
return Collections.enumeration(allNames);
}
public void invalidate() {
session.invalidate();
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 2 months
[jbossseam-issues] [JBoss JIRA] Reopened: (JBSEAM-344) Portal booking example loses conversation after validation error
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-344?page=all ]
Gavin King reopened JBSEAM-344:
-------------------------------
> Portal booking example loses conversation after validation error
> ----------------------------------------------------------------
>
> Key: JBSEAM-344
> URL: http://jira.jboss.com/jira/browse/JBSEAM-344
> Project: JBoss Seam
> Issue Type: Bug
> Components: Portal
> Affects Versions: 1.0.1
> Environment: JBoss 4.0.4.GA
> JBoss Portal 2.4.0-Beta1
> (used jems-installer-1.2.0.BETA)
> JBoss Seam 1.0.1.GA
> Reporter: Mauro Lopez
> Assigned To: Gavin King
> Fix For: 1.1.0.CR2
>
>
> Followed this steps:
> - deployed the application in examples/portal using ant, as described in examples/portal/readme.txt
> - Entered http://localhost:8080/portal
> - Selected the SeamHibernate portlet tab, registered user, logged in...
> - Searched hotels, selected one of them, and pressed the "Book" button.
> In the Book Hotel screen, if the credit card number hasn't got 16 digits, a message is shown. After that, having entered 16 digits for the credit card, instead of the confirm screen, the "Search Hotels" screen is shown, with the message "No conversation".
> So, after a failed validation, the conversation is lost.
> In my own examples I've substituted conversational scope with session scope, just to see them working.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 2 months