Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
13. Jul 2008, 16:26 CET | Link

Please, help... I put two ear based on JBSeam in jboss deploy. In first ear stateful session bean method is invoked from JNDI (remote inteface) for authentificate.

/// Code from ear1

if(service == null) {
    InitialContext context = JNDIContextService.getContext("service-jndi.properties");
    service = (IRmiService)context.lookup("service/RmiService/remote");
    saleTicketService.login("login", "passwd");
}

///

In other ea in session bean do next:

/// Statefull from ear2

Lifecycle.mockApplication();
Lifecycle.beginCall();
Lifecycle.beginSession(new Hashtable<String, Object>());
Identity.instance().setUsername(username);
Identity.instance().setPassword(password);
Lifecycle.mockApplication();
Identity.instance().login();
Lifecycle.endCall();

///

But Identity.instance().login(); doesn't work correctly. I have traced code and searched, that the Application context was changed during invoke Identity.instance().login() and it became same as context from first ea when execute EL authenticate-method #{Authenticator.authenticate}!?

If i use two different jboss servers for ears, it works correctly...

2 Replies:
13. Jul 2008, 23:42 CET | Link

Why are you mocking the application like that? Assuming your service is a Seam component there is no need.

Anyway, I guess it depends on whether the same thread is used on the server side of the rpc call. (I guess it is, but I don't know much about EJB3, I think you should be able to alter this).

 

Read about how to report a bug.

14. Jul 2008, 07:13 CET | Link

Thanks.

Why are you mocking the application like that?

Yes. Instead web-service I use rmi.

I guess it depends on whether the same thread is used on the server side of the rpc call.

It's correct, where it thread overlap. In session bean has its Application context, but I guess during Identity.login invoke native methods, in which the thread switch.