Startup class/process for EJB application

Hi,
I have an EJB module deployed on WebLogic8.1. My requirement is I would like to have a startup/shutdown class which is called when the EJB application is deployed. I have made some research and have found I can write startup/shutdown classes when for the server life cycle or for application life cycle events. Can anyone tell me write/deploy a startup/shutdown class for the EJB module life cycle.
Thanks,
Faizulla

Hi,
For Server life cycle events you can write server startup/shutdown classes.(You can see it from the console application)
For application life cyccle events, please go through:
http://e-docs.bea.com/wls/docs81/programming/app_xml.html#1007582
You can specify it <listener> part of application.xml.
This is impossible in J2EE standard. But perhaps this can be achieved by some app. server specific extensionYes,in earlier versiobns there was weblogic-ejb-extensions.xml file in which you can specify startup/shutdown class, like:
<!DOCTYPE weblogic-ejb-extensions SYSTEM "weblogic-ejb-extensions.dtd" >
<weblogic-ejb-extensions>
<module-initializer-classs>
<moduleinitializer-class-name>com.dcons.iss.ejb.MUTBStatusObject</moduleinitializer-class-name>
</module-initializer-class>
</weblogic-ejb-extensions>
But it's no longer in use.
I am still findind out a way for my EJB module initializer class.
Regards,
Faizulla

