[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4436) No Conversation Context Error
by mike jones (JIRA)
No Conversation Context Error
-----------------------------
Key: JBSEAM-4436
URL: https://jira.jboss.org/jira/browse/JBSEAM-4436
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.2.0.GA
Environment: WebSphere 7.0.5
Reporter: mike jones
Hello,
I have 3 simple pages with back and next buttons.
Here is the button in the atbc_search page
<s:button id="next" alt="Next button" value="#{messages['button.next']}" action="#{atSearchSFSB.next}" </s:button> value="#{messages['button.next']}" action="#{atbcSearchSFSB.find}" </s:button>
<s:button id="previous" alt="Previous button" value="#{messages['button.previous']}" action="#{atSearchSFSB.previous}" </s:button> value="#{messages['button.next']}" action="#{atbcSearchSFSB.previous}" </s:button>
When I navigate back and forth it works for a while then all of the sudden I get
10/7/09 9:41:13:616 EDT] 0000002b viewhandler E Error Rendering View[/view/atbc_change.xhtml]
java.lang.IllegalStateException: No active conversation context
at org.jboss.seam.core.Conversation.instance(Conversation.java:122)
at org.jboss.seam.ui.component.UIConversationId.getName(UIConversationId.java:44)
at org.jboss.seam.ui.util.ViewUrlBuilder.addParameter(ViewUrlBuilder.java:42)
at org.jboss.seam.ui.component.UISeamCommandBase.getUrl(UISeamCommandBase.java:85)
at org.jboss.seam.ui.renderkit.ButtonRendererBase.getOnClick(ButtonRendererBase.java:37)
at org.jboss.seam.ui.renderkit.ButtonRendererBase.doEncodeBegin(ButtonRendererBase.java:66)
at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java:79)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:802)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:232)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:118)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:826)
at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)
at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
Its very consistent. It works for a while I can click the back and next buttons then I just get this error.
I really need help with this.
I am not getting this error when I use a regular JSF button. It only happens when I use
a Seam button.
Pages.xml
<page view-id="/view/atbc_search.xhtml">
<navigation from-action="#{atbcSearchSFSB.find}">
<rule if-outcome="find">
<redirect view-id="/view/atbc_change.xhtml" />
</rule>
</navigation>
</page>
<page view-id="/view/atbc_change.xhtml">
<navigation from-action="#{atbcChangeSFSB.back}">
<rule if-outcome="back">
<redirect view-id="/view/atbc_search.xhtml" />
</rule>
<rule if-outcome="next">
<redirect view-id="/view/home.xhtml" />
</rule>
</navigation>
<navigation from-action="#{atbcChangeSFSB.next}">
<rule if-outcome="next">
<redirect view-id="/view/home.xhtml" />
</rule>
</navigation>
</page>
I am also using the Seam Redirect Servlet
I am using WebSphere 7.0. Seam 2.2.0 GA
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3918) org.jboss.seam.security.Identity needs to be decoupled from system for testing purposes
by Dan Hinojosa (JIRA)
org.jboss.seam.security.Identity needs to be decoupled from system for testing purposes
---------------------------------------------------------------------------------------
Key: JBSEAM-3918
URL: https://jira.jboss.org/jira/browse/JBSEAM-3918
Project: Seam
Issue Type: Feature Request
Components: Security
Affects Versions: 2.1.1.GA
Environment: JBoss Seam 2.1.1.GA
Reporter: Dan Hinojosa
org.jboss.seam.security.Identity cannot be used in unit testing. Unit testing being defined as an isolated (no db, no app server) test. If I provide an identity into a test, once I call assertTrue(identity.hasRole("xxx")); I get an understandable NullPointerException because there is no Seam Context available.
If I may recommend that org.jboss.seam.security.Identity be either an interface or a POJO with no dependencies as an API so TDD advocates can test their code easily. This would also fulfill Seam's idea that everything for the end user is testable.
Example Test
@Test(groups = "unit")
public void testAuthenticateSuccessWithRoles() {
Log log = createMock(Log.class);
EntityManager entityManager = createMock(EntityManager.class);
Query query = createMock(Query.class);
Calendar createdDate = Calendar.getInstance();
Calendar updatedDate = Calendar.getInstance();
User user = new User();
user.setCreatedDate(createdDate);
user.setEmail("ricardo(a)aol.com");
user.setFirstName("Ricardo");
user.setLastName("Montalban");
user.setName("rmontalban");
user.setNotes("userNotes2");
user.setPassword("passw0rd");
user.setId(220L);
user.setUpdatedDate(updatedDate);
Role role = new Role();
role.setName("mgmt");
role.setId(665L);
Calendar createdDate2 = Calendar.getInstance();
createdDate2.set(2009, 1, 15, 12, 14, 15);
role.setCreatedDate(createdDate2);
Calendar updatedDate2 = Calendar.getInstance();
updatedDate2.set(2009, 1, 17, 13, 16, 20);
role.setUpdatedDate(updatedDate2);
role.setNotes("notes");
user.addRole(role);
role.addUser(user);
Credentials credentials = new Credentials();
credentials.setUsername("rmontalban");
credentials.setPassword("passw0rd");
Identity identity = new Identity();
log.info("authenticating #0", "rmontalban");
expect(entityManager.createQuery("SELECT u from User u " +
"WHERE u.name = #{credentials.username} AND u.password = #{credentials.password}")).andReturn(query);
expect(query.getSingleResult()).andReturn(user);
replay(entityManager, query, log);
Authenticator authenticator = new Authenticator();
authenticator.setLog(log);
authenticator.setIdentity(identity);
authenticator.setEntityManager(entityManager);
authenticator.setCredentials(credentials);
assertTrue(authenticator.authenticate());
assertTrue(identity.hasRole("mgmt")); //NullPointerException here
verify(entityManager, query, log);
}
Output from the above test:
java.lang.NullPointerException
at org.jboss.seam.security.Identity.tryLogin(Identity.java:164)
at org.jboss.seam.security.Identity.hasRole(Identity.java:444)
at com.manning.mymanning.AuthenticatorTest.testAuthenticateSuccessWithRoles(AuthenticatorTest.java:128)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2240) refactor for easier extensibility of seam identity: seam identiy interface + seam identity base impl
by koen handekyn (JIRA)
refactor for easier extensibility of seam identity: seam identiy interface + seam identity base impl
----------------------------------------------------------------------------------------------------
Key: JBSEAM-2240
URL: http://jira.jboss.com/jira/browse/JBSEAM-2240
Project: JBoss Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.0.0.GA
Reporter: koen handekyn
Priority: Optional
to allow easier extensibility of the seam identity class it would be useful to have a clear seam identity interface with complementary base impl from (package org.jboss.seam.security)
use case: i'm trying to define my own seam identiy that contains as an extra parameter domain (login@domain/password).
to have a complete implementation (which also saves the domain into a cookie) i'm stuck as
1. i don't know have an interface that I should satisfy if I wanted to make an implementation from scratch
2. extending from seam idenity has some issues : i missing some protected accessors to some private members (that maybe could be protected?)
alternatively my question would be solved if i could have extension points within initFromCookie and at "setCookieValueIfEnabled( getUsername() ); from method postAuthenticate()" such that i could combine and split login and domain when saving/reading the cookie.
--
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
14 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4399) Specify the Quartz job name for @Asynchronous methods
by Nikolay Elenkov (JIRA)
Specify the Quartz job name for @Asynchronous methods
-----------------------------------------------------
Key: JBSEAM-4399
URL: https://jira.jboss.org/jira/browse/JBSEAM-4399
Project: Seam
Issue Type: Feature Request
Affects Versions: 2.2.0.GA
Environment: JBoss 4.2.x, JBoss 5.x, Quartz
Reporter: Nikolay Elenkov
Attachments: quartz-job-name.patch
When using the Quartz dispatcher, Seam implements asynchronous methods by creating Quartz job and trigger
for every method, annotated with @Asynchronous. The QuartzDispatcher class uses UIDs for the job and trigger names,
in order to generate unique names. While this is OK for one-off jobs and asynchronous events, it is not suitable for
repeatable and cron jobs that might have to be paused, cancelled or rescheduled by the application. Jobs should
have meaningful names, especially when they are saved in a database store.
Requesting a means to specify the Quartz job name when declaring an asynchronous method. One way to do
this is to add a new parameter annotation, JobName. The Quartz dispatcher should inspect the asynchronous
method parameters and use the one annotated with @JobName (if any) as the base for the job/trigger name.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months