Announcement Announcement Module
Collapse
No announcement yet.
Having issues in service-activator while applying TransActions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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)

      Comment


      • #4
        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 Artem Bilan; Jan 8th, 2013, 11:02 AM.

        Comment


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

          Comment


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

            Comment


            • #7
              no luck , same error

              Comment


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

                Comment


                • #9
                  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...

                  Comment


                  • #10
                    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

                    Comment

                    Working...
                    X