Closed glassfishrobot closed 15 years ago
@glassfishrobot Commented rogerk said: Hi Andy -
Please provide the war (and source) that works on jboss?
Thanks, Roger.
@glassfishrobot Commented agibson77 said: Created an attachment (id=3884) War file of web app working in JBOss 5.2 beta, and not in Glassfish b71
@glassfishrobot Commented rogerk said: Hi Andy -
Do you have source? Also may be provide your ConverstionAwareViewHandler?
@glassfishrobot Commented agibson77 said: Created an attachment (id=3885) Sources for attached war file
@glassfishrobot Commented agibson77 said: I didn't include them originally as I wanted to verify that they worked as I was claiming (works in JBoss, not in Glassfish).
I've attached a war file and the source for the war. It was built from the weld examples which uses common properties, scripts and libraries to build the examples so I don't have a simple project for the war file to build from without include the whole examples directory structure.
@glassfishrobot Commented agibson77 said: The ConversationAwareViewHandler is in the weld distribution located in the weld-osgi-bundle.jar file. It is even in the original version distributed with Glassfish build 71 as well as the latest version.
The full name is :
org.jboss.weld.jsf.ConversationAwareViewHandler
Cheers,
Andy
@glassfishrobot Commented rogerk said: Hi Andy -
The war example (weld-numberguess.war) does not have the buttons you outline in your instructions for this post. It is the traditional weld numberguess app with "guess" and "reset" buttons and one additional "long" button. How should I test with this?
@glassfishrobot Commented agibson77 said: My apologies Roger for not including a test plan, I meant to but had some other things going on.
To test the problem, start the war, put in a number and click guess (and hope you don't get the right number first time!). Keep putting in guesses, and the conversation instance displayed on the page should keep changing, the id will increment as you use a new conversation each time. However, when you click the long button, it should turn the conversation into a long running one, and now each time you click guess, the same conversation instance should be displayed as the same conversation is used each time. Transient should also be false each time since it is a long running conversation.
What is happening now is that even when you click to make the conversation long running, it is still using a new conversation each time (the conversation id number keeps incrementing and transient is still true).
Cheers,
Andy
@glassfishrobot Commented rogerk said: The fix for this was:
1. export org.jboss.weld.jsf package in weld osgi bundle pom 2. add ConversationAwareViewHandler in weld integration faces-config.xml (this was not documented in weld ref doc).
I've verified with the poster that the fix works:
"Hey Roger, Success! Thanks for getting back to me on this, the solution you gave me with the new osgi bundle and integration files works just fine. Sorry I left out the test plan, I had some other things going on yesterday so I didn't get to document it as I had planned. I have gone ahead and documented the test plan anyway just for future reference. Thanks again, Cheers,
Andy Gibson "
This fix sill have to go into the next integration.
@glassfishrobot Commented File: weld-numberguess-sources.jar Attached By: agibson77
@glassfishrobot Commented File: weld-numberguess.war Attached By: agibson77
@glassfishrobot Commented Was assigned to rogerk
@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-11000
@glassfishrobot Commented Reported by agibson77
@glassfishrobot Commented Marked as fixed on Friday, November 13th 2009, 1:33:20 am
This issue is documented at http://www.seamframework.org/Community/ConversationScopeNotWorking . However, the original post was a separate issue, and my issue starts around the 6th post down til the end. The specifics are included below.
I am using Glassfish build 71, with Netbeans Dev Build 200911091156. I am also using the latest Weld version
I have duplicated this problem with my own test project and also with the weld number guess examples. The gist of the problem is that it appears that conversations are not being propagated across JSF postbacks. Even when a conversation has been started, a new instance of the conversation is used for each postback. Non-Conversational Weld apps or apps that just use session or request beans work fine. I think the problem may be that there is no ConversationAwareViewHandler defined for weld deployments. I can provide a war file that works on JBoss 5.2 beta but has this problem on Glassfish if you need it.
Test Case
As a test, I have a bean that is conversationally scoped, and has a conversation injected into it :
@ConversationScoped @Named("myBean") public class MyBean implements Serializable {
@Inject private Conversation conversation;
public void startConversation()
{ conversation.begin(); }
public void dummy() {
}
public boolean isTransient()
{ return conversation.isTransient(); }
}
In my page, I show the conversation instance and have a button that calls the startConversation() method. I also have a dummy button that does nothing but post back to the page.
Is Transient : # {myBean.transient}
Conversation = # {javax.enterprise.context.conversation}