Results 1 to 4 of 4

Thread: usig JmsTemplate in EJB session

  1. #1
    Join Date
    Aug 2010
    Posts
    16

    Default usig JmsTemplate in EJB session

    hi all,
    i also posted this in EJB forum; without responses yet.
    my case is as below:
    1. im calling stateless Session Bean (using container transaction as required)to send jms message via JmsTemplate (im not using spring transaction management).
    2. wait for output (in file system) of MDB (from step 1).
    3. send response.

    when i deploy this model on weblogic (10.3) it works fine; but once im doing it on websphere (7.0) the JmsTemplate is not sending the message.

    i did debuging and investigations, seems that session is not sending message till the transaction is commited.
    but how its working fine in weblogic? and how i can resolve this issue to work fine in websphere as well ?

    thanks in advance;

  2. #2
    Join Date
    Aug 2010
    Posts
    16

    Default

    Hi again,
    i changed Spring framework log level to debug and found the exception below, any idea?

    Code:
    2012-06-03 16:49:55,017 DEBUG [org.springframework.batch.core.repository.dao.JdbcStepExecutionDao] Truncating long message before update of StepExecution, original message is: org.springframework.jms.connection.SynchedLocalTransactionFailedException: Local JMS transaction failed to commit; nested exception is javax.jms.IllegalStateException: CWSIA0053E: An exception was received during the call to the method JmsSessionImpl.commitTransaction (#2): javax.resource.spi.LocalTransactionException: CWSJR1138E: An internal error has occurred. An unexpected exception has occurred. A call was made to commitLocalTransaction but there is no local transaction..
    	at org.springframework.jms.connection.ConnectionFactoryUtils$JmsResourceSynchronization.processResourceAfterCommit(ConnectionFactoryUtils.java:407)
    	at org.springframework.jms.connection.ConnectionFactoryUtils$JmsResourceSynchronization.processResourceAfterCommit(ConnectionFactoryUtils.java:1)
    	at org.springframework.transaction.support.ResourceHolderSynchronization.afterCommit(ResourceHolderSynchronization.java:79)
    	at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCommit(TransactionSynchronizationUtils.java:133)
    	at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerAfterCommit(TransactionSynchronizationUtils.java:121)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCommit(AbstractPlatformTransactionManager.java:953)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:796)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
    	at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:261)
    	at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
    	at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:367)
    	at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:214)
    	at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143)
    	at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:247)
    	at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:196)
    	at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:135)
    	at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61)
    	at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
    	at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)
    	at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)
    	at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135)
    	at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120)
    	at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:114)
    	at MY-EJB
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    	at java.lang.reflect.Method.invoke(Method.java:611)
    	at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
    	at org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver.invokeBusinessLogic(RPCInOutAsyncMessageReceiver.java:89)
    	at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
    	at org.apache.axis2.receivers.AbstractMessageReceiver$AsyncMessageReceiverWorker.run(AbstractMessageReceiver.java:316)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
    	at java.lang.Thread.run(Thread.java:736)
    Caused by: javax.jms.IllegalStateException: CWSIA0053E: An exception was received during the call to the method JmsSessionImpl.commitTransaction (#2): javax.resource.spi.LocalTransactionException: CWSJR1138E: An internal error has occurred. An unexpected exception has occurred. A call was made to commitLocalTransaction but there is no local transaction..
    	at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.commitTransaction(JmsSessionImpl.java:1884)
    	at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.commit(JmsSessionImpl.java:598)
    	at org.springframework.jms.connection.JmsResourceHolder.commitAll(JmsResourceHolder.java:181)
    	at org.springframework.jms.connection.ConnectionFactoryUtils$JmsResourceSynchronization.processResourceAfterCommit(ConnectionFactoryUtils.java:404)
    	... 46 more
    Caused by: javax.resource.spi.LocalTransactionException: CWSJR1138E: An internal error has occurred. An unexpected exception has occurred. A call was made to commitLocalTransaction but there is no local transaction.
    	at com.ibm.ws.sib.api.jmsra.impl.JmsJcaSessionImpl.commitLocalTransaction(JmsJcaSessionImpl.java:430)
    	at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.commitTransaction(JmsSessionImpl.java:1865)
    	... 49 more

  3. #3
    Join Date
    Aug 2010
    Posts
    16

    Default

    after removing the property:
    Code:
    <property name="sessionTransacted" value="true" />
    From jmsTemplate ... the exception above is not occurring anymore... but still not able to send jms message.

    please advice,

  4. #4
    Join Date
    Aug 2010
    Posts
    16

    Default

    Hi,
    new update about the issue; now im able to send the jms message after:
    1. changing EJB transaction type to Bean
    2. In EJB Call i get User Transaction and start it.
    3. After sending the jms message through the jmsTemplate i did transaction commit and then message sent to queue.

    this is not the optimal approach; and as i mentioned this already working fine in weblogic without transaction commit.
    seems this issue related to Websphere jms mechanism...

    any idea?!

    thanks,

Posting Permissions

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