Accessing a protected JSF page causes
basel Jul 7, 2006 1:08 PMI managed to get declarative security to work with JBoss and MySQL using FORM based authentication. Everything works fine except when I try to acess a protected JSF page. Accessing a JSF page that is not protected is perfectly fine.
Here is what happens:
1. I point the browser to a protected JSF page such as localhost:8080/seam_01/pro/guess.jsf
2. The server loads the login.jsp page
3. Entering a wrong username and password causes the error.jsp page to be displayed
4. Accessing the same protected page agains shows the login.jsp page
5. Upon entering valid username and password, the server returns "HTTP Status 404 - /seam_01/pro/guess.jsf"
6. Now accessing a non-protected page such as localhost:8080/seam_01/simple.jsf is just fine
7. Also, accessing a protected resource other than JSF pages works fine as well.
Now going back to console I can see a long stack trace. Here are some excerpts from it:
19:36:46,105 ERROR [STDERR] org.dom4j.DocumentException: Error on line -1 of document : Premature end of file. Nested exception: Premature end of file. 19:36:46,106 ERROR [STDERR] at org.dom4j.io.SAXReader.read(SAXReader.java:482) 19:36:46,106 ERROR [STDERR] at org.dom4j.io.SAXReader.read(SAXReader.java:343) 19:36:46,106 ERROR [STDERR] at org.jboss.seam.core.Pages.initialize(Pages.java:77) 19:36:46,106 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... 19:36:46,113 ERROR [STDERR] Nested exception: 19:36:46,113 ERROR [STDERR] org.xml.sax.SAXParseException: Premature end of file. 19:36:46,113 ERROR [STDERR] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) 19:36:46,114 ERROR [STDERR] at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) 19:36:46,114 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 19:36:46,114 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 19:36:46,114 ERROR [STDERR] at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) 19:36:46,114 ERROR [STDERR] at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source) 19:36:46,115 ERROR [STDERR] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) 19:36:46,115 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) 19:36:46,115 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) 19:36:46,115 ERROR [STDERR] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) 19:36:46,115 ERROR [STDERR] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) 19:36:46,115 ERROR [STDERR] at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) 19:36:46,116 ERROR [STDERR] at org.dom4j.io.SAXReader.read(SAXReader.java:465) 19:36:46,116 ERROR [STDERR] at org.dom4j.io.SAXReader.read(SAXReader.java:343) 19:36:46,116 ERROR [STDERR] at org.jboss.seam.core.Pages.initialize(Pages.java:77) ... 19:36:46,123 ERROR [STDERR] Nested exception: 19:36:46,123 ERROR [STDERR] org.xml.sax.SAXParseException: Premature end of file. 19:36:46,123 ERROR [STDERR] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) 19:36:46,124 ERROR [STDERR] at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) 19:36:46,124 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 19:36:46,124 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 19:36:46,128 ERROR [STDERR] at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) 19:36:46,129 ERROR [STDERR] at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source) 19:36:46,129 ERROR [STDERR] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) 19:36:46,129 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) 19:36:46,129 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) 19:36:46,129 ERROR [STDERR] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) 19:36:46,130 ERROR [STDERR] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) 19:36:46,130 ERROR [STDERR] at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) 19:36:46,130 ERROR [STDERR] at org.dom4j.io.SAXReader.read(SAXReader.java:465) 19:36:46,130 ERROR [STDERR] at org.dom4j.io.SAXReader.read(SAXReader.java:343) 19:36:46,130 ERROR [STDERR] at org.jboss.seam.core.Pages.initialize(Pages.java:77) .... 19:36:46,138 ERROR [STDERR] Jul 8, 2006 7:36:46 PM com.sun.faces.lifecycle.LifecycleImpl phase WARNING: phase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@309b3e5e) threw exception: java.lang.IllegalArgumentException: exception invoking: initialize exception invoking: initialize org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:43) org.jboss.seam.Component.callComponentMethod(Component.java:1334) org.jboss.seam.Component.callCreateMethod(Component.java:1322) org.jboss.seam.Component.newInstance(Component.java:1312) org.jboss.seam.Component.getInstance(Component.java:1263) org.jboss.seam.Component.getInstance(Component.java:1253) org.jboss.seam.Component.getInstance(Component.java:1235) org.jboss.seam.core.Pages.instance(Pages.java:191) org.jboss.seam.jsf.AbstractSeamPhaseListener.callPageActions(AbstractSeamPhaseListener.java:128) org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:98) org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:50) com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:249) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159) javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) ...
How can I get this working?