Loading startup class before Applications

I need to load a startup class before my EJBs are deployed. The "deployment order"
field from the console works for components of the same type only. Looks like WLS
always loads Applications before startup classes. Does anyone know how to change
this configuration?
Thanks,
Stefano

Hi Stefano
I think the relevant CR for this problem is CR061426.
This CR is included in sp3 of WLS6.1
Hope this help
J-F
Stefano wrote:
I need to load a startup class before my EJBs are deployed. The "deployment order"
field from the console works for components of the same type only. Looks like WLS
always loads Applications before startup classes. Does anyone know how to change
this configuration?
Thanks,
Stefano

Similar Messages

  • XML file for loading different classes in application ?

    Hi,
    I want to configure a small application ( a simulator ) using a XML file. The XML file determines the classes, whih should be loaded, and initialize the variables (values set in the XML files). I want to have different modules (same functionality, different implementations) and which module is loaded, is determined by the XML file ( a scenario ).
    I am not sure, how can I implement it ? Should I use Java Beans with XMLBeans ? Is there a standard way for doing this ? I will appreciate any advice.
    Thanks in advance.
    Bobi

    I used the java class loading capability using the following code snippet
    public void loadPlugin(String entrypoint, String name)
              Plugin plugin;
              Class c;
              try
                   c = Class.forName(entrypoint);
                   plugin = (Plugin)c.newInstance();
                   plugin.setName(name);
                   plugin.setConnection(DBHandler.getConnection());
                   plugin.setParameters(_pluginReader.readParameters(name));
                   if (plugin != null && _plugins != null)
                        _plugins.add(plugin);
              catch (Exception e)
                   e.printStackTrace();
         }I have to add that I have an interface called Plugin that specifies the above mentioned method stubs.

  • Problems with Deployment, Startup classes and MBeanHome

    Hello,
    we have the following problem: How to initialize our application
    correctly???
    We are using MDBs as message consumers but have to guarantee the order of
    incoming
    messages. Due to a shortcoming in the JMS implementation (Order of
    redelivered messages
    is not guaranteed before WLS 8.1!!!) we are using a singleton class to keep
    the health state
    of the different message queues within the application (controlling whether
    the MDBs are
    supposed to proceed with processing or to discard any incoming messages).
    Thus the MDBs
    have to access this singleton, what implies latter has to be initialized
    prior to the application
    deployment. That's what we are using a startup class for, which is marked to
    be loaded before
    appplication deployment...
    Fortunately the according bug is fixed with WLS 7.0.2.0, so the class is
    loaded, but we are
    not able to access the MBeanHome interface (We like to register MBean to
    provide
    adminstrative access to the health state)!!!
    javax.naming.NameNotFoundException: Unable to resolve
    'weblogic.management.home.localhome' Resolved: 'weblogic.management'
    Unresolved:'home' ; remaining name 'home.localhome'
    at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
    So when is the MBeanServer started???
    Before application deployment??? After??? Is there any way to tell WLS not
    to load the startup
    class before the MBeanServer is available respectively the MBeanHome is
    accessible via JNDI
    but before application deployment???
    Any hints are welcome!!!
    Regards,
    CK

    this seems like a bug. the mbeanhome should be available for lookup in
    startup classes. also posting to system management newsgroup.
    "Carsten Kaiser" <[email protected]> wrote in message
    news:[email protected]..
    Hello,
    we have the following problem: How to initialize our application
    correctly???
    We are using MDBs as message consumers but have to guarantee the order of
    incoming
    messages. Due to a shortcoming in the JMS implementation (Order of
    redelivered messages
    is not guaranteed before WLS 8.1!!!) we are using a singleton class tokeep
    the health state
    of the different message queues within the application (controllingwhether
    the MDBs are
    supposed to proceed with processing or to discard any incoming messages).
    Thus the MDBs
    have to access this singleton, what implies latter has to be initialized
    prior to the application
    deployment. That's what we are using a startup class for, which is markedto
    be loaded before
    appplication deployment...
    Fortunately the according bug is fixed with WLS 7.0.2.0, so the class is
    loaded, but we are
    not able to access the MBeanHome interface (We like to register MBean to
    provide
    adminstrative access to the health state)!!!
    javax.naming.NameNotFoundException: Unable to resolve
    'weblogic.management.home.localhome' Resolved: 'weblogic.management'
    Unresolved:'home' ; remaining name 'home.localhome'
    at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
    So when is the MBeanServer started???
    Before application deployment??? After??? Is there any way to tell WLS not
    to load the startup
    class before the MBeanServer is available respectively the MBeanHome is
    accessible via JNDI
    but before application deployment???
    Any hints are welcome!!!
    Regards,
    CK

  • Startup class not found if included in a jar inside the ear

    I have written a startup class, i have packed it in a jar file(along with some
    other classes). This jar is then packed in side an ear file.(This way i get one
    single distribution file). I have added the startup class in the config.xml using
    weblogic console.But at start up weblogic is unable to find the class. How to
    tell weblogic about the location of the class(classpath) which is inside the ear
    file. Error i get is as follows
    <Aug 21, 2003 8:07:23 PM IST> <Emergency> <WebLogicServer> <BEA-000342> <Unable
    to initialize the server: weblogic.t3. srvr.FatalStartupException: Can't start
    server due to startup class failure WISORCODES_SERVER - with nested exception:
    [java.lang.ClassNotFoundException: com.wisor.common.wisorcodes.rmi.WisorCodesServer]>
    *************************************************************************** The
    WebLogic Server did not start up properly. Exception raised: 'weblogic.t3.srvr.FatalStartupException:
    Can't start server due to startup class failure WISORCODES_ SERVER - with nested
    exception: [java.lang.ClassNotFoundException: com.wisor.common.wisorcodes.rmi.WisorCodesServer]'
    Reason: weblogic.t3.srvr.FatalStartupException: Can't start server due to startup
    class failure WISORCODES_SERVER - wi th nested exception: [java.lang.ClassNotFoundException:
    com.wisor.common.wisorcodes.rmi.WisorCodesServer] ***************************************************************************

    Shirish:
    Classes that are scoped in the application are only visible within the
    application, not to the system classloader.
    If you want to have startup classses scoped inside an EAR then you need to
    use Application lifecycle listeners to actually activate these startup
    classes. Application lifecycle listeners are a replacement for startup
    classes.
    You can check out an example of this in 8.1:
    $BEA_HOME/weblogic81/samples/server/examples/src/examples/splitdir/helloWorl
    dEar
    Docs for it are:
    $BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
    dEar\javadoc\index.html
    Check out:
    $BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
    dEar\META-INF\weblogic-applcation.xml
    <weblogic-application>
    <listener>
    <listener-class>examples.splitdir.hello.startup.ApplicationStartup</listener
    -class>
    </listener>
    </weblogic-application>
    and
    $BEA_HOME\weblogic81\samples\server\examples\src\examples\splitdir\helloWorl
    dEar
    /appStartup/examples/splitdir/hello/startup/ApplicationStartup.java
    Now if you have a "startup class" that needs to be accessible for the entire
    Server for a set of applications, I suggest just writing a single EAR with a
    dummy web-app (I think you may need a dummy module) and an applicaiton
    lifecycle listener, and have this EAR deploy before any other apps.
    Cheers
    mbg
    "Shirish" <[email protected]> wrote in message
    news:[email protected]...
    >
    I have written a startup class, i have packed it in a jar file(along withsome
    other classes). This jar is then packed in side an ear file.(This way iget one
    single distribution file). I have added the startup class in theconfig.xml using
    weblogic console.But at start up weblogic is unable to find the class. Howto
    tell weblogic about the location of the class(classpath) which is insidethe ear
    file. Error i get is as follows
    <Aug 21, 2003 8:07:23 PM IST> <Emergency> <WebLogicServer> <BEA-000342><Unable
    to initialize the server: weblogic.t3. srvr.FatalStartupException: Can'tstart
    server due to startup class failure WISORCODES_SERVER - with nestedexception:
    >
    >
    [java.lang.ClassNotFoundException:com.wisor.common.wisorcodes.rmi.WisorCodesServer]>
    >
    The
    WebLogic Server did not start up properly. Exception raised:'weblogic.t3.srvr.FatalStartupException:
    Can't start server due to startup class failure WISORCODES_ SERVER - withnested
    exception: [java.lang.ClassNotFoundException:com.wisor.common.wisorcodes.rmi.WisorCodesServer]'
    Reason: weblogic.t3.srvr.FatalStartupException: Can't start server due tostartup
    class failure WISORCODES_SERVER - wi th nested exception:[java.lang.ClassNotFoundException:
    com.wisor.common.wisorcodes.rmi.WisorCodesServer]***************************************************************************
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >

  • 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.

  • ServletStartup called before application startup

    I need to load two servlets on startup. They both depend on my
              application being up, however the servletStartup is called before the
              other startup classes.
              Previous posts seemed to indicate that there was no definitive way to
              control startup order.
              Any suggestions?
              I thought about calling weblogic.servlet.utils.ServletStartup directly,
              but can't find any javadocs and don't think it's public.
              I don't really want to "hit" the servlets using urlConnection, although
              that's the only thing I can think of.
              Any way that startup "ordering" could be added in a future version? It
              seems pretty useful (necessary) to me.
              Thanks,
              Robert Quinn
              

    Thanks for your help. I would agree that a better system for ordering startup classes would
              helpful.
              Alexander Petrushko wrote:
              > Robert Quinn wrote:
              >
              > > I need to load two servlets on startup. They both depend on my
              > > application being up, however the servletStartup is called before the
              > > other startup classes.
              > >
              > > Previous posts seemed to indicate that there was no definitive way to
              > > control startup order.
              >
              > The only way to control the order of startup classes being executed is to
              > register
              > them in the same statement in the order you want, like so
              >
              > weblogic.system.startupClass.myApp=com.foo.bar.MyApp,weblogic.servlet.utils.ServletStartup
              >
              > weblogic.system.startupArgs.myApp=param1=foo,param2=foo,servlet=com.foo.bar.MyServlet
              >
              > Both MyApp and ServletStartup will receive the same hashtable with
              > param1/param2/servlet
              > args but MyApp will be executed first. The problem with this approach is
              > that this registration stanza tends to get very messy as startup classes
              > are added.
              >
              > This "feature" can definitely use some improvement, namely having another
              > property to specify the order of execution a la
              >
              > weblogic.system.startupClass.myApp=...
              > weblogic.system.queueOrder.myApp=1
              >
              > weblogic.system.startupClass.myOtherApp=...
              > weblogic.system.queueOrder.myOtherApp=2
              >
              > Regards,
              >
              > Alex.
              >
              > --
              > mailto:[email protected] // Consulting services available
              

  • How to load a java class when application is at first time browsed.

    Hi
    How can i load a simple java class on application startup.
    For servlet it could be done using "load on startup" tag in web.xml
    but how could the same be achieved for a simple java class.
    Thanks

    Hi
    Code is given below....
    package com;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class Test {
    Test()
         HttpServletRequest request=null;
         HttpServletResponse response=null;
         RequestDispatcher requestDispatcher = request.getRequestDispatcher("a.jsp");
         try {
              requestDispatcher.forward(request,response);
         } catch (ServletException e) {
              System.out.println("success");
              e.printStackTrace();
         } catch (IOException e) {
              System.out.println("success 1");
              e.printStackTrace();
         finally
              System.out.println("success 2");
         System.out.println("success 3");
    }Web.xml :
    <servlet>
            <servlet-name>simple</servlet-name>
            <servlet-class>com.Test</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
      <servlet-mapping>
          <servlet-name>simple</servlet-name>
          <url-pattern>/init.do</url-pattern>
        </servlet-mapping>Error Trace :
    org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /DispatcherTest threw load() exception
    java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class com.Test with modifiers ""
         at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
         at java.lang.Class.newInstance0(Class.java:344)
         at java.lang.Class.newInstance(Class.java:303)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3857)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4118)
         at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1069)
         at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1162)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
         at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
         at java.lang.Thread.run(Thread.java:595)

  • Which classloader loads the startup class?

    Hi!
    Which classloader loads the startup and shutdown classes?
    Thx.
    A.

    You're correct.
    Just to be 100% clear, the startup classes defined in config.xml are loaded from the $CLASSPATH, domain/lib (in 9.x) or the JDK extensions directory.
    Startup classes which are defined in the weblogic-application.xml (application-scoped startup classes) can be in the application or in any of the server-wide classpath locations.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • 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

  • Startup class is run before web services are deployed

    Hello, I need to run a class at server start-up which uses web services deployed on the same Weblogic server.
    I'm using Weblogic startup class, which fires after the server is up and all modules have been deployed.
    However, it is fired before web services are deployed, so this solution doesn't work.
    Is there a way to have a class that is run by Weblogic after web services are deployed?
    Right now I'm using a timer that polls the server till the services are up and running, but I hope there's a cleaner way.
    thanx,
    Mike

    Thanx for response.
    Looking at the logs, the following came to light.
    1. My app does get deployed last, but the ServletContextListener in my app is fired after all modules "...transitioned from STATE_PREPARED to STATE_ADMIN".
    It took a few more seconds for all modules to transition "from STATE_ADMIN to STATE_ACTIVE".
    2. After all modules transitioned to STATE_ACTIVE, the log shows this:
    <Channel "DefaultSecure" is now listening on xxx.xxx.xxx.xxx:443 for protocols iiops, t3s, ldaps, https.>
    I assume that only at this point are web services accessible. The error that I get when trying to invoke a web service from ServletContextListener is:
    java.net.ConnectException: Tried all: 1 addresses, but could not connect over HTTPS to server: RLOCVGVY91 port: 443
         at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:289)
    So I dunno... If my ServletContextListener waits for 10 seconds, everything works.
    Mike

  • Lifecycle functionality for startup class at ear level

    Hi,
    I've searched and searched and read through a great deal of the R3 (10.1.3)documentation, looking for the ability to initialize a thread/class at application startup time at the ear level. I see where it is documented how to initialize a servlet at application startup using the "load-on-startup" tag, however, I have been unable to find any documentation outlining how to do so at the ear/EJB container level.
    Is my only option to put together a servlet that calls/starts my ejb level class/thread and then configure that servlet for "load-on-startup"?

    Lest you thought nobody has looked at your post, here I am, with a negative answer though. I do not think there is a lifecycle functionality for startup/shutdown class at ear level in oc4j. There are startup/shutdown classes that are called after OC4J initializes or before OC4J terminates, which is not what you are looking for either.

  • 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 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

  • Propagating JAAS Subject for startup classes

    Do startup classes have to login before they can access secured
    resources in WLS 6.0? I notice that WLS 6.0 asks for a password before
    starting the server. Is the "subject" created by that login somehow
    propagated to startup class threads (and their thread offspring) or does
    this have to be done manually?
    I want to try to set up startup classes using a security style similar
    to the Unix init process. It starts up as root and then starts its
    services/daemons using something like:
    su - foo-user foo-daemon
    The foo-daemon runs as foo-user and, in Unix, so does every process
    forked by the foo-daemon. I would like to use a parallel approach in
    WLS. Can it be done?
    Thanks,
    Tim Taylor

    Hi,
    That's what I think too. I guess the only way to get the credentials is to
    use a weblogic specific class that allows you to login an user from a servlet/jsp.
    It does returns the Subject instead of a principal, so you can get the credentials...
    seems like we'd need to change the J2EE api to further integrate JAAS with it.
    Welll... back to handling security on my own :\
    Regards,
    Leonardo Bueno
    "Utpal" <[email protected]> wrote:
    I think EJBContext.getCallerPrincipal() and
    HttpServletRequest.getRemoteUser() are the only method
    to get the principal. I don't think subject can be accessed in the
    EJB/Servlet using standard APIs.
    -utpal
    "Leonardo Bueno" <[email protected]> wrote in message
    news:3ef74da0$[email protected]..
    Hi,
    I have to write a security framework for my J2EE application and ithas to
    be
    portable between appservers. I`m thinking about using JAAS andprogrammatic security.
    I`ve written a LoginModule that does user authetication and loads alluser
    credentials.
    These credentials are app specific classes like WindowPermission.
    How can I have access to these credentials from a servlet/EJB? Is therea
    way
    to get the Subject and not just the Principal from a servlet/EJB?
    Thanks,
    Leonardo

  • Startup class is not working in oc4j

    hi
    I have a servlet .In init of that servlet I will create an instance of a startup class .
    In web.xml configuration I gave <load-on-startup></load-on-startup> .I created a war and an ear and deployed my application .The startup class is not called.
    But when I configured the servlet in the default-web-app the startup class is running.
    And furthur when I hot deploy my ear the startup class is running.
    But when I restart my application server the startup class is not invoked.
    can anybody help
    Regards
    Gajendran.G

    hi
    I had put auto-start=true in server.xml .then also it is not working.
    when I redeploy my ear,the startup class is invoked,but when i restart the
    server it does'nt
    gaj

Maybe you are looking for

  • Show "Video Used" in Project List view?

    Is there anyway to show the "Video user X times" feature, that is available in the icon video, in the list view? I know you can see this information, in list view, for the selected clip (using the preview area) but I want to look at a bin of 100 clip

  • When we go for abstract !

    Hello friends, When we go for abstract class and when we go for interface? i think the interface are future use in realtime but abstract we must use immediatly?is it correct ? thanks and regards ramesh,

  • How to add a link to your message

    Does anyone know how to add a link to a message?

  • Dynamic Tray Selection in Smartforms

    Hi all, I am looking for a solution, to set the tray in a Smartform dynamically. It is not sufficient to set the Tray statically on the "Output Options" tab -> Ressource Name. Can anybody help me?!? Thanks and best regards, SteCee

  • TRANSPORT IS HANGING.

    Transport is hanginig in QAS server. here i put alog and slog. ALOG:- ALL                  QAS.ALL t 0000 20050301151910              TMSADM       hostname                   ALL                  QAS.ALL t 0000 20050301151916              TMSADM