Similar Messages

  • Difference between narrow() method usage and simple class cast for EJB

    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?
    P.S. I'm working with WL 6.1 sp2
    Any help would be appreciated.
    Thanks in advance,
    Orly

    [email protected] (Orly) writes:
    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?(1) is mandated by the spec. It is required because CORBA systems may
    not have sufficient type information available to do a simple case.
    P.S. I'm working with WL 6.1 sp2 You should always use PRO.narrow()
    andy

  • Weblogic startup class: problem calling EJB's

    Has anyone ever experienced a problem in using a startup class (registered in weblogic.properties)
    and tried to lookup and use an EJB in the same application?
    Basically, I have a startup class which registers to receive messages from an
    MQ queue, and when it receives a message, it tries to do a lookup of a bean and
    use it, but I receive a 'NullPointerException'.
    I'm running Weblogic 5.1
    (I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my app isn't using
    6 or EJB 2.0)
    Thanks...

    Can you post weblogic.log? Are you sure that EJB was deployed successfully.
    Also comment the PROVIDER_URL in initial context and see if that solves the problem
    Viresh Garg
    BEA Systems
    shaun wrote:
    The exception is simply a 'NullPointerException' coming from the startup class
    (I don't have the old log file or I would include the trace here.). Basically,
    when my startup class receives a call to the onMessage(...) method (from listening
    for messages), it looks up an EJB on the server, through the InitialContect class
    and gets a 'null' returned back, thereby throwing the NullPointerException.
    If anyone else is successful in having a startup class which can lookup and call
    an EJB within the same Weblogic server, please help.
    Thanks again....
    Viresh Garg <[email protected]> wrote:
    Can you post the exception stack trace? Also what exactly are you doing
    in startup class.
    Viresh Garg
    Principal Developer Relations Engineer
    BEA Systems
    Shaun wrote:
    Has anyone ever experienced a problem in using a startup class (registeredin weblogic.properties)
    and tried to lookup and use an EJB in the same application?
    Basically, I have a startup class which registers to receive messagesfrom an
    MQ queue, and when it receives a message, it tries to do a lookup ofa bean and
    use it, but I receive a 'NullPointerException'.
    I'm running Weblogic 5.1
    (I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my appisn't using
    6 or EJB 2.0)
    Thanks...

  • How can I make server use single class loader for several applications

    I have several web/ejb applications. These applications use some common libraries and should share instances of classes from those libraries.
    But applications are being deployed independently thus packaging all them to EAR is not acceptable.
    I suppose the problem is that each application uses separate class loader.
    How can I make AS use single class loader for a set of applications?
    Different applications depend on different libraries so I need a way that will not share library for all applications on the domain but only for some exact applications.
    When I placed common jar to *%domain%/lib* - all works. But that jar is shared between all applications on the domain.
    When I tried to place common jar to *%domain%/lib/applibs* and specified --libraries* attribute on deploying I got exception
    java.lang.ClassCastException: a.FirstDao cannot be cast to a.FirstDaoHere http://download.oracle.com/docs/cd/E19879-01/820-4336/6nfqd2b1t/index.html I read:
    If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared.
    This can reduce the memory footprint and allow sharing of static information.Does it mean that classes should be able to be casted ?

    You didn't specify which version of the application server you are using, but the config is similar as long as you know what to look for. Basically, you need to change the classloader delegation. Here's how it is done in 8.2
    http://download.oracle.com/docs/cd/E19830-01/819-4721/beagb/index.html

  • Rules for EJB Application

    Hello,
    I am developing an ejb application. I am still learning and this is my first application.
    1) I am unable to understand where should use Entity Beans or session bean and why i mean how i justify my using Entity bean or session bean? If using entity beans how to decide that it should be BMP or CMP and why? how i justify using CMP or BMP?
    2) I have heard that Entity beans are related to Persistant data if so then if some application design has 50 to 75 tables then should there be those many Entity Beans corresponing to those tables? if i use 50 to 75 entity beans then what effect will it have on performance??
    it will be a great help if someone solve these queries by giving proper example. suppose in context a web application where vendors post there porduct to sell and different users come and purchase these products online.
    Thanxs

    Use session beans for business logic components and Entity beans for accessing persistent data. It is a common pattern to put up a "session facade" over the entity beans so that the client doesn't have to assume anything about storage and retrieval of data. You can have a 1-1 mapping between entity beans and database tables, but you don't have to. Read the online "Mastering EJB" book at www.theserverside.com to better understand the concept of EJB's.

  • Java Processes for Planning Applications

    Hi There,
    We've experienced performance issues where we have reached the limit of the java process for Hyperion Planning - WAS element. My question! Is it possible to create multiple java processes for Hyperion Planning, for example: If we have 7 Planning applications could we have 7 Java processes running - one for each application?
    Thanks
    Mark

    Couple of thoughts on scaling:
    1. Change the mx setting to 1200m -- this is the most you can scale a single instance on 32-bit
    2. Use a 64-bit platform you can set memory settings really high (AIX/Solaris)
    3. Multiple servers with planning on it using a load balancer
    Regards,
    John A. Booth
    http://www.metavero.com

  • Build process for ejb iiop example

    Hello and thank you in advance,
    I'm trying to build the examples under iiop examples for WL6.1 (Win NT), and the
    'ant' build xml file contains a tag line <createidl ... which causes the build
    to fail. I've been unable to find anything on this tag.
    Am I supposed to replace this line with some other code? If so, then can anyone
    help with the code.
    Thanks!
    Sean

    C:\bea\wlserver6.1\lib>dir weblogic.jar
    Volume in drive C is Main
    Volume Serial Number is 10C7-F019
    Directory of C:\bea\wlserver6.1\lib
    10/22/2001 09:26p 25,158,674 weblogic.jar
    1 File(s) 25,158,674 bytes
    0 Dir(s) 5,713,345,024 bytes free
    C:\bea\wlserver6.1\lib>jar tvf weblogic.jar | grep taskdefs | grep iiop
    0 Tue Sep 18 14:43:22 CDT 2001 weblogic/ant/taskdefs/iiop/
    1738 Tue Sep 18 14:43:22 CDT 2001 weblogic/ant/taskdefs/iiop/CppIdlSetup.class
    Hope this helps,
    Robert
    Sean Cloutier wrote:
    Thank you for the reply Andy, however I'm unable to find the 'iiop' package under
    the taskdefs package. I'm looking in the weblogic.jar file included with WLS6.1
    (WinNT) service pack 1.
    Is it possible that this is somewhere other than the weblogic.jar file? If so,
    then where?
    thanks again,
    Sean
    Andy Piper <[email protected]> wrote:
    "Sean Cloutier" <[email protected]> writes:
    I think it should be
    weblogic.ant.taskdefs.iiop.CppIdlSetup
    andy
    Andy Piper <[email protected]> wrote:
    Robert Patrick <[email protected]> writes:
    Of course Andy really meant to say weblogic.jar since there is no
    weblogicaux.jar
    file
    in WLS 6.xOf course I did ;-)
    andy
    --Ok, I guess I'm a little confused now. You say task, which I'm assumingyou mean
    would be in the taskdef package of 'ant' which is included in the weblogic.jar
    file. I looked through the weblogic.jar file and never found any'task' which
    is called 'createidl'.
    I'm I confused or missing something?
    Thanks again for your help!
    Sean

  • How to implement Startup class for OC4J

    I'm in the process of converting my current J2EE application from weblogic 5.1 to OC4J.
    I have startup class that would set application specific properties by reading property file. In addition, this class would also check for certain resource availability (like database) during weblogic startup. I could not find similar option in OC4J.
    Any help to convert this startup class for OC4J would be highly appreciated.
    Thanks
    Sankaran.

    Hi Sankaran,
    Your eMail address suggests you work for Oracle. Do you? Can't someone
    at Oracle help you?
    I imagine that Oracle would have some kind of agreement with Ironflare
    as well. Can't someone at Ironflare help you?
    But remember, with application servers (as with RDBMSs), no two are the
    same. Each one offers the same functionality, but using different methods
    to achieve that functionality. I don't know how to do it, but I'm sure
    you can check database availability when starting up OC4J -- just not
    the same way you do it in Weblogic.
    Good Luck,
    Avi.

  • 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

  • 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

  • Weblogic startup class and EAR file

    Hi,
    I am using WL 8.1.5.
    I have a weblogic starup class MyStartup that implements T3StartupDef. (it does not specify package).
    I jar-ed it. And I placed MyStartup.jar file into the MyEA.ear file. And I placed that into applications dir.
    With WL Console I defined the startup class and for the ClassName specified MyStartup.
    Yet I get the java.lang.ClassNotFoundException.
    I also have a Manifest.mf file with
    Class-Path: MyStartup.jar
    Please help me solve this problem, I literally don't know what to do next.
    MB

    Hi,
    thanks.
    This seems like a completely opposite method of the depplying startup class with weblogic console.
    Does my class still need to implement T3StartupDef?
    I get this exception. And my classnotfound is still there.
    Exception:weblogic.management.ApplicationException: startup.MyStartup
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2484)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2396)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:883)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:591)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Regards,
    MB

  • Help needed in writing installers for swing application

    Hi ,
    I want to write an installer for one of our home grown profiler tool. I need to write the installer for different platforms such as windows,linux,solaris,HP-UX.
    Does anybody have any idea of how to go ahead in writing installations. Share if there is any good links such as tutorials as well is thr any opensource tool (similar to installsheild) to write installers . As well following is the tentative algorithm for my install sheild
    1. Create a home dir for the tool and put all the application files in tht.
    2. Installing a 3rd party jar and make a home for it.
    3. Option for user to select the features(i hv 2 features. user can either select both or select individual feature) to be installed.
    4. Select the appserver home if any. On selection i hv to update the classpath in the startup batch file for the application(This is the toughest step i beleive bcoz each appserver have different folder structures and different startup batch files).

    Tried obtaining the output using SQL and the result is as follows:
    SQL> WITH T AS
      2  (
      3  SELECT 1 COL1 FROM DUAL
      4  UNION
      5  SELECT 2 COL1 FROM DUAL
      6  UNION
      7  SELECT 3 COL1 FROM DUAL
      8  UNION
      9  SELECT 4 COL1 FROM DUAL
    10  UNION
    11  SELECT 5 COL1 FROM DUAL
    12  UNION
    13  SELECT 8 COL1 FROM DUAL
    14  UNION
    15  SELECT 9 COL1 FROM DUAL
    16  UNION
    17  SELECT 10 COL1 FROM DUAL
    18  UNION
    19  SELECT 13 COL1 FROM DUAL
    20  UNION
    21  SELECT 14 COL1 FROM DUAL
    22  UNION
    23  SELECT 15 COL1 FROM DUAL
    24  UNION
    25  SELECT 16 COL1 FROM DUAL
    26  UNION
    27  SELECT 23 COL1 FROM DUAL
    28  UNION
    29  SELECT 24 COL1 FROM DUAL
    30  )
    31  SELECT OUTPUT FROM
    32  (
    33  SELECT DECODE(COL3,NULL,COL1, COL2)  || '-' || LEAD(DECODE(COL3,NULL,COL3, COL1)) OVER (ORDER BY DECODE(COL3,NULL,COL1, COL2)) OUTPUT  FROM
    34  (
    35  SELECT COL1, LEAD(COL1) OVER (ORDER BY COL1) COL2, LAG(COL1) OVER (ORDER BY COL1) COL3 FROM T
    36  )
    37  WHERE
    38  (COL2 - COL1 > 1 OR COL2 IS NULL OR COL3 IS NULL)
    39  )
    40  WHERE OUTPUT != '-';
    OUTPUT                                                                         
    1-5                                                                            
    8-10                                                                           
    13-16                                                                          
    23-24

  • Missing EJB application and tutorial sample in workshop 8.1

    HI,
    I just installed workshop 8.1 from the BEA CD. I wanted to follow the EJB tutorial
    that's available in e-docs on the web, however, i don't see the Enterprise JavaBeans
    tutorial (the Band example) in the list of new Applications (under tutorial).
    I also don't see a new application template of Enterprise javaBeans under 'All'
    (not sure if there should be one).
    Could someone please let me know why I'm missing the Enterprise javaBeans tutorial
    and how I can get it? Also, why don't I see an application template for EJB Application?
    Thanks,
    Prab

    Akshay,
    Please post this question in the Workshop 8.1 Beta Newsgroup.
    weblogic.developer.interest.81beta.workshop
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Akshay Aggarwal" <[email protected]> wrote in message
    news:3e9107da$[email protected]..
    >
    Hi All,
    I am getting problem in loading variables and control in the Workshop Dataand
    Control Palette at times when I open the application. The Workshopinterface shows
    the variable at times and does not show up at all on another instance. Letme
    know if anybody else has faced a similar problem or not

  • Flex 2 configuration for Struts application

    Hello everyone,
    Good afternoon.
    I have some questions regarding the Flex 2 and Struts. I use
    struts for long time already but just touch the Flex 2 since last
    week. As I know, we can use Flex 2 to build our front end and
    Struts for the Control and the back-end process for
    Web-Application. I already read the article "Flex 2 Tag Library for
    JSP" but still cannot get it correctly. Can anyone kindly help me
    to setup and make it works.
    I already downloaded and installed the following:
    1. Struts 1.2.7 (I am using the struts-blank as my base
    application)
    2. Flex Builder 2 (With Flex SDK)
    3. Flex Data Service 2.0.1
    I followed what is writen in the web-site. But cannot make it
    right. Please help me.
    Thank you and Good day,

    Hi,
    You may go through this link to get the overview of the database level requirements for Siebel 8.1 database:
    http://download.oracle.com/docs/cd/E11886_01/V8/CORE/SRSP_81/SRSP_81_DBPlatforms2.html#wp1013211
    The Siebel Bookshelf available at edelivery.oracle.com will give you a complete and in depth picture.
    For Development instance, ensure that you have binary sort order set.
    It is recommended to use AL32UTF8 as the codepage for Dev enviornment multi lingual enviornment.
    Thanks and Regards,
    Tanmay Jain

  • 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

