1

I'm trying to use 'TransactionSynchronizationRegistry' via EJB injection in a session bean. However during deployment on a weblogic App Server i got the error that 'TransactionSynchronizationRegistry' is not properly defined in weblogic-ejb-jar.xml. I tried to do that but with no success so far. I tried doing the following:

<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd"
                  xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar">
  <weblogic-enterprise-bean>
    <ejb-name>asdas</ejb-name>
    <resource-description>
      <res-ref-name>TransactionSynchronizationRegistry</res-ref-name>
      <jndi-name>java:comp/env/TransactionSynchronizationRegistry</jndi-name>
    </resource-description>
  </weblogic-enterprise-bean>
</weblogic-ejb-jar>
Bhesh Gurung
  • 50,430
  • 22
  • 93
  • 142
Brams
  • 61
  • 1
  • 5
  • `@Resource TransactionSynchronizationRegistry tsr` should be sufficient. Please show the full error output. – Brett Kail Dec 15 '11 at 15:27

1 Answers1

2

I managed to make this work. I was doing the injection as such:

@Resource
TransactionSynchronizationRegistry trx;

so instead of modifying weblogic-ejb-jar.xml, i modified the injection to become as such:

@Resource (mappedName = "java:comp/TransactionSynchronizationRegistry")
TransactionSynchronizationRegistry trx;

It worked!

Brams
  • 61
  • 1
  • 5