Solved

How to launch a script when starting an Oracle Application Server container?

Posted on 2006-10-27
6
379 Views
Last Modified: 2013-12-01
We have added a JMS componant to our growing application and now whenever one of our OAS containers goes down there are a couple of .lock files that are left behind in our ....../j2ee/<containername>/persistence/ subfolders.

Then once we attempt to bring the container up it pukes on these lock files. It was suggested that we use a script of some sort to delete *.lock files in this folder upon container startup.

I am not seeing any obvious methods of doing that.

Yes we use simple .sh files for startup and shutdown, but we also use DCM off the command line and from ANT deployment scripts as well as going through the web front end for application server control. As such I am not sure where to deal with the problem being as there are multiple entry points where you can perform startups....
0
Comment
Question by:hooch604
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:bpeterse
ID: 17835151
Perhaps the best place to put it is in the shutdown script(s):

(This is Korn shell)
******************
sleep 15
if [[ -n `ls <your_path_to>/*lock` ]]
then
        for i in `ls -l <your_path_to>*lock|cut -c55-`
          do
                rm -f $i
          done
fi
********************
0
 

Author Comment

by:hooch604
ID: 17835625
Yes but as I mentioned there is more than one way to skin a cat in this case. We are building and testing our j2ee application and as such there are frequent shutdowns of the containers that do not come from the shutdown scripts. So ideally this could be done on startup...
0
 
LVL 6

Expert Comment

by:bpeterse
ID: 17836355
In unix - there's typically at least 3 ways to skin that cat, but it's your box.  You can put the script where you like.  
0
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 

Author Comment

by:hooch604
ID: 17837683
Thanks you!
0
 
LVL 3

Accepted Solution

by:
rkogelhe earned 200 total points
ID: 17987658
You can configure start and stop event scripts in opmn. See the metalink note "274088.1 -How to use the pre-start and pre-stop event scripts with AS10g on UNIX"

https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=274088.1

The idea is that you can execute any script using the event-scripts tag in opmn.xml.

<event-scripts>
        <pre-start path="/home/ias9041/pre-start.sh"/>
       <pre-stop path="/home/ias9041/pre-stop.sh"/>
</event-scripts>
0
 

Author Comment

by:hooch604
ID: 18003494
ah most excellent, I will look into that, thank you. I expect this is stuff a fully qualified admin would know but we currently have a gap in our expertise over here.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
reflections, dynamic class loading 3 75
error when i compile 5 718
method reurn 7 85
Setup GlassFish 4 21
-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

861 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