Skip to main content

Problem when calling Remote EJB Method from Seam container

6 replies [Last post]
dea
Offline
Joined: 2008-12-19

When Seam component inside simple WAR application (Glassfish V2.1) tries to call Remote EJB method following exception is thrown:

Caused by: java.lang.RuntimeException: Cannot export transaction having non-XA resource: 2-phase commit not possible.
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.checkTransactionExport(J2EETransactionManagerOpt.java:282)
at com.sun.enterprise.iiop.ClientConnectionInterceptor.send_request(ClientConnectionInterceptor.java:101)
at com.sun.corba.ee.impl.interceptors.InterceptorInvoker.invokeClientInterceptorStartingPoint(InterceptorInvoker.java:271)
at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeClientPIStartingPoint(PIHandlerImpl.java:348)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:284)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:186)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
at com.problemator.ejb.ratings.__ProblematorRatingsRemote_Remote_DynamicStub.problemVotes(com/problemator/ejb/ratings/__ProblematorRatingsRemote_Remote_DynamicStub.java)
at com.problemator.ejb.ratings._ProblematorRatingsRemote_Wrapper.problemVotes(com/problemator/ejb/ratings/_ProblematorRatingsRemote_Wrapper.java)
at com.problemator.problem.Main.getVotes(Main.java:127)

This occurs only when Seam's transaction is active - e.g. when performing JSF action or within JSF application phase.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mvatkina
Offline
Joined: 2005-04-04

Yes, to propagate transaction through a remote interface, there needs to be a 2-phase commit protocol, and as such it requires XA resources capable of supporting it.

thanks,
-marina

dea
Offline
Joined: 2008-12-19

Thank you for answer. What resource can be the problem? Is it enough to change Datasource to XA or there is other resource type in Glassfish transaction?

Unfortunately I still have no success to eliminate this problem by converting JDBC connection pool to XADataSource type.

mvatkina
Offline
Joined: 2005-04-04

Yes, it should be enough. You need to specify XA version of the vendor DataSource classname as well.

thanks,
-marina

dea
Offline
Joined: 2008-12-19

Thank you very much, it seems I solved transaction propagation problem and remote method returns successfully.

However now I see another message in glassfish' log on each remote method call:
SEVERE: IOP5041: Principal propagation: Cannot find principal information in subject

Unfortunately I'm not able to found any description on this, probably this is caused by JAAS and it has default settings in my installation.

kumarjayanti
Offline
Joined: 2003-12-10

What security mechanism is configured for the EJB ?.

Is there any authentication that happens for access to the WebApp or is it an unsecure WebApp ?.

dea
Offline
Joined: 2008-12-19

It is unsecure WebApp.

I did not perform any security mechanism configuration for EJB on server side but for client side I found only example how to setup external JNDI lookup name. Unfortunately I see only example but no list of mechanisms.

Is it enough to set security mechanism as external JNDI property?