Maybe you are looking for

  • Download data from infotypes

    Hi, My client wants me to download all the data in infotypes(std and custom) from production client. Then they will migrate this data to their new system. What would be the approach for downloading? 1. Through SE16N (we are not authorized to use SE11

  • Client Proxy error

    Hi friends, My scnario is Proxy to JDBC. In this when i went to test my proxy interface.. i got this error.. <CODE>INTERNAL.SYSTEM_NOT_CONFIGURED_AS_XMB</CODE>   <ERRORTEXT>System not configured as XI Integration Engine</ERRORTEXT> please rectify.. R

  • Remote Debug in oas 4.0.8.2 using JDeveloper3.1

    Now I can do remote debug using JDeveloper3.1 in Tomcat or WebLogic! But I can not do remote debug in Oralce Application Server 4.0.8.2. Who knows how to remote debug in OAS, mainly for how to configure OAS to support remote debug, please tell me as

  • Can't find local cluster

    So I recently migrated to a new hard drive since my laptop just ran out of warranty. Everything was working fine I just wanted a faster one. I used SuperDuper to make a true direct copy and everything seemed to running smooth. Until I launched compre

  • Where do you set drawing mode in preferences? Can't find anywhere

    I read Chris' response to the issue of the screen going dark when using tools. He said to set the drawing mode to basic in preferences. I can't find an option anywhere in preferences to do this. Where do I go to accomplish this?