Results 1 to 4 of 4

Thread: HttpInvokerServiceExporter does not work if the method has @Transactional attribute.

  1. #1
    Join Date
    May 2011
    Posts
    7

    Default HttpInvokerServiceExporter does not work if the method has @Transactional attribute.

    I am trying to use HttpInvokerServiceExporter to expose one of my Service Classes and it has transactional methods. and it is not working. But the moment When I do not have any transactions. But just print "Hello World". Everything works. I am using Atomikos. Do I have to configure anything for this to work. I exactly did all the configuration as mentioned in the Tutorial.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Just stating 'it doesn't work' isn't really helpful... The first reaction for me (did some helpdesk work ages ago ) is have you plugged it in?...

    So please be more elaborate on what isn't working, what happens, what doesn't happen. Do you get exceptions etc. post some code, configuration...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    May 2011
    Posts
    7

    Default

    Thanks for your reply this is what I have

    applicationContext.xml

    <bean name="remoteService" class="com.test.service.RemoteServiceImpl" />

    <bean name="remoteTestService" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter"
    p:service-ref="remoteService"
    p:serviceInterface="com.test.service.RemoteService " />


    in test-servlet. Test is my Web App

    <bean name="remoteService" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter">
    <property name="service" ref="remoteService"/>
    <property name="serviceInterface" value="com.test.service.RemoteService"/>
    </bean>

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <prop key="/remoteService">remoteService</prop>
    </props>
    </property>
    </bean>


    RemoteServieImpl



    public class RemoteServiceImpl implements RemoteService {

    private final static Logger logger = LoggerFactory.getLogger(RemoteServiceImpl.class);

    public void inquireUserProfiles() {
    //Call some inquireMethod in a service that is Transactional enabled
    }


    I did a debugging it come to this line in HttpInvokerServiceExporter and Hangs.

    RemoteInvocationResult result = invokeAndCreateResult(invocation, getProxy());


    This is what I see in the logs


    11-01-12 10:45:06.846 DEBUG [ o.s.t.j.JtaTransactionManager]: Suspending current transaction, creating new transaction with name [com.test.service.UserServiceImpl.inquireUserProfil es]
    11-01-12 10:45:08.166 DEBUG [ o.s.t.j.JtaTransactionManager]: Initiating transaction rollback
    11-01-12 10:45:08.169 DEBUG [ o.s.t.j.JtaTransactionManager]: Resuming suspended transaction after completion of inner transaction
    11-01-12 10:45:08.172 DEBUG [ o.s.t.j.JtaTransactionManager]: Participating transaction failed - marking existing transaction as rollback-only
    11-01-12 10:45:08.173 DEBUG [ o.s.t.j.JtaTransactionManager]: Setting JTA transaction rollback-only
    11-01-12 10:45:08.175 DEBUG [ o.s.t.j.JtaTransactionManager]: Transactional code has requested rollback
    11-01-12 10:45:08.176 DEBUG [ o.s.t.j.JtaTransactionManager]: Initiating transaction rollback
    11-01-12 10:45:08.179 DEBUG [ o.s.t.j.JtaTransactionManager]: Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
    11-01-12 10:45:08.182 DEBUG [.b.f.s.DefaultListableBeanFactory]: Returning cached instance of singleton bean 'txManager'
    11-01-12 10:45:08.184 DEBUG [ o.s.t.j.JtaTransactionManager]: Participating in existing transaction
    11-01-12 10:45:08.186 DEBUG [.b.f.s.DefaultListableBeanFactory]: Returning cached instance of singleton bean 'txManager'
    11-01-12 10:45:08.187 DEBUG [ o.s.t.j.JtaTransactionManager]: Suspending current transaction, creating new transaction with name [com.test.service.UserServiceImpl.inquireUserProfil es]
    11-01-12 10:45:09.495 DEBUG [ o.s.t.j.JtaTransactionManager]: Initiating transaction rollback
    11-01-12 10:45:09.497 DEBUG [ o.s.t.j.JtaTransactionManager]: Resuming suspended transaction after completion of inner transaction
    11-01-12 10:45:09.499 DEBUG [ o.s.t.j.JtaTransactionManager]: Participating transaction failed - marking existing transaction as rollback-only
    11-01-12 10:45:09.499 DEBUG [ o.s.t.j.JtaTransactionManager]: Setting JTA transaction rollback-only
    11-01-12 10:45:09.500 DEBUG [ o.s.t.j.JtaTransactionManager]: Transactional code has requested rollback
    11-01-12 10:45:09.501 DEBUG [ o.s.t.j.JtaTransactionManager]: Initiating transaction rollback
    11-01-12 10:45:09.502 DEBUG [ o.s.t.j.JtaTransactionManager]: Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
    11-01-12 10:45:09.504 DEBUG [.b.f.s.DefaultListableBeanFactory]: Returning cached instance of singleton bean 'txManager'
    11-01-12 10:45:09.505 DEBUG [ o.s.t.j.JtaTransactionManager]: Participating in existing transaction
    11-01-12 10:45:09.506 DEBUG [.b.f.s.DefaultListableBeanFactory]: Returning cached instance of singleton bean 'txManager'
    11-01-12 10:45:09.507 DEBUG [ o.s.t.j.JtaTransactionManager]: Suspending current transaction, creating new transaction with name [com.test.service.UserServiceImpl.inquireUserProfil es]
    11-01-12 10:45:10.796 DEBUG [ o.s.t.j.JtaTransactionManager]: Initiating transaction rollback
    11-01-12 10:45:10.799 DEBUG [ o.s.t.j.JtaTransactionManager]: Resuming suspended transaction after completion of inner transaction
    11-01-12 10:45:10.801 DEBUG [ o.s.t.j.JtaTransactionManager]: Participating transaction failed - marking existing transaction as rollback-only
    11-01-12 10:45:10.802 DEBUG [ o.s.t.j.JtaTransactionManager]: Setting JTA transaction rollback-only
    11-01-12 10:45:10.804 DEBUG [ o.s.t.j.JtaTransactionManager]: Transactional code has requested rollback
    11-01-12 10:45:10.806 DEBUG [ o.s.t.j.JtaTransactionManager]: Initiating transaction rollback
    11-01-12 10:45:10.809 DEBUG [ o.s.t.j.JtaTransactionManager]: Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
    11-01-12 10:45:10.811 DEBUG [.b.f.s.DefaultListableBeanFactory]: Returning cached instance of singleton bean 'txManager'
    Last edited by saramani; Nov 1st, 2012 at 09:57 AM.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Please use [ code][/code ] tags when posting code/xml/stacktraces/logging... That way it remains readable..

    You have 2 exporters why? I don't see a factorybean for creating the client side proxybean.

    i see nothing related to transactions or whatever so please post all things needed.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •