Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client-Controlled Transactions problem

 
Boris Valkov
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Folks,

I have problem while testing Client-Controlled Transactions with Sun app server 9.0_01
Here is my code:
InitialContext ctx = new InitialContext();
UserTransaction userTransaction = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
Bank bank = (Bank) ctx.lookup(Bank.class.getName());

System.out.println("Begining of UserTransaction " + userTransaction);
userTransaction.begin();
...

After invoking the last line of code (userTransaction.begin()) I have NullPointerException!
The whole stack trace is:
Begining of UserTransaction com.sun.enterprise.distributedtx.UserTransactionImpl@2b323e
2007-9-17 20:03:42 com.sun.jts.jta.TransactionManagerImpl <init>
SEVERE: JTS5043: Unexpected error occurred while creating transaction manager instance
java.lang.NullPointerException
at com.sun.jts.jta.TransactionManagerImpl.<init>(TransactionManagerImpl.java:174)
at com.sun.jts.jta.TransactionManagerImpl.getTransactionManagerImpl(TransactionManagerImpl.java:163)
at com.sun.jts.jta.UserTransactionImpl.init(UserTransactionImpl.java:198)
at com.sun.jts.jta.UserTransactionImpl.begin(UserTransactionImpl.java:74)
at com.sun.enterprise.distributedtx.UserTransactionImpl.begin(UserTransactionImpl.java:125)
at client.ejb.TestClient.runTest(TestClient.java:19)
at client.ejb.TestClient.main(TestClient.java:46)
java.lang.NullPointerException
at com.sun.jts.jta.TransactionManagerImpl.begin(TransactionManagerImpl.java:235)
at com.sun.jts.jta.UserTransactionImpl.begin(UserTransactionImpl.java:75)
at com.sun.enterprise.distributedtx.UserTransactionImpl.begin(UserTransactionImpl.java:125)
at client.ejb.TestClient.runTest(TestClient.java:19)
at client.ejb.TestClient.main(TestClient.java:46)

Is this really bug of Glasfish or does I something wrong ?
I found this post: http://forums.java.net/jive/message.jspa?messageID=133782
Maybe my problem is the same ?
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you set your Bean as a BMT by setting the TransactionType as Bean Managed? If not, this might be the cause, just guessing :roll:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic