Announcement Announcement Module
Collapse
No announcement yet.
invoking transactional Spring bean from Message Driven Bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • invoking transactional Spring bean from Message Driven Bean

    Hello Everybody,
    I am new to EJB -Spring integration. I am facing a problem. What I am doing is I have a wrapper object (this is not a spring bean) which has an "execute" method, inside this method it lookup a spring bean (using BeanFactoryLocator) and invoked a method (which is marked as transaction using spring annotation) on this lookedup spring bean. The algorithem in the transactional method of spring bean has to be invoked asynchronously

    Environment is Spring 3.0, GlassFish server 2.1, EJB3.0

    Now how the flow is:-
    System created an insteance of weapper object and submit it to a Queue. When the Message Driven Bean receives this wrapper object, inside onMessage method it invoke "execute" method of wrapper object. which inturn invokes transactional method of spring bean (as mentioned above after looking up the spring bean).
    But when the transactional method of spring bean is invoked I am getting following error
    ------------------------------------------------------------------------------------------------
    java.lang.IllegalStateException: Operation not allowed.
    at com.sun.enterprise.distributedtx.UserTransactionIm pl.checkUserTransactionMethodAccess(UserTransactio nImpl.java:135)
    at com.sun.enterprise.distributedtx.UserTransactionIm pl.getStatus(UserTransactionImpl.java:262)
    at org.springframework.transaction.jta.JtaTransaction Manager.isExistingTransaction(JtaTransactionManage r.java:795)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.getTransaction(AbstractPl atformTransactionManager.java:345)
    ------------------------------------------------------------------------------------------------

    Note:- I tried two options
    1> MDB's onMessage method was marked as transaction using annotation
    1> MDB's onMessage method as non transaction

    Could any one please provide what is going wrong here.

  • #2
    Hi,

    I would like to help you with this but I don't know which is the problem.

    Do you already solve this problem? In my company, we are trying to find a way to solve transactional problems in our distributed application, and we are thinking use EJB only for the remote invocations between the multiple modules instead of Spring remoting (RMI, httpinvoker, etc...)

    My question is... It's possible inside an EJB to lookup a bean that was created in a web application and pass the transaction context?

    The scenario will be.. Spring bean starts a method execution, invokes an EJB that is a wrapper to a Spring Bean in module B, retun to module A to execution some addition business logic and if anything fails we want to rollback everything in Module A and B.

    Thanks!

    Comment

    Working...
    X