?
Solved

Servlet init getting called twice sometimes in oc4j - interesting

Posted on 2004-04-26
7
Medium Priority
?
479 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 120 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

719 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