Solved

Servlet init getting called twice sometimes in oc4j - interesting

Posted on 2004-04-26
7
472 Views
Last Modified: 2010-03-17
I am using oc4j 9.0.2 and deployed some servlets. When I tracked the execution trace of the all the servlets in my application, I found the following scenario in my log.

4/22/04 9:04 PM: Warning: Error reading transaction-log file (/C:/oc4j/j2ee/home/persistence/transaction.state) for recovery: premature end of file4/22/04 9:04 PM:
4/22/04 9:04 PM: Forced or abrupt (crash etc) server shutdown detected, starting recovery process...4/22/04 9:04 PM:
4/22/04 9:04 PM: Recovery completed, 0 connections committed and 0 rolled back...4/22/04 9:04 PM:
4/23/04 12:02 AM: qtMainServ init started4/23/04 12:02 AM:
4/23/04 12:02 AM: In getProperties4/23/04 12:02 AM:
4/23/04 12:02 AM: INITIAL_CONTEXT ... is null4/23/04 12:02 AM:
4/23/04 12:02 AM: initial context factory: com.evermind.server.rmi.RMIInitialContextFactory4/23/04 12:02 AM:
4/23/04 12:02 AM: qtMainServ init completed4/23/04 12:02 AM:
4/23/04 12:02 AM: qInspServ init started4/23/04 12:02 AM:
4/23/04 12:02 AM: In getProperties4/23/04 12:02 AM:
4/23/04 12:02 AM: qInspServ init completed4/23/04 12:02 AM:
4/23/04 1:17 AM: qtMainServ init started4/23/04 1:17 AM:
4/23/04 1:17 AM: In getProperties4/23/04 1:17 AM:
4/23/04 1:17 AM: qtMainServ init completed4/23/04 1:17 AM:
4/23/04 5:41 AM: qtReportServ init started4/23/04 5:41 AM:
4/23/04 5:41 AM: In getProperties4/23/04 5:41 AM:
4/23/04 5:41 AM: qtReportServ init completed4/23/04 5:41 AM:
4/23/04 6:38 AM: qAdminServ init started4/23/04 6:38 AM:
4/23/04 6:38 AM: In getProperties4/23/04 6:38 AM:
4/23/04 6:38 AM: qAdminServ init completed4/23/04 6:38 AM:

AT 12:02AM qtMainServ init started and completed. Again at 1:17AM qtMainServ init was executed. This is not happening always. Didn't understand why this is happend. Any reason behind this?

regds
-raju
0
Comment
Question by:svgkraju
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 

Author Comment

by:svgkraju
ID: 10949912
I didn't find relevant information for my question in those links.
0
 
LVL 9

Expert Comment

by:vzilka
ID: 10978167
Basically, the application server can choose to load several instances of the same servlet, so for each instance, the init method will run.
This seems like the case with your application.
0
 

Author Comment

by:svgkraju
ID: 10983646
Why several instances of a servlet required? Any reason behind this? Under which circumstances a servlet creates a new instance? In my application I need only one instance of each servlet.
0
 
LVL 9

Accepted Solution

by:
vzilka earned 30 total points
ID: 10983664
The servlet container is the judge. Probably because of synchronization issues under load.
I don't know of any way to stop this behavior.

Why do you need only one nstance? Perhaps you should try to move some of the code into a singleton.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question