[JBoss Seam] - Does seam pojo component support long running conversations?
by milli
>From the document I see the seam pojo component is stateful and has the default conversation scope. It also supports long running conversation. But it does not work for me. Is my understanding wrong or am I doing something wrong in my code? Any help is appreciated.
@Name("transactionPage")
| public class TransactionPage extends AbstractPage {
| ......
| @Create
| public void initialize() {
| log.debug("************transactionPage created*****************");
| }
|
| @Begin
| public String initiatePayment {
| ....
| return null;
| }
|
| public String confirmDetails {
| .....
| return null;
| }
|
| @End
| public String confirmed {
| ....
| return null;
| }
| }
I have transaction.xhtml calling actions initiatePayment, confirmDetails and confirmed after every step.
What I notice is the method initialize(included for debuggin) is called everytime and resetting all the state stored from previous step. In a long running conversation I believe it should be called only once.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082818#4082818
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082818
18 years, 7 months
[Installation, Configuration & DEPLOYMENT] - Error when deploy two beans have same names!
by changemylife
Hi all!
I use jboss-4.0.5.GA and EJB3.0
I write two beans that have same name (called BeanA). Example:
anonymous wrote : Inside package: my.com has a bean called BeanA and exported to "my.jar"
| Inside package: john.com has a bean called Bean A and exported to "john.jar"
I deployed two jars follow order: my.jar is first, and john.jar is second. Deploying two jars (my.jar and john.jar) is Ok!
On the client side, I write two clients. Client1 use my.jar and client2 use john.jar
import my.com.BeanA;
| ...
| Context ctx = new InitialContext();
| BeanA b = (BeanA)ctx.lookup(BeanABean/remote);
| b.add(1,2);
---> all works are ok!
But on the Client2:
import john.com.BeanA;
| ..
| Context ctx = new InitialContext();
| BeanA b = (BeanA)ctx.lookup(BeanABean/remote);
| b.add(1,2);
And then, Client2 received error :
Exception in thread "main" java.lang.ClassCastException: $Proxy0
| at client.ClientTest1.main(ClientTest1.java:18)
at line:
BeanA b = (BeanA)ctx.lookup(BeanABean/remote);
I think that my.jar is first deployed so my works are success! And JBoss not recognize john.jar when it deployed after, so my works are fail !
Have ideas about this problem? Please guide to me!
Thanks very much.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082817#4082817
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082817
18 years, 7 months
[JBoss Seam] - credit card transactions with Seam
by matt.drees
I need to implement credit card transactions using authorize.net. I wanted to ask if anyone had feedback on the approach I'm planning to use, because I'm a relatively young developer and this is a pretty important thing to get right, and there are many smart and experienced people here.
I would have an action method (in a conversation-scoped bean) that looks something like this:
| public void processPayment() {
| //execute an AUTH_ONLY request, which checks funds availability etc, but doesn't transfer funds, and returns an authcode
| if (successful) {
| //create payment record (with authcode) and persist to DB. Store transaction id locally for capture step.
| raiseTransactionSuccessEvent("creditCardSuccess");
| } else {
| //prompt user for corrected info or show error screen as appropriate
| }
| }
|
| @Observer("creditCardSuccess")
| public void capturePayment() {
| //execute a PRIOR_AUTH_CAPTURE request, which does the transfer, using the stored transaction id
| if (successful) {
| //don't do much except log a success
| } else {
| //email the admin notifying him/her of failure. Admin would probably need to manually trigger a capture.
| }
| }
|
The idea is I don't want to charge the user unless I know I have a record of their payment, so I wait until the transaction completes successfully.
I've not done too much with transaction-aware code, but I think I'm using it correctly. Does this seem reasonable? Thanks for your time.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082816#4082816
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082816
18 years, 7 months