• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Identify if an EJB instantiated

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a scenario where an EJB 'EjbClient' on APP1 calls an EJB 'EjbServer' on APP2.
Now the first line of code in 'EjbServer' is an System.out.println to log information that the execution has started, on the console. The next line is a statement to log the same info to a log file.
If the 'EjbClient' times out, it means that 'EjbServer' has not responded in the JTA timeout set for 'EjbClient'. However there is neither the output of the SOP, nor the log information in the EjbServer logs. So i think that EjbServer execution has not even begun.
Is there anyway to establish if the EjbServer has infact been initiated?
Is it possible that SOPs as well as log info be rolled back in an EJB?

Thanks
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pere,


Is there anyway to establish if the EjbServer has infact been initiated?


Well one way to do it is this: set the initial number of instance in the pool = 0 and maximum number in the pool = n (n>= 1). Do the call and use whatever tools your container provides (if you�re using weblogic you might use the wl console) to monitor the ejb instance pool. If it shows 0 beans in the pool, then that�s it. Your bean was never called.


Is it possible that SOPs as well as log info be rolled back in an EJB?


That one I really doubt it. Your error messages should be logged appropriately. If that would be true, then production support guys will never have a clue what�s going wrong, since the log file will contain no error messages (they�ve been always rollbacked).
Regards.
 
H Pereira
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Valentin,

Thanks for your response. Sorry for the delay in replying.
I did simulate the bean call as you said and it does show if the bean was called or not. However, the problem i am facing in production is intermittent. Hence there is usually always a bean in the pool.

The client bean shows transaction timeput errors in the logs, sometimes with a remoteexception.
Since, as you mentioned, logging should happen, it implies that the bean is not instantiated at all.

I am trying to figure out why the bean does not respond.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does you transaction start in APP1 and is being propagated into APP2? If so, then this in not ideal over a network. Can you redesign your app so that your transaction starts in APP2, or can you package APP1 and APP2 into a single EAR file?
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pereira,


The client bean shows transaction timeput errors in the logs, sometimes with a remoteexception.


