-
1. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
nickarls May 14, 2010 10:33 PM (in response to ssamayoagt)I think you should use the normal Servlet/JSF exception handling mechanism for this. I guess Seam and other frameworks will also provide this.
-
2. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
pmuir May 19, 2010 1:46 PM (in response to ssamayoagt)
Nicklas Karlsson wrote on May 14, 2010 22:33:
I think you should use the normal Servlet/JSF exception handling mechanism for this. I guess Seam and other frameworks will also provide this.It will
-
3. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
nikolafon Jun 11, 2010 8:13 PM (in response to ssamayoagt)Hi, I am really having hard time catching org.jboss.weld.context.NonexistentConversationException. Error page configuration in web.xml just won't work
<error-page>
<exception-type>org.jboss.weld.context.NonexistentConversationException</exception-type>
<location>/faces/error.xhtml</location>
</error-page>
I always getting
XML Parsing Error: no element found
Location: http://localhost:8080/test6/faces/index.xhtml?cid=5
Line Number 1, Column 1:
as a result on screen and org.jboss.weld.context.NonexistentConversationException thrown.
Can anybody help me? -
4. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
ifischer Jun 12, 2010 12:28 PM (in response to ssamayoagt)I don't know why you get an XML parsing error.
But for the NonexistentConversationException, i think you can use an ExceptionHandlerFactory and a CustomExceptionHandler, as described here.
I know it works for a ViewExpiredException, so i guess it could also be used to handle a NonexistentConversationException (couldn't test it).As far as i know exceptions like these can't be catched by a rule in the web.xml (anyone got a good explanation or a veto?).
-
5. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
nikolafon Jun 12, 2010 1:14 PM (in response to ssamayoagt)Error page configuration for ViewExpiredException works just fine. No need for ExceptionHandlerFactory and CustomExceptionHandler. Exception is succesfully catched and redirected. But for NonexistentConversationException not the case. I'm getting XML parsing error. And i just want to catch the exception web.xml and redirect, i don't want to write CustomExceptionHandler.
-
6. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
nickarls Jun 13, 2010 2:42 AM (in response to ssamayoagt)Post the whole web.xml, you must have some blank or something to get the parse error.
But on the topic of CustomExceptionHandlers in JSF, tried converting the Ed Burns blog on the subject to catch a NPE thrown from the app but it still ended up wrapped in some EL/Faces exception that made tracing the NPE impossible(?). I thought we got past that in JSF 2, no?
-
7. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
pmuir Jun 13, 2010 8:22 AM (in response to ssamayoagt)You should be able to catch this exception with a rule in web.xml. If you can't, then please file a WELD issue and we can try to take a look.
-
8. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
nikolafon Jun 13, 2010 10:57 AM (in response to ssamayoagt)If you say so than I will not rush to file an issue. I will try to test it more in order to solve the problem. Thanks for answers.
-
9. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
nickarls Jun 13, 2010 11:15 AM (in response to ssamayoagt)
Nikola Nikolić wrote on Jun 13, 2010 10:57:
If you say so than I will not rush to file an issue. I will try to test it more in order to solve the problem. Thanks for answers.Go ahead and file one since
should
in the context above meanstheoretically
and can be over-proven by a failing test case ;-) -
10. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
hirowla.ian.rowlands.three.com.au Jun 13, 2010 8:19 PM (in response to ssamayoagt)Pete, see this thread for something similar. I have an exception handler but cannot catch all errors inside JSF.
-
11. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
nikolafon Jun 14, 2010 1:52 PM (in response to ssamayoagt)Ok here it is https://jira.jboss.org/browse/WELD-554. I hope it will be fixed or at least we can have an explanation of why it is happening. This is my first time reporting and issus on Jira so don't mind if I haven't reported it right way.
-
12. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
ifischer Jun 16, 2010 7:26 PM (in response to ssamayoagt)I just tested this issue with the current Glassfish release V3.0.1 (what Weld does it contain, i think Weld 1.0.1Final?).
As it seems it's still not possible at all to catch a ViewExpiredException NOR a NonexistentConversationException by a rule in the WEB.XML.
Or at least i don't know what i have to do to catch it additionally to write the corresponding error-pages into the WEB.XML. So the following snippet has NO effect to my application, the exceptions aren't catched:<error-page> <exception-type>javax.enterprise.context.NonexistentConversationException</exception-type> <location>/error.xhtml</location> </error-page> <error-page> <exception-type>org.jboss.weld.context.NonexistentConversationException</exception-type> <location>/error.xhtml</location> </error-page> <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/error.xhtml</location> </error-page>
However, as i told, with an ExceptionHandlerFactory it works. I'm currently catching both exceptions in this way.
Until Seam3, i think it's the best way to handle these exceptions. Mainly becaues you can do some logic in your Handler (for example print the view id on the error page). I don't know a way to do some logic stuff when handling it with web.xml (am i wrong?)I'll also add this as a comment to the issue.
-
13. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
ifischer Jun 16, 2010 7:57 PM (in response to ssamayoagt)Ok sorry its actually possible. I cleaned everything and redeployed, now my Exceptionhandler in WEB.XML works for both exceptions. It's redirecting to plaing html sites.
BTW, when upgrading from GF V3 to GF V3.0.1, i had to add the following dependency to my pom.xml, otherwise the NonexistentConversationException is not found:
<dependency> <groupId>org.jboss.weld</groupId> <artifactId>weld-core</artifactId> <version>1.0.1-Final</version> <scope>provided</scope> </dependency>
-
14. Re: Catch "WELD-000301 Could not restore long-running conversation x because id not known"
pmuir Jul 21, 2010 7:46 AM (in response to ssamayoagt)That you have to add that dependency seems like a but in GF to me - it should be in the CDI API classes.