Solved

Servlet init getting called twice sometimes in oc4j - interesting

Posted on 2004-04-26
7
442 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
  • 2
  • 2
7 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10949738
0
 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

805 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