File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!