EJBCLIENT000045: User transactions not supported by this context in JBoss EAP 6.4
Issue
- We are getting this error trying to use UserTransaction from one EAP 6.4 server calling an EJB on another EAP 6.4 server using the server to server configuration.
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/client].[Faces Servlet]] (http-127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalStateException: EJBCLIENT000045: User transactions not supported by this context
at org.jboss.ejb.client.EJBClientTransactionContext.getUserTransaction(EJBClientTransactionContext.java:138) [jboss-ejb-client-1.0.41.Final-redhat-1.jar:1.0.41.Final-redhat-1]
at org.jboss.ejb.client.EJBClient.getUserTransaction(EJBClient.java:265) [jboss-ejb-client-1.0.41.Final-redhat-1.jar:1.0.41.Final-redhat-1]
at com.jboss.examples.ejb3.gui.BackingBean.helloWithUtx(BackingBean.java:84) [classes:]
import org.jboss.ejb.client.EJBClient;
import javax.transaction.UserTransaction;
...
Properties props = new Properties();
props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
Context context = new InitialContext(props);
UserTransaction utx=EJBClient.getUserTransaction("yourServerName");
...
utx.begin();
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6.4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.