Can you post that remote exception?
First of all, you must be able to reproduce the issue either in QA or dev environment, otherwise you'll probably never be able to fix it.
There is however couple of more things you should try:

  • Set the transaction timeout interval to a higher value. This usually could be done when setting the JTA service.
  • Check the transaction log files for detailed errors.



  • Regards.
     
    H Pereira
    Greenhorn
    Posts: 7
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Roger Chung-Wee:
    Does you transaction start in APP1 and is being propagated into APP2? If so, then this in not ideal over a network. Can you redesign your app so that your transaction starts in APP2, or can you package APP1 and APP2 into a single EAR file?



    Hi Roger,

    Unfortunately, we are currently not in a position to change the design.

    Pereira
     
    H Pereira
    Greenhorn
    Posts: 7
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Valentin Tanase:
    Hi Pereira,


    Can you post that remote exception?
    First of all, you must be able to reproduce the issue either in QA or dev environment, otherwise you'll probably never be able to fix it.
    There is however couple of more things you should try:

  • Set the transaction timeout interval to a higher value. This usually could be done when setting the JTA service.
  • Check the transaction log files for detailed errors.



  • Regards.



    Actually thats the problem, this happens only on the production environment. There have been about 10 occurances over a 3 month period. And two kinds of exceptions were there in APP1 application log.

    REMOTE EXCEPTION + TIMEOUT
    2005-04-28 10:02:51,384 | FATAL | com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean:executeSP_FilePostProcessing(493) | In Exception of BulkPayFilePostProcessBeanjava.rmi.RemoteException: Message was not sent because transaction is not active. Name=[EJB com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean.postProcessFile(java.lang.String)],Xid=247:6b19285286657b2c(4087840),Status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 30 seconds
    Name=[EJB com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean.postProcessFile(java.lang.String)],Xid=247:6b19285286657b2c(4087840),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=30,seconds left=30,activeThread=Thread[batchchild,5,BulkThreadGroup],SCInfo[app1.yyyyyyy.com+myapp1server]=(state=active),properties=({weblogic.transaction.name=[EJB com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean.postProcessFile(java.lang.String)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myapp1server+172.31.29.78:7002+app1.yyyyyyy.com+, Resources={})],CoordinatorURL=myapp1server+172.31.29.78:7002+app1.yyyyyyy.com+)],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=77,seconds left=4,activeThread=Thread[batchchild,5,BulkThreadGroup],SCInfo[app1.yyyyyyy.com+myapp1server]=(state=rolledback),properties=({weblogic.transaction.name=[EJB com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean.postProcessFile(java.lang.String)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myapp1server+172.31.29.78:7002+app1.yyyyyyy.com+, Resources={})],CoordinatorURL=myapp1server+172.31.29.78:7002+app1.yyyyyyy.com+)


    ONLY TIMEOUT NO REMOTE EXCEPTION
    2005-04-28 12:13:58,528 | FATAL | com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean:executeSP_FilePostProcessing(493) | In Exception of BulkPayFilePostProcessBeanjavax.transaction.TransactionRolledbackException: Transaction timed out after 32 seconds
    Name=[EJB com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean.postProcessFile(java.lang.String)],Xid=255:6b19285286657b2c(4599563),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=32,seconds left=30,activeThread=Thread[batchchild,5,BulkThreadGroup],SCInfo[app1.yyyyyyy.com+myapp1server]=(state=active),properties=({weblogic.transaction.name=[EJB com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean.postProcessFile(java.lang.String)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myapp1server+172.31.29.78:7002+app1.yyyyyyy.com+, Resources={})],CoordinatorURL=myapp1server+172.31.29.78:7002+app1.yyyyyyy.com+)

    Start server side stack trace:
    weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds
    Name=[EJB com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean.postProcessFile(java.lang.String)],Xid=255:6b19285286657b2c(4599563),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=32,seconds left=30,activeThread=Thread[batchchild,5,BulkThreadGroup],SCInfo[app1.yyyyyyy.com+myapp1server]=(state=active),properties=({weblogic.transaction.name=[EJB com.xxxxxxx.yyyyyyy.cash.customerfiles.BulkPayFilePostProcessBean.postProcessFile(java.lang.String)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myapp1server+172.31.29.78:7002+app1.yyyyyyy.com+, Resources={})],CoordinatorURL=myapp1server+172.31.29.78:7002+app1.yyyyyyy.com+)
    at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1124)
    at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:466)
    at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1604)
    at weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:429)
    at weblogic.transaction.internal.TransactionManagerImpl$1.run(TransactionManagerImpl.java:1570)
    at java.lang.Thread.run(Thread.java:479)
    End server side stack trace


    After the initial occurance, the JTA was changed from 30 sec in App1 to 120 sec (same as App2)

    I have not checked txn logs. Are these in ascii or do i need to do something else to read them?

    Hope the info sheds more light.

    Regards,
    Pereira
     
    Valentin Tanase
    Ranch Hand
    Posts: 704
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Pereira,


    After the initial occurance, the JTA was changed from 30 sec in App1 to 120 sec (same as App2)


    I hope this will fix your issue. Looking at the error message you�ve posted I can only tell you that this is rather difficult than trivial to solve. This could be everything starting from an application bug (which I doubt) to a bea specific/unfixed bug. There are some old issues about this kind of errors and upgrading your WebLogic to latest SP might fix it. Since you have no way to reproduce the issue you have to help your manager to understand that you�re just a human being and therefore there is nothing more you can do at this time :-) Again an upgrade might help�


    I have not checked txn logs. Are these in ascii or do i need to do something else to read them?


    They are actually in binary format and a text editor won�t help. Use the admin console and under the Service/JTA select the Logging tab and click on View domain log link.
    Regards.
     
    H Pereira
    Greenhorn
    Posts: 7
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Valentin Tanase:
    Use the admin console and under the Service/JTA select the Logging tab and click on View domain log link.
    Regards.



    Hi Valentin

    I am using weblogic 6.1. There is no link "View Domain Log" under Services
    -> JTA -> Logging

    If the server deletes/overwrites txn logs after some time, then i might not have the necessary logs. But if it happens again i would like to be in a position to analyse the txn logs. Is there any other way i might be able to read these logs?

    Thanks,
    Pereira
     
    reply
      Bookmark Topic Watch Topic
    • New Topic