Sleeping thread that was started by startup class: wakes up on jsp compiler run

Hello,
I've ecountered the following unexpected behaviour:
A class defined as a WL startup class creates a thread in the startup() method. This
thread then calls the Thread.sleep method.
So far so good.
Now each time an updated JSP is accessed by a browser, this JSP gets recompiled by
the JSP compiler (so far so good, nothing to do with the startup thread), and each
time this happens, the above mentioned thread wakes up as if his time were up. (Output
is "TestStartupThread: Woken up: timer timed out", see code below)
Anybody know anything??
Code of startup class ( = thread class) listed below.
Dirk
import java.util.Hashtable;
import weblogic.common.*;
public class TestStartupThread extends Thread implements T3StartupDef, T3ShutdownDef
private static TestStartupThread testThread = null;
/** controls running of thread, will be set to false when server shuts down
private static volatile boolean runThread = true;
public void setServices(T3ServicesDef t3def) {  }
public String startup(String s, Hashtable ht) {
testThread = new TestStartupThread();
testThread.start();
return "ok";
public String shutdown(String s, Hashtable ht) {
runThread = false;
testThread.interrupt();
return "ok";
public void run() {
while (runThread) {
try {
System.err.println("TestStartupThread: now going to sleep");
Thread.sleep(1000*60*60);
System.err.println("TestStartupThread: Woken up: timer timed out");
} catch (InterruptedException ie) {
System.err.println("TestStartupThread: Woken up by InterruptedException");

Looks like a good use for WL time services.
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
+1.617.623.5782
WebLogic Consulting Available
"Brian Dowd" <[email protected]> wrote in message
news:[email protected]...
>
I am getting exactly the same problem, but I did something
similar (to this & mine) in WL 4.5.1 and it worked OK.
About the best solution we can come up with is to test the time
before and after wake up, if the time is less then go back
to sleep for the new amount of time ...
Does anyone know how to properly do this in WL 5.1 ?
I notice this thread is a bit old ....
"Dirk Rehberger" <[email protected]> wrote:
Hello,
I've ecountered the following unexpected behaviour:
A class defined as a WL startup class creates a thread in the startup()
method. This
thread then calls the Thread.sleep method.
So far so good.
Now each time an updated JSP is accessed by a browser, this JSP gets
recompiled by
the JSP compiler (so far so good, nothing to do with the startup thread),
and each
time this happens, the above mentioned thread wakes up as if his time
were up. (Output
is "TestStartupThread: Woken up: timer timed out", see code below)
Anybody know anything??
Code of startup class ( = thread class) listed below.
Dirk
import java.util.Hashtable;
import weblogic.common.*;
public class TestStartupThread extends Thread implements T3StartupDef,
T3ShutdownDef
private static TestStartupThread testThread = null;
/** controls running of thread, will be set to false when server shuts
down
private static volatile boolean runThread = true;
public void setServices(T3ServicesDef t3def) {  }
public String startup(String s, Hashtable ht) {
testThread = new TestStartupThread();
testThread.start();
return "ok";
public String shutdown(String s, Hashtable ht) {
runThread = false;
testThread.interrupt();
return "ok";
public void run() {
while (runThread) {
try {
System.err.println("TestStartupThread: now going to sleep");
Thread.sleep(1000*60*60);
System.err.println("TestStartupThread: Woken up: timer timed
out");
} catch (InterruptedException ie) {
System.err.println("TestStartupThread: Woken up by
InterruptedException");

Similar Messages

  • How may one cancel the download of an update that was started by having actuated the "Check for Updates" button in the "About Firefox" window, please?

    How may one cancel the download of an update that was started by having actuated the "Check for Updates" button in the "About Firefox" window, please? If possible please cover all platforms, Mac, Windows, Linux, although the first mentioned is what currently applies to my circumstances.
    Thank you.

    Such a download is usually saved in an updates or updated folder in the Firefox program/application folder.
    You can delete this folder to cancel the download.
    If files already have been downloaded then remove the files in the updates and updates\0 folder.
    *http://kb.mozillazine.org/Updates_reported_when_running_newest_version
    *http://kb.mozillazine.org/Software_Update
    Mac: /Applications/Firefox.app/updates "/path_to/Firefox.app/Updated.app"
    Linux: "/path_to/firefox/updated"
    Windows: C:\Users\&lt;user&gt;\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates

  • Request filter on thread that I started

    Referring
    this related thread.
    Btw, sometimes I want to find old threads that I started and see whether there are replies that I missed. My last question is like 20+ pages in "My thread" page so I have difficulty to find them. It'd be great if we can have this filter option.

    Because the two versions have different titles and different feed URLs they are seen as two separate podcasts. The URLs you've given are the iTunes Store pages.
    To clarify the situation:
    'Outside My Head'
    Store page http://itunes.apple.com/us/podcast/outside-my-head/id438372030
    Feed http://feeds.feedburner.com/ThoughtsOutsideMyHead
    'Running & Other Stuff'
    Store page http://itunes.apple.com/us/podcast/running-other-stuff/id439282630
    Feed http://runningandotherstuff.podbean.com/feed/
    'Outside My Head' has only the two most recent episodes; these are also in 'Running & Other Stuff', which has some earlier episodes as well. Not quite sure how you've achieved all this: the Feedburner feed is presumably the Podbean Feed submitted to Feedburner and then the feed created from that by them submitted to iTunes - or did you create it entirely in Feedburner? - actually the descriptions are different so that seems more likely, or that you submitted another feed to Feedburner.
    So, you want to keep the 'Running & Other Stuff'' version and get rid of 'Outside My Head'? You can ask to have a podcast removed from the Store - details here.
    Are you happy to keep the existing feed for ''Running...'? If so, that's all you need do. Feedburner won't come into it.
    If you want to do it through Feedburner it gets more complicated:
    Submit the Podbean feed to Feedburner. It will rewrite the feed and give you a new URL.
    In the Podbean feed, which is being read by iTunes, add the 'itunes:new-feed-url' tag as described here, pointing to the new Feedburner feed (not the one in use for the other version of the podcast). However it's quite possible that Podbean will not allow you to do this, in which case you are stuck with their feed and will have to forget about Feedburner.

  • Response to thread that was kill

    This thread is obviously just flame-bait at this point. Telling us our drivers suck for the 0000th time on this forum isn't going to accomplish anything.
    Dale Forum Moderator
    Creative Labs
    [img"]http://images.americas.creative.com/images/local//signature/CREATIVE_00.gif">
    So...what will acomplish something?

    Well they didn't just lock the thread, they just removed my (pissedoff) user account. Talk about keeping you customers happy.
    Creative you have it coming to you. People aren't going to hold out much longer, I know I certainly ain't. Whats so bad about saying the driver is due mid-May or something?! I mean really, it seems the moderators here, do nothing to pass information on to someone who can actually do something.
    Are Creative management even aware that there are so many angry customers? I'm sure if they did, they would certainly want to do something about it, if they have any sense.
    P.S. Don't ban this account, I have got thousands of more where they came from!
    Wow: moderators are removing my posts! How lame.

  • Cannot start Startup class in WL6.0

    Hi, I have a question regarding the startup class with WL6.0. here is the config.xml:
    =================================================================
    <StartupClass
    Arguments="connectionFactory=javax.jms.QueueConnectionFactory,queue=com.lasso.email.emailQueue"
    ClassName="com.lasso.service.mail.StartupEmailSender"
    FailureIsFatal="true" Name="EmailSender" Targets="localserver"/>
    <StartupClass Arguments="" ClassName="com.lasso.util.StartupLoad"
    FailureIsFatal="true" Name="StartupLoad1" Targets="localserver"/>
    <Security Name="lassov2" PasswordPolicy="wl_default_password_policy" Realm="wl_default_realm"/>
    ================================================================
    Here is what I got after start weblogic server 6.0:
    ================================================================
    <Jul 9, 2001 1:50:35 PM CDT> <Notice> <WebLogicServer> <WebLogic Server started>
    <Jul 9, 2001 1:50:35 PM CDT> <Notice> <WebLogicServer> <ListenThread listening
    o
    n port 80>
    <Jul 9, 2001 1:50:35 PM CDT> <Notice> <WebLogicServer> <SSLListenThread listenin
    g on port 443>
    <Jul 9, 2001 1:50:35 PM CDT> <Error> <Performance Pack> <Unable to load performa
    nce pack, using Java I/O.
    java.lang.ThreadDeath
    >
    <Jul 9, 2001 1:50:36 PM CDT> <Emergency> <WebLogicServer> <ListenThread.run()
    fa
    iled: java.lang.ThreadDeath>
    <Jul 9, 2001 1:50:36 PM CDT> <Emergency> <WebLogicServer> <The WebLogic Server
    i
    s no longer listening for connections. You should probably restart it.>
    <Jul 9, 2001 1:50:36 PM CDT> <Alert> <WebLogicServer> <Server shutdown has been
    requested by system>
    <Jul 9, 2001 1:50:36 PM CDT> <Alert> <WebLogicServer> <The shutdown sequence has
    been initiated.>
    <Jul 9, 2001 1:50:58 PM CDT> <Critical> <Kernel> <Execute Thread: 'ExecuteThread
    : '0' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread: 'ExecuteThread
    : '1' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread: 'ExecuteThread
    : '2' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread: 'ExecuteThread
    : '3' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread: 'ExecuteThread
    : '4' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread: 'ExecuteThread
    : '5' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread: 'ExecuteThread
    ==============================================================
    What can I do to start those StartUp classes successfully?
    Thanks.
    Alan Zhang

    Seems like your startup class is generating error that causing wl to
    shutdown. This is because you told wls that you don't want it to start if
    your startup class fails (FailureIsFatal="true" ).
    Take a look at your startup calss and see why is it failing...
    .raja
    "Alan Zhang" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi, I have a question regarding the startup class with WL6.0. here is theconfig.xml:
    =================================================================
    <StartupClass
    Arguments="connectionFactory=javax.jms.QueueConnectionFactory,queue=com.lass
    o.email.emailQueue"
    ClassName="com.lasso.service.mail.StartupEmailSender"
    FailureIsFatal="true" Name="EmailSender" Targets="localserver"/>
    <StartupClass Arguments="" ClassName="com.lasso.util.StartupLoad"
    FailureIsFatal="true" Name="StartupLoad1" Targets="localserver"/>
    <Security Name="lassov2" PasswordPolicy="wl_default_password_policy"Realm="wl_default_realm"/>
    ================================================================
    Here is what I got after start weblogic server 6.0:
    ================================================================
    <Jul 9, 2001 1:50:35 PM CDT> <Notice> <WebLogicServer> <WebLogic Serverstarted>
    >
    <Jul 9, 2001 1:50:35 PM CDT> <Notice> <WebLogicServer> <ListenThreadlistening
    o
    n port 80>
    <Jul 9, 2001 1:50:35 PM CDT> <Notice> <WebLogicServer> <SSLListenThreadlistenin
    g on port 443>
    <Jul 9, 2001 1:50:35 PM CDT> <Error> <Performance Pack> <Unable to loadperforma
    nce pack, using Java I/O.
    java.lang.ThreadDeath
    >
    <Jul 9, 2001 1:50:36 PM CDT> <Emergency> <WebLogicServer><ListenThread.run()
    fa
    iled: java.lang.ThreadDeath>
    <Jul 9, 2001 1:50:36 PM CDT> <Emergency> <WebLogicServer> <The WebLogicServer
    i
    s no longer listening for connections. You should probably restart it.>
    <Jul 9, 2001 1:50:36 PM CDT> <Alert> <WebLogicServer> <Server shutdown hasbeen
    requested by system>
    <Jul 9, 2001 1:50:36 PM CDT> <Alert> <WebLogicServer> <The shutdownsequence has
    been initiated.>
    <Jul 9, 2001 1:50:58 PM CDT> <Critical> <Kernel> <Execute Thread:'ExecuteThread
    : '0' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread:'ExecuteThread
    : '1' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread:'ExecuteThread
    : '2' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread:'ExecuteThread
    : '3' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread:'ExecuteThread
    : '4' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread:'ExecuteThread
    : '5' for queue: 'default'' stopped.>
    <Jul 9, 2001 1:51:06 PM CDT> <Critical> <Kernel> <Execute Thread:'ExecuteThread
    ==============================================================
    What can I do to start those StartUp classes successfully?
    Thanks.
    Alan Zhang

  • Order of starting startup classes

    I am using WLS 4.5. Is there a way to tell the server in which order to
    start the startup classes?
    I have tried putting them in certain order in the properties file, but that
    certainly does not
    do it. Any other tricks?

    per the WLS 4.5.1 documentation you can start the classes in a specific
    order by putting them in the same line in the properties file separated by
    commas.
    e.g.
    virtual class name= class A, class B, class C
    Read the part on start up classes in the doc on the WebLogic properties
    file.
    farnaz <[email protected]> wrote in message
    news:8i5nph$ifu$[email protected]..
    I am using WLS 4.5. Is there a way to tell the server in which order to
    start the startup classes?
    I have tried putting them in certain order in the properties file, butthat
    certainly does not
    do it. Any other tricks?

  • Java thread that start executing everyday on given time

    Hello
    I need to write an java file using thread
    that can start executing everyday on given time say everyday 14:00.
    Can any one have any example..?

    If on a Windows platform, you could run your Java class via a [Task Scheduler|http://support.microsoft.com/kb/308569].

  • My itunes account was started on a computer that is no longer working.

    My phone is linked to an itunes account that was started on a computer that no longer works.
    How can I open that account on another computer? I want to add music to my phone without losing the current music. How can I open that itunes account?

    It depends what not working means - if the hard drive is working and you can access it say in a USB caddy you might be able to find the media files and copy over to the new iTunes, but it may depend on how your user accounts are stored.
    Alternatively for iTunes store purchases, on the new computer open itunes and go to the store Home Page.  On the far right under QuickLinks you should find a Purchased category - this will let you redownload content from the 'cloud' if available in your country.
    AC

  • Startup Classes and JMS - Suggestions Please!

    I'm in serious need of having several resources initialized before beans
    start handling requests.
    I tried implementing a Weblogic Startup Class, and it works fine - as long
    as it's the first thing
    to run! -- the problem is, when my Message Driven Beans deploy, if there are
    messages waiting
    for them in their durable subscriptions, they immediately start
    processing... then about 30 seconds
    later Weblogic (6.0sp1) gets around to starting my startup class. If I put
    code in each MDB that
    kicks off the initialization when they are invoked I still run into
    problems, because my initialization
    takes a LONG time (more than 2 minutes) - so I end up with lots of
    transaction rollbacks... which
    are very annoying and clutter up the log files, and scare customers of the
    product.
    Is there anyway to make a startup class/servlet/something that runs and
    completes before any
    other processing occurs?
    Thanks,
    James

    Yes, Startup servlet has the same problem - it doesn't 'startup' until after
    jms messages are already being delivered. :( aside from this, there are
    class loader issues -servlet space and ejb space are not the same...
    Thanks though,
    James
    "minjiang" <[email protected]> wrote in message
    news:[email protected]...
    Hi, did you ever try startup servlet? not startup class?
    mj
    James House wrote:
    The only problem with creating a base class to extend is the fact that
    Java only supports single inheritance, -- and I'm already inheriting...
    >>
    I've been involved with many projects that use WLServer, and in
    almost every one of them, there has been a need for a startup class
    that fires before the server starts handling requests.... strange that
    I'd be the only one to need this, when the need has recurred so often.
    James
    "Raja Mukherjee" <[email protected]> wrote in message
    news:[email protected]...
    James,
    If you have common initialization tasks to be shared by multiple MDBs,
    I
    would create an abstract class (a.k.a BeanAdapter class) where you canhave
    all your initialization logics and have your MDB extend from it.
    I am not convinced that the Startup class needs to run first. In fact,
    I
    have the same view that Startup class should run last. My only wishlist
    for
    startup class was that I should be able to specify order, which isaddressed
    in 6.1.
    I am also getting the feeling from different posts that MDB deploymentwould
    have a re-try logic in 6.1, which I am beginning to look into. Check
    (or
    post) in JMS news group.
    .raja
    "James House" <[email protected]> wrote in message
    news:[email protected]...
    Thanks for the help... I like the pattern you pointed me to better
    than
    anything else... ... but in all cases (your method, Gene's, and whatI'm
    currently doing) I still have to put some code in every MDB that
    I deploy... : (
    Put in a good word for me there at BEA and convince the appropriate
    developer that startup classes should run first!
    James
    "Raja Mukherjee" <[email protected]> wrote in message
    news:[email protected]...
    James,
    There are several ways to solve your problem. I normally use
    setMessageDrivenContext to do all my initialization. There are two
    types
    of
    initialization that I have performed here, first, reading theconfiguration
    file and then load some utility classes in specific order. The
    problem
    with
    the second was that you will have to use synchronized block
    w/HotSpot
    2.0
    to
    keep the order, which is ok. I don't use static block to do the
    initialization, instead use an init() metod. Hopefully you got the
    idea.
    Recently, Gene Chuang created a pattern which esentially does the
    same
    and
    I
    liked the pattern because it was a nicer way of doing what I
    needed to
    do.
    I
    have changed all my examples to customer to use the new pattern.
    You
    can
    find it in
    http://theserverside.com/patterns/thread.jsp?thread_id=7270.
    The
    only think I do not use of this pattern is
    initializeEveryContextSwap()
    method. I am not convinced yet that I would need it (of course
    that
    might
    change over the time).
    Hope this helps, and thanks Gene.
    .raja
    "James House" <[email protected]> wrote in message
    news:[email protected]...
    Ok... here's some more detail:
    The application is largely JMS based, and most of my Session
    EJBs
    are
    invoked only my Message Driven Beans.
    I have a large set of properties that need to be read from a
    config
    file,
    and stored somewhere "globally". I also have a number of
    utilities
    that
    need to get "warmed up" before I start doing any real processing(before
    I start receiving messages from the JMS Topics). These
    utilities
    take
    a
    long time to warm up (a long time being about 45-60 seconds) -
    because
    they are loading hundereds of classes, and creating variousconnections
    to external resources.
    Currently I'm creating a Singleton object that reads the
    configuration
    file
    name from an environment property, and it then parses the file,
    and
    starts
    configuring all of these utilities. Since the "Startup Class"
    didn't
    work
    (weblogic invokes it after I'm already receiving messages), I
    put
    code
    at
    the beginning of all of my MDB's onMessage() methods that calls
    the
    singleton's "getInstance()" method - which synchronizes on alock
    object,
    and does all of it's work.
    I don't like this solution because:
    1- I have to put code in EVERY message-driven bean that I
    create -
    if
    I
    forget one, everything is broken.
    2- I have to increase the transaction time out of the entire
    server
    to
    be over 60 seconds since the beans hang that long while theconfiguration
    is
    happening.
    It seems very obvious that a "Startup Class" should be invoked
    after
    the
    server has come completely up, but before it starts listening
    for
    requests -- isn't the whole point of a "startup class" to getthings
    ready
    that need to be done as soon as the server comes up? but alas,
    the
    person
    who designed this at BEA apparently didn't agree with me on this
    point!
    Any suggestion on better solutions would be greatly appreciated.
    James
    "Raja Mukherjee" <[email protected]> wrote in message
    news:[email protected]...
    You can do it this way, but I would not recommend it, unless
    that's
    the
    only
    way to attack the problem at hand. But that's just me.
    I have seen this problem with multiple clients and in most
    cases
    there
    is
    a
    better way to handle it. If James give us a little more
    information
    on
    what
    type of configuration is he talking about and some background
    of
    his
    application, we as a group can think and may be able to come
    up
    with
    some
    idea.
    .raja
    "Joel Nylund" <[email protected]> wrote in message
    news:[email protected]...
    you could wrap the starting of weblogic in your own class
    and do
    initialization
    there. You have to be careful because of the way weblogic
    classloaders
    work, but
    you may be able to do what you want. Weblogic is just a java
    class,
    so
    you
    can
    start your class, then once your done initializing, just
    call
    weblogic.Server.main
    -Joel
    James House wrote:
    I'm in serious need of having several resources
    initialized
    before
    beans
    start handling requests.
    I tried implementing a Weblogic Startup Class, and it
    works
    fine -
    as
    long
    as it's the first thing
    to run! -- the problem is, when my Message Driven Beans
    deploy,
    if
    there
    are
    messages waiting
    for them in their durable subscriptions, they immediately
    start
    processing... then about 30 seconds
    later Weblogic (6.0sp1) gets around to starting my startupclass.
    If
    I
    put
    code in each MDB that
    kicks off the initialization when they are invoked I still
    run
    into
    problems, because my initialization
    takes a LONG time (more than 2 minutes) - so I end up with
    lots
    of
    transaction rollbacks... which
    are very annoying and clutter up the log files, and scarecustomers
    of
    the
    product.
    Is there anyway to make a startup class/servlet/something
    that
    runs
    and
    completes before any
    other processing occurs?
    Thanks,
    James

  • Startup class  load sequence?

    Hi there,
    Do I have control over the load sequence of the startup classes? I
    need to make sure one class start before the other. I add the one needs to
    be start first before the other one in config.xml, but Weblogic always load
    the other one first. Why?
    Thank you

    WLS 6.1 supports deployment order in which
    you can set the order for each deployments
    see 6.1 docs
    Kumar
    Chi-Ming Yang wrote:
    OK!
    Thank you
    I tried. The trick works for WLS 6.0 with SP2.
    Funny thing is that WLS loads names start with "Z" before "A".
    Thank you
    >
    "Deyan D. Bektchiev" <[email protected]> wrote in message
    news:[email protected]..
    What I'm saying is that WLS 6.0 might work with the class name trick (Ihaven't
    tried it) but I would not use it even if it worked for me since somethingas
    simple as a hash code change in a JDK version might break the order youdesire.
    In 6.1 there might be a way to do that but I don't know what it is.
    --dejan
    Chi-Ming Yang wrote:
    Are you saying only WLS 610 will work with the class name trick?
    I am using WLS 6.0. Bad luck!
    >
    "Deyan D. Bektchiev" <[email protected]> wrote in message
    news:[email protected]..
    There was a posting that said that if you name you classes for example
    Class1
    Class2
    the Class1 would always be loaded before Class2 but the sure thing is
    to
    create
    only one startup class that loads the real startup classes in the
    order
    you
    want them to be loaded.
    Maybe in 6.1 BEA has took care of this but in 6.0 you just cannot (the
    why
    is
    left for the BEA developers to answer).
    --dejan
    Chi-Ming Yang wrote:
    Hi there,
    Do I have control over the load sequence of the startup
    classes?
    I
    need to make sure one class start before the other. I add the one
    needs
    to
    be start first before the other one in config.xml, but Weblogic
    always
    load
    the other one first. Why?
    Thank you

  • Configure weblogic startup class in deployment jar

    We need to invoke a class during weblogic startup that is part of application deployment jar...
    It works if startup class is added to server classpath ( Weblogic documentation also insists that). But our startup class uses application logic and needs to be part of application jar..
    We are getting java.lang.ClassNotFoundException for the class during start up. setting LoadBeforeAppDeployments to false also does not help...
    Is there any other way to invoke a application class during weblogic startup...?
    Any help would be appreciated.
    Thanks,
    Rajasekar.

    here is the solution to this:
    in the conventional method of implementing a startup class, one needs to impletent the T3STartupDef interface and register the class as a startup class in the console / config.xml
    in this method, the startup class need not implement the T3STartupDef interface, it just needs to have a "main" method that will be called. the process of registeration is also simple, if you have an application ear.
    while making the application ear, add a weblogic-application.xml along with the application.xml. the weblogic-application.xml should contain :
    <startup>
    <startup-class>myStartup</startup-class>
    <startup-uri>myStartupArchive.jar</startup-uri>
    </startup>
    the myStartupArchive.jar should contain the startup class and all classes used by it
    also, use a "manifest" file to point to other library jars within the ear
    hope this helps someone !
    going, going, ... gone.

  • Startup classes order

    How can I ensure the execution order of startup classes?? I want to run startupclass1
    before startupclass2..

    Dimitri,
    Upon second glance at my reply, I noticed I "mis-spoke" part of it. We want
    the system administratord who control the directories to be able to change the
    values in config.xml, not have control over the properties files.
    We could use a higher priority startup-servlet for that, but then our system
    administrators would have to edit the deployment descriptors of those servlets,
    rebuild them, and redeploy them (and then the server has to be restarted anyway
    to force all the deployed component to pick up the new values).
    It just strikes me that the startup class provides this functionality much
    more elegantly. They can just change the startup parameters in the console and
    restart the server.
    Jason
    "Jason Titus" <[email protected]> wrote:
    >
    Dimitri,
    Thanks for this information. Here are the details of my situation.
    I am trying to set some values in the startup class that all applications
    can
    me use of, by putting them in a singleton. Currently we are using the
    following
    values: a directory from which configuration files can be read, a directory
    into
    which output files can be put.
    The reason for this is that we are keeping our properties files out
    of the
    components so the components don't have to be rebuilt when we move from
    test to
    integration to production. We can simply get a different version of
    the properties
    files from configuration management as part of the deployment process.
    This also
    lets us expose just the properties files to the system administrators
    who impact
    those directories.
    With this scheme in place, my servlet initialization can configure
    itself by
    loading its specific property file from the directory passed to the startup
    class
    based on the config.xml. Once it has the configuration, it can access
    the database
    and cache application general data before the first request is placed
    to the servlet.
    Does that sounds reasonable?
    Jason
    Dimitri Rakitine <[email protected]> wrote:
    I think that startup classes are executed after applications etc are
    deployed and
    right before server starts servicing client requests.
    Why do you need startup classes at all? load-on-startup servlets are
    a much nicer
    replacement, which solves lots of problems associated with startup classes.
    Jason Titus <[email protected]> wrote:
    According to this document, you should be able to set a startup deploymentorder
    for your startup classes.
    I have a servlet that is also initialized at startup, which seems
    to
    always get
    initialized before the startup class methods are called. I've triedchanging
    both the deployment order for the startup class in the console, aswell as the
    servlet deployment descriptor value its priority. I can't get thestartup to
    go first.
    Any suggestions?
    Thanks for your help.
    Jason
    "Michael Girdley" <[email protected]> wrote:
    Check this out:
    http://e-docs.bea.com/wls/docs61///////ConsoleHelp/startupclass.html
    Michael Girdley
    BEA Systems
    Learning WebLogic? Buy the book:
    http://www.learnweblogic.com/
    At Amazon:
    http://www.amazon.com/exec/obidos/ASIN/0130911119/learnweblogic/103-6817548-
    3834229
    "Rajan" <[email protected]> wrote in message
    news:[email protected]...
    How can I ensure the execution order of startup classes?? I want
    to
    run
    startupclass1
    before startupclass2..
    Dimitri

  • Ternimating a process that is started from insite a java program

    Hi,
    I have a question:
    I am using Java 1.1 running on a HP-UX platform(HP-UX 11.0).
    I start a "unix shell script" from inside a java process. Everything starts and runs perfectly fine. If for some reason I MANUALLY kill the java program with a "kill" command, the unix process that was started by the java process is not getting killed. (effectively the signal is not getting passed on to the child process). Is there a way to fix this?
    Thanks in Advance.
    Srikanth
    [email protected]

    Here is what the java API docs say about the Process class:
    The Runtime.exec methods create a native process and return an instance of a subclass of Process
    that can be used to control the process and obtain information about it. The class Process
    provides methods for performing input from the process, performing output to the process,
    waiting for the process to complete, checking the exit status of the process, and destroying
    (killing) the process.
    The Runtime.exec methods may not work well for special processes on certain native platforms,
    such as native windowing processes, daemon processes, Win16/DOS processes on Win32, or
    shell scripts. The created subprocess does not have its own terminal or console. All its
    standard io (i.e. stdin, stdout, stderr) operations will be redirected to the parent process
    through three streams (Process.getOutputStream(), Process.getInputStream(), Process.getErrorStream()). The
    parent process uses these streams to feed input to and get output from the subprocess.
    Because some native platforms only provide limited buffer size for standard input and output
    streams, failure to promptly write the input stream or read the output stream of the
    subprocess may cause the subprocess to block, and even deadlock.
    The subprocess is not killed when there are no more references to the Process object, but
    rather the subprocess continues executing asynchronously.
    There is no requirement that a process represented by a Process object execute
    asynchronously or concurrently with respect to the Java process that owns the Process object.
    [/b[
    So the docs state that this class may not work with shell scripts. Which means that it may be no way to deal with this.
    Good luck
    Calin

  • How to get name of class that the JVM was started with ?

    Assume I have class foo with the standard main method.
    I also have classes ding and dong, they extend foo.
    The JVM is started with either ding or dong as the 'main' class. Since neither ding nor dong directly implement main, the actual main method being executed is foo's.
    In the main method of foo I want to construct an instance of either ding or dong, depending on which the JVM was started with. Since I'm in a static context, I can't do anything with 'this'. Is there another way to get the name of the 'main' class from the JVM so that I can construct an instance of it ?

    The idea behind all of this is that the developer of
    Ding and Dong should not have to know anything about
    foo, in particular it's constructors. But if Ding and Dong are subclasses of Foo, then developers must know about Foo. If you expect developers to extend a framework without having a well-defined interface to that framework, you are probably heading for trouble.
    To be able to
    privatize the constructors, construction of the
    concrete class has to take place in foo.If Ding and Dong are subclasses of Foo, then you can not make all of Foo's constructors private.
    Of course I could have a method in Ding and Dong that
    calls a static method in foo into which the Ding and
    Dong instance pass their class, but then I'd have
    identical implementations of this method in Ding and
    Dong. Yes you would (well, not identical, but very similar). Like I said, you could do this programmatically with AOP, or you could probably do it dirtily using stack traces (though with it being a single hit at startup, you might not consider it being quite so dirty).
    But: the point of inheritance is that common
    functionality goes into superclasses. I disagree. The important thing about inheritance is that classes share an interface, and that methods can be polymorphically inherited, allowing new functionality to be 'plugged in' in the future, and even at runtime.
    Also, in
    general one wouldn't make methods static if a class
    reference is needed (or one would make it an
    argument), but Sun didn't consult me when they
    designed the main method :-(I still don't see why you need to do what you want to do. It appears that all you are after is the ability to start your program using a command line like
        java com.mypackage.Ding
    instead of
        java com.mypackage.Foo com.mypackage.Ding
    or
        java com.mypackage.Foo Ding.properties
    or something else along these lines.
    Since you must know the name of the class you want to use at the time you want to use it, why can't you just pass the name as an argument, or start up using some properties file, or a shell script?

  • Imac  have black screen. Start Computer sound come on, no picture. The last time I used the computer I put it to sleep, it never came back.  i tried everything that was suggested including puting in the start up disk.  The disk would not eject.  Some one

    Imac  have black screen. Start Computer sound come on, no picture. The last time I used the computer I put it to sleep, it never came back.  i tried everything that was suggested including puting in the start up disk.  The disk would not eject.  Some one suggested how to remove it and that did work.  Computer going to Apple hospital Tues. July 3,  thank you for all the suggestions.
    Phyllis33

    There is nothing wrong with the OS update.
    Delete ALL your email accounts.
    Restart Playbook
    Put the accounts back and ensure they are all set with PUSH ON.  Manual (push off) will burn battery.
    Similarly delete your wifi connections and add back when required. 
    Turn off wifi is not connected to wifi. 
    Any "hunting for connection" in email or wifi will burn up battery.

Maybe you are looking for