Results 1 to 10 of 10

Thread: Having issues in service-activator while applying TransActions

  1. #1
    Join Date
    Nov 2012
    Posts
    14

    Default Having issues in service-activator while applying TransActions

    Hi All,

    I have a Service (POJO),which has insertCustData method, it inserts the data into DB. I am calling this service through ServiceActivator,

    it is working fine without any annotations.

    Example Code:

    <int:service-activator input-channel="channel1"
    output-channel="channel2" ref="InsertService"
    method="insertCustData">
    </int:service-activator>



    @ServiceActivator
    public Message<Object> insertCustData(Message<Map<String, Object>> m){
    }

    if apply transaction over the method , I am getting below error ,Somebody could help me to resolve this issue



    Example Code:

    <int:service-activator input-channel="channel1"
    output-channel="channel2" ref="InsertService"
    method="insertCustData">
    </int:service-activator>

    @ServiceActivator
    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Throwable.class)
    public Message<Object> insertCustData(Message<Map<String, Object>> m){
    }

    ErrorMessage:
    Caused by: org.springframework.expression.spel.SpelEvaluation Exception: EL1004Epos 8): Method call: Method insertCustData(org.springframework.integration.mes sage.GenericMessage)

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    Hi!

    1. Please, use [ CODE ] [ /CODE ] without whitespaces to show sources.
    2. If you define full <service-activator> there is no reason of @ServiceActivator
    3. Is there any reason to work with full Message?
    4. Show, please, more info from StackTrace.
    5. Does your Service implement some interface?
    6. Or have you got CGLIB in CLASSPATH?

    Sorry, there is not enough info now...

    Cheers,
    Artem

  3. #3
    Join Date
    Nov 2012
    Posts
    14

    Default

    Yes, In message I am setting up a map<String,Obj> which contains Header/DetailList , its just POJO i am not implementing any interface ,I dont have CGLIB in CLASSPATH

    [ CODE ] [ /CODE ] where i have to use (in configuration OR POJO)

    Complete ErrorCode:

    [08.01.2013 06:46:09] ERROR: LoggingHandler.handleMessageInternal() - org.springframework.integration.MessageHandlingExc eption: org.springframework.expression.spel.SpelEvaluation Exception: EL1004Epos 8): Method call: Method insertAceData(org.springframework.integration.mess age.GenericMessage) cannot be found on $Proxy57 type
    at org.springframework.integration.handler.MethodInvo kingMessageProcessor.processMessage(MethodInvoking MessageProcessor.java:76)
    at org.springframework.integration.handler.ServiceAct ivatingHandler.handleRequestMessage(ServiceActivat ingHandler.java:64)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:97)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:73)
    at sun.reflect.GeneratedMethodAccessor365.invoke(Unkn own Source)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.run(Def aultMessageListenerContainer.java:953)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: org.springframework.expression.spel.SpelEvaluation Exception: EL1004Epos 8): Method call: Method insertAceData(org.springframework.integration.mess age.GenericMessage) cannot be found on $Proxy57 type
    at org.springframework.expression.spel.ast.MethodRefe rence.findAccessorForMethod(MethodReference.java:1 82)
    at org.springframework.expression.spel.ast.MethodRefe rence.getValueInternal(MethodReference.java:106)
    at org.springframework.expression.spel.ast.CompoundEx pression.getValueInternal(CompoundExpression.java: 57)
    at org.springframework.expression.spel.ast.SpelNodeIm pl.getTypedValue(SpelNodeImpl.java:102)

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    I dont have CGLIB in CLASSPATH
    So, do it immediately!

    And a bit theory on a snack: http://static.springsource.org/sprin...i.html#aop-pfb
    Last edited by Cleric; Jan 8th, 2013 at 10:02 AM.

  5. #5
    Join Date
    Nov 2012
    Posts
    14

    Default

    added cglib-2.2.jar even though same error, could you please tell me where to setup

  6. #6
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    How about this one:
    HTML Code:
    <tx:annotation-driven proxy-target-class="true"/>
    ?

  7. #7
    Join Date
    Nov 2012
    Posts
    14

    Default

    no luck , same error

  8. #8
    Join Date
    Nov 2012
    Posts
    14

    Default

    I didn't try [ CODE ] [ /CODE ] , where i have to keep this

  9. #9
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    no luck , same error
    Hmm...
    Do you really sore CGLIB is in your CLASSPATH?
    Show, please, StackTrace now.
    And there is another solution for you:
    HTML Code:
    <service-activator input-channel="channel1"
    output-channel="channel2" ref="InsertService"
    method="insertCustData">
    <request-handler-advice-chain>
         <tx:advice>
    	<tx:attributes>
    		<tx:method name="*" propagation="REQUIRES_NEW" rollback-for="java.lang.Throwable"/>
    	</tx:attributes>
          </tx:advice></request-handler-advice-chain>
    </service-activator>
    From other side intruduction of service interface should fix your issue too...

  10. #10
    Join Date
    Nov 2012
    Posts
    14

    Default

    Actually we are using springIntegration 2.1.0 .RELEASE version .

    <request-handler-advice-chain> is not available in 2.1.0 , I am not able to ,i will try with 2.2 and post you

    thanks for your help

Posting Permissions

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