[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3131) SeamTest handles required page parameters wrong
by Christian Bauer (JIRA)
SeamTest handles required page parameters wrong
-----------------------------------------------
Key: JBSEAM-3131
URL: http://jira.jboss.com/jira/browse/JBSEAM-3131
Project: Seam
Issue Type: Bug
Components: Test Harness
Reporter: Christian Bauer
<page view-id="/docEdit*">
<param name="documentId" value="#{documentHome.nodeId}" required="true"/>
The following test simulates a typical edit screen, first a GET request to start the conversation, then a POST request to e.g. Save the form.
@Test
public void test() throws Exception {
final String conversationId = new NonFacesRequest("/docEdit.xhtml") {
protected void beforeRequest() {
setParameter("documentId", "6");
}
}.run();
new FacesRequest("/docEdit.xhtml") {
protected void beforeRequest() {
setParameter("cid", conversationId);
}
...
This sequence works fine in the real app, but throws an error during testing:
javax.faces.validator.ValidatorException: A value is required
at org.jboss.seam.navigation.Param.addRequiredMessage(Param.java:268)
at org.jboss.seam.navigation.Param.getStringValueFromRequest(Param.java:171)
at org.jboss.seam.navigation.Pages.storeRequestStringValuesInPageContext(Pages.java:716)
at org.jboss.seam.navigation.Pages.postRestore(Pages.java:374)
at org.jboss.seam.jsf.SeamPhaseListener.postRestorePage(SeamPhaseListener.java:546)
at org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:392)
at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:228)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
at org.jboss.seam.mock.AbstractSeamTest$Request.restoreViewPhase(AbstractSeamTest.java:754)
at org.jboss.seam.mock.AbstractSeamTest$Request.emulateJsfLifecycle(AbstractSeamTest.java:581)
at org.jboss.seam.mock.AbstractSeamTest$Request.access$300(AbstractSeamTest.java:175)
at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:495)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:406)
at org.jboss.seam.wiki.core.ui.WikiUrlRewriteFilter.doFilter(WikiUrlRewriteFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.wiki.core.ui.WikiUrlSessionIdFilter.doFilter(WikiUrlSessionIdFilter.java:86)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.jboss.seam.mock.AbstractSeamTest$Request.run(AbstractSeamTest.java:489)
Looks to me like the emulateJsfLifecycle routine can't really distinguish between a GET and POST request, and so it applies the same phase listener processing for page parameters as it would on a GET.
--
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
16 years, 6 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2719) NotLoggedInException and AuthorizationException handlers defined in pages.xml are ignored on IBM JVM
by Jonathan Marston (JIRA)
NotLoggedInException and AuthorizationException handlers defined in pages.xml are ignored on IBM JVM
----------------------------------------------------------------------------------------------------
Key: JBSEAM-2719
URL: http://jira.jboss.com/jira/browse/JBSEAM-2719
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 2.0.1.GA
Environment: SUSE 10 on s390x, IBM JVM 2.6 (Sun JRE 1.6 update 4 equivalent)
Reporter: Jonathan Marston
I have set up a page with restricted authority, and exception handlers for NotLoggedInException and AuthorizationException in pages.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<pages xmlns="http://jboss.com/products/seam/pages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd" login-view-id="/login.xhtml">
<page view-id="/restricted.xhtml" login-required="true"/>
<page view-id="/noauthority.xhtml" login-required="true">
<restrict>>#{s:hasRole('admin')}</restrict>
</page>
<!-- Exception pages -->
<exception class="org.jboss.seam.security.NotLoggedInException">
<redirect view-id="/error.xhtml">
<message>You need to be logged to view this page.</message>
</redirect>
</exception>
<exception class="org.jboss.seam.security.AuthorizationException">
<redirect view-id="/error.xhtml">
<message>You don't have security permissions</message>
</redirect>
</exception>
<exception>
<redirect view-id="/error.xhtml">
<message>An exception occured</message>
</redirect>
</exception>
</pages>
The restricted.xhtml requires you to be logged in, and noauthority.xhtml requires admin authority. Everything works as expected on Sun JVM under Windows, but our s390x mainframe requires us to use the IBM JVM, where it fails to handle the AuthorizationException when accessing noauthority.xhtml. The exception is generated, but uncaught, as can be seen in the log file:
[ERROR] uncaught exception
org.jboss.seam.security.AuthorizationException: Authorization check failed for expression [>#{s:hasRole('admin')}]
Unlike on Sun's JRE, the exception is repeated as being "swallowed":
[ERROR] swallowing exception
org.jboss.seam.security.AuthorizationException: Authorization check failed for expression [>#{s:hasRole('admin')}]
The same happened for the NotLoggedInException, until I added a login-view-id attribute to the <pages> element in pages.xml.
Other exception types are handled by the catch-all handler I set up - just NotLoggedInException and AuthorizationException are ignored.
--
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
16 years, 6 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3109) I get a NullPointerException when I try to use HTTP Basic Authentication.
by Ken Qiu (JIRA)
I get a NullPointerException when I try to use HTTP Basic Authentication.
-------------------------------------------------------------------------
Key: JBSEAM-3109
URL: http://jira.jboss.com/jira/browse/JBSEAM-3109
Project: Seam
Issue Type: Bug
Components: Framework
Affects Versions: 2.0.2.SP1
Environment: Windows XP sp2, Jboss 4.2.2.GA
Reporter: Ken Qiu
Priority: Blocker
I get a NullPointerException when I try to use HTTP Basic Authentication.
I've added the following to components.xml:
<security:identity authenticate-method="#{authenticatorTest.login}" />
<web:authentication-filter url-pattern="*.seam" auth-type="basic"/>
Here's the stack trace:
14:00:26,359 ERROR [ExceptionFilter] handling uncaught exception
java.lang.NullPointerException
at org.jboss.seam.web.AuthenticationFilter.processBasicAuth(AuthenticationFilter.java:158)
at org.jboss.seam.web.AuthenticationFilter.doFilter(AuthenticationFilter.java:118)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
I noticed that the Identity component is not started until after the exception:
14:00:26,359 INFO [Contexts] starting up: org.jboss.seam.security.identity
14:00:26,359 INFO [Contexts] starting up: org.jboss.seam.web.session
I checked the seam sources and this is the line that is causing the exception (AuthenticationFilter.java #158):
if (!identity.isLoggedIn() && !identity.isCredentialsSet())
So, it "identity" is null. This is consistent with my observation (above) that the component was not started yet.
--
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
16 years, 6 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3108)
by Przemyslaw Jaskierski (JIRA)
Back button support for a
subprocess' page with back=enabled doesn't work
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: bulk
Back button support for a subprocess' page with back=enabled doesn't work
----------------------------------------------------------------------------
Key: JBSEAM-3108
URL: http://jira.jboss.com/jira/browse/JBSEAM-3108
Project: Seam
Issue Type: Bug
Components: BPM
Affects Versions: 2.1.0.A1
Environment: Seam 2.1-SNAPSHOT 2008-04-12, JDK6
Reporter: Przemyslaw Jaskierski
I have a bunch of subprocesses which are executed from main pageflow like this:
<process-state name="subprocess-regenerate-password">
<sub-process name="regeneratePasswordSubProcess.jpdl"/>
<transition to="checkCredentials"/>
</process-state>
and in this sub-process' pageflow I have something like:
<start-state name="start">
<transition to="step-enter-email"/>
</start-state>
<page name="step-enter-email" view-id="/user/regeneratePass.xhtml"
back="enabled">
<redirect/>
<transition name="REGISTER" to="subprocess-register"/>
<transition to="generateAndSendNewPassword"/>
</page>
But after using browser's back button from this subprocess and trying to perform different navigation from the main pageflow user is forced again into /user/regeneratePass.xhtml view and illegal navigation error is reported.
When there are no suprocesses back button handling works ok.
NOTE: there is another issue related to sub-process handling, which can be solved with similar approach to this one: JBSEAM-2854
--
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
16 years, 7 months