The exception indicates one of 2 situations that could happen at:

tx = transactionManager.getTransaction();

1. the transaction returned from transaction manager is null
2. the status of the transaction returned is not 'acitve'

both may happen if your application have not started a transaction. The reason depends on what werner wanted to know about 'declerative' or 'programmatic' transaction handling.

at 'declarative' you need to describe in the configuration that your code needs a active transaction and the container handles this for you.

at 'programmatic' you need take care to begin a transaction yourself at your application code. this can be done by looking up the transaction manager and call:

transactionManager.begin()

Hope this help you to continue. Werner and myself are now offline as its getting a bit late in europe. You may need to wait until tommorrow for more help. Having said that you could also reach us at irc://irc.codehaus.org/castor tomorrow.

Regards
Ralf
Castor JDO, committer


Tejesh Shetty schrieb:

Yeah I am using EJB. I didn't quite understood when you said declarative
or pragmatic. I am guessing declarative meant if it is bean managed EJB.
Then NO I am using container managed EJB.

For the test code Ralf sent I did try with
javax.transaction.TransactionManager and I do get a transactionmanager
back but when I try to do transactionmanager.getTransaction() it returns
null I don't know if it supposed to mean anything.

And the error that I get when using javax.transaction.TransactionManager
is
Failed to get an active transaction from J2EE transaction manager.

Tejesh Shetty | Software Programmer, MortgageHub Inc. | Conshohocken, PA
| Tel: 610.834.3800 ext 106 | [EMAIL PROTECTED]

-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 10, 2006 5:09 PM
To: [email protected]
Subject: Re: [castor-user] Castor Weblogic 8.1 transactionManager
returning null !!!

You'll need to replace java:comp/TransactionManager with
javax.transaction.TransactionManager to get any meaningful results ...

Werner

Tejesh Shetty wrote:
Ralf,

I tried your test code and get following exception

Unable to acquire instance of javax.transaction.TransactionManager:
java:comp/TransactionManager

Exception e:

org.exolab.castor.jdo.transactionmanager.TransactionManagerAcquireExcept
ion: Unable to acquire instance of
javax.transaction.TransactionManager:
java:comp/TransactionManager:
Tejesh Shetty | Software Programmer, MortgageHub Inc. | Conshohocken,
PA
| Tel: 610.834.3800 ext 106 | [EMAIL PROTECTED]

-----Original Message-----
From: Ralf Joachim [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 10, 2006 4:46 PM
To: [email protected]
Subject: Re: [castor-user] Castor Weblogic 8.1 transactionManager
returning null !!!

Hi Tejesh,

your jdo-conf seams to be ok. Below is the code castor uses to lookup TransactionManager from JNDI if you like to test. You should propable consult WebLogic docs on the proper JNDI name.

Having said that a stacktrace would would help us to give you more
hints.



   /** The <a
href="http://jakarta.apache.org/commons/logging/";>Jakarta
    *  Commons Logging</a> instance used for all logging. */
   private static final Log LOG = LogFactory.getLog(
           JNDIENCTransactionManagerFactory.class);
/** Default JNDI binding for <tt>javax.transaction.TransactionManager</tt>
    *  instance. */
public static final String TRANSACTION_MANAGER_NAME = "java:comp/TransactionManager";

   /** The name of the factory. */
   public static final String NAME = "jndi";

//----------------------------------------------------------------------
----

   /**
* @see org.castor.transactionmanager.TransactionManagerFactory#getName()
    */
   public String getName() { return NAME; }

   /**
    * @see org.castor.transactionmanager.TransactionManagerFactory
    *      #getTransactionManager(java.util.Properties)
    */
public TransactionManager getTransactionManager(final Properties properties)
   throws TransactionManagerAcquireException {
String jndiENC = properties.getProperty("jndiEnc", TRANSACTION_MANAGER_NAME);
       Object found = null;
       TransactionManager transactionManager = null;
try {
           found = new InitialContext().lookup(jndiENC);
transactionManager = (TransactionManager) found; } catch (ClassCastException ex) { String msg = "Problem casting instance of " + found.getClass().getName()
                      + " to javax.transaction.TransactionManager.";
           LOG.error(msg);
           throw new TransactionManagerAcquireException(msg, ex);
       } catch (Exception ex) {
           String msg = "Unable to acquire instance of "
                      + "javax.transaction.TransactionManager: " +
jndiENC;
           LOG.error(msg);
           throw new TransactionManagerAcquireException(msg, ex);
       }

       if (transactionManager == null) {
           String msg = "Unable to acquire instance of "
                      + "javax.transaction.TransactionManager: " +
jndiENC;
           LOG.error(msg);
           throw new TransactionManagerAcquireException(msg);
       }
return transactionManager;
   }


Regards
Ralf
Castor JDO, committer


Tejesh Shetty schrieb:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jdo-conf PUBLIC "-//EXOLAB/Castor JDO Configuration DTD
Version 1.0//EN"
                         "http://castor.org/jdo-conf.dtd";>
<jdo-conf>
        <database name="CoreHub" engine="oracle">
                <jndi name="java:comp/env/jdbc/corehub"/>
                <mapping href="CoreHub.xml"/>
        </database>
 <transaction-demarcation mode="global">
  <transaction-manager name="jndi">
      <!--<param name="jndiEnc"
value="javax.transaction.TransactionManager"/>-->
     <param name="jndiEnc" value="java:comp/UserTransaction"/>

  </transaction-manager>
</transaction-demarcation>
</jdo-conf>

Tejesh Shetty | Software Programmer, MortgageHub Inc. | Conshohocken,
PA

| Tel: 610.834.3800 ext 106 | [EMAIL PROTECTED]

-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 10, 2006 4:13 PM
To: [email protected]
Subject: Re: [castor-user] Castor Weblogic 8.1 transactionManager
returning null !!!

Hi,

what does your JDO config file look like ?

Regards
Werner

Tejesh Shetty wrote:



Hi,



I am trying to deploy an application on Weblogic 8.1 using castor
0.991.



Looks like EJB deploys well but during login when ejb tries to go get
something from database it dies saying unable to get database
connection. I did some test method and found out that it's not
getting
transaction out of TransactionManager and its returning null. I am
not
sure if jndi is not set up correctly in database.xml. Currently it
goes



look for "java:com/UserTransaction".I think other options were
"javax.transaction.TransactionManager" gives back the same exception.



Any help on this will be great.



Thanks in advance.





**Tejesh Shetty | ****Software Programmer, MortgageHub Inc. |
Conshohocken, PA | Tel: 610.834.3800 ext 106 | [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>m <mailto:[EMAIL PROTECTED]>**



-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------


-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------


-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------


-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------



-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to