aspose file tools*
The moose likes JBoss/WildFly and the fly likes TransactionSynchronizationRegistry lookup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "TransactionSynchronizationRegistry lookup" Watch "TransactionSynchronizationRegistry lookup" New topic

TransactionSynchronizationRegistry lookup

Melquiades Fagundez

Joined: Sep 23, 2010
Posts: 2

When I lookup TransactionSynchronizationRegistry using the following code:

try {
Context ctx = new InitialContext(props);
transactionRegistry = (TransactionSynchronizationRegistry) ctx.lookup("java:TransactionSynchronizationRegistry");
} catch (Exception e) { .. }

I am getting the following exception

Caused by: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.ClassCastException: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple cannot be cast to javax.naming.spi.ObjectFactory]
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure( [:5.0.5.Final]
at org.jnp.interfaces.NamingContext.lookup( [:5.0.5.Final]
at org.jnp.interfaces.NamingContext.lookup( [:5.0.5.Final]
at javax.naming.InitialContext.lookup( [:1.6.0_21]

As long as I understand the lookup "succeeds" and it finds object of type com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple but this object cannot be cast to expected type.

Can anybody help me??

Thanks in advance,

I agree. Here's the link:
subject: TransactionSynchronizationRegistry lookup
Similar Threads
javax.naming.NamingException: Invalid reference. Error: invalid field type for server in class org.
Problem when accessing JMX (RMI Adaptor) from JNDI namespace
First Session Bean failing in JBOSS
Problem when accessing JMX (RMI Adaptor) from JNDI namespace
EJB 2.1 with JBOSS - EJB lookup from JNDI failing with NameNotFoundException bean name not bound