Initialising class when J2EE server starts

Hi,
I am facing a problem. I wish to instantiate a class when the J2EE/ tomcat server starts. This is similar to the property set in weblogic as
weblogic.system.startupClass.startup = <name of ur startup class>
Here we can specifiy the class to be instantiated during startup of server.
Can i do something similar in tomcat/ j2ee server?
I do not wish to use a servlet since my webapplication contains jsps and other supporting classes and my own apis.
Thank you in adv.
...supriya.

if you use ServletContext Listeners you should be ready as far as web app is concerned. Most servers I believe offer JMX integration so that you can listen for server startups. : )

Similar Messages

  • Start deployed applications when J2EE Server starts

    Hi experts,
    This is my problem.
    I've updated my Netweaver 04s Developer Workplace from SPS1 to SPS10.
    The problem I have is that when I start my J2EE Server via MMC, the applications (j2ee,ear,webdynpro,...) I deployed don't start.
    If in my Visual Administrator I go to server->services->deploy most of them are not started. I can start them manually, but that's not a solution...
    I suppose there are any possibities to set this applications to start when the server is started.
    Any ideas?
    Thanks a lot.
    Alberto.

    Hi Alberto
    If you can start the services manually w/o problems, then maybe you can try to change the startup mode to 'always' so that the service is started automatically. You should be able to check this via Configtool. Switch to the 'configuration editor' mode and go to cluster_data -> server -> cfg -> services. Look for the service and make click on the propertysheet. Usually you can modify the startup mode there.
    I hope this helps.
    Regards,
    Désiré

  • Null argument for startup classes when managered server starts

    Hi Everyone,
    We have a Weblogic 10.3.5 clustering environment. the environment seems to work fine. I am able to have the servers (both Admin and Managed) and deployed applications running without any problems. However, I just notice that, every time when I start the Managered servers, I got the following information in the system log. It appears that they are start-up classes, but with null argument. Are they normal or not?
    Thanks in advance,
    John
    ####<Feb 22, 2012 11:28:27 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928107258> <BEA-000256> <Invoking oracle.dms.wls.DMSShutdown.main(null)>
    ####<Feb 22, 2012 11:28:27 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928107769> <BEA-000256> <Invoking oracle.ias.cache.Shutdown.main(null)>
    ####<Feb 22, 2012 11:40:08 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928808600> <BEA-000256> <Invoking oracle.jrf.wls.JRFStartup.main(null)>
    ####<Feb 22, 2012 11:40:08 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928808682> <BEA-000256> <Invoking oracle.security.jps.wls.JpsWlsStartupClass.main(null)>
    ####<Feb 22, 2012 11:40:08 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928808790> <BEA-000256> <Invoking oracle.core.ojdl.weblogic.ODLConfiguration.main(null)>
    ####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817314> <BEA-000256> <Invoking oracle.jrf.AppContextStartup.main(null)>
    ####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817318> <BEA-000256> <Invoking oracle.as.jmx.framework.wls.spi.StartupListener.main(null)>
    ####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817432> <BEA-000256> <Invoking oracle.j2ee.ws.server.WebServiceServerStartup.main(null)>
    ####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817492> <BEA-000256> <Invoking oracle.ias.cache.Startup.main(null)>
    ####<Feb 22, 2012 11:40:17 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928817493> <BEA-000256> <Invoking oracle.dms.wls.DMSStartup.main(null)>
    ####<Feb 22, 2012 11:40:18 AM EST> <Info> <Management> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928818207> <BEA-141278> <Java entropy configuration is: System property "java.security.egd= null"; JRE's java.security file property "securerandom.source= file:/dev/urandom"; Blocking Config= false; JDK version= 1.6.0_26; Operating System= Linux.>
    ####<Feb 22, 2012 11:40:48 AM EST> <Info> <WebLogicServer> <entwl2u-vm.co.pinellas.fl.us> <Pinellas1uCluster1MS2> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1329928848987> <BEA-000256> <Invoking oracle.security.audit.ajl.loader.JEEAuditLoader.main(null)>

    Hi John,
    This is Ok. Those are just info messages. Thery are not warnings or errors, so nothing to worry about.
    If the classes are invoked with null arguments and no exception is thrown, then is means that the class is able to have a null argument, so nothing to worry about again.
    Regards,
    Cris

  • How to add an object in JNDI when a server starts?

    I have an integration app. The app contains EJB project. The project contains EJB which reads data from LDAP.
    My first version of EJB contains the following code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, strProvider);
    env.put(Context.SECURITY_AUTHENTICATION, strAuth); env.put(Context.SECURITY_PRINCIPAL,strPrincipal); env.put(Context.SECURITY_CREDENTIALS,strCredentials);
    DirContext dirCtx = new InitialDirContext(env); // exception
    All connection properties are hardcoded and it is not a good practice.
    Also I can put those properties into deployment descriptor. But I am going to have some EJBs and each EJB has to have those properties into descriptors. It is not useful.
    My idea: I would like to have whatever object which is called automatically when a server starts; this object creates InitialDirContext and put the context into JNDI. All EJBs lookup the context by a name. But I don't know how to do that.
    And another question: how to change connection properties dynamically? My idea is putting the properties in XML Cache. And my object (which creates InitialDirContext) reads the properties from XML Cache. Can I handle a message that my properties in XML Cache have been changed and in this cases my object reads new properties and calls rebind() to update InitialDirContext?
    Thanks,
    Ivan

    To bind an object into the JNDI tree check the documentation here:
    http://e-docs.bea.com/wls/docs81/jndi/jndi.html#475702
    If this is to be used by all your applications that you deploy on the server check out the startup/shutdown class documentation here:
    http://edocs.bea.com/wls/docs81/ConsoleHelp/startup_shutdown.html
    Cheers
    IV

  • Its Urgent! J2EE Server Started but the Application is not running?

    J2EE server starts ok, I deployed the application successfully but when I open the URL http://localhost:8000 to start the application in browser it shows errors e.g
    Error: 500
    Internal Servlet Error:
    java.lang.NoSuchMethodError
    at com.sun.web.security.SecurityInterceptor.setSSLAttributes(SecurityInterceptor.java:56)
    at com.sun.web.security.SecurityInterceptor.preInvoke(SecurityInterceptor.java:83)
    at org.apache.tomcat.core.ServiceInvocationHandler.preInvoke(ServletWrapper.java:615)
    at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:531)
    at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
    at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
    at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:310)
    at java.lang.Thread.run(Thread.java:484)
    Please Help me its very Urgent

    I deployed the application successfully, J2ee server started successfully but when I open the browser and try to run the application or view the welcome page it shows the above mentioned error.

  • Help-Cubes are not getting started when Analytical server started in 11.1.1

    Installed Oracle Essbase Analytical server along with Shared Services, Provider Services and Integration Services thru EPM v11.1.1.3. Shared services and provider services on Windows 2003 and Essbase Analytical Services and Integration Services on UNIX/AIX. All the components got configured successfully. Copied the essbase.sec from the server which has previous version (v11.1.1.1.0) of Essbase. We have been encountering couple of problems. The first one is the applications(cubes) didn't start when the analytical server started. The second one is when trying to start using MAXL script, the applications took long time (more than 30 minutes) to start.
    Any suggestions that you may have in resolving this are appreciated. Thanks,

    In the application properties, is the box 'Start application when Essbase server starts' checked? If not, that's why they didn't automatically start. Also, once you started them manually, does it still take 30 minutes to start? Or is shutdown and startup faster now?
    Sabrina

  • J2ee server starting problem

    Hi, I am a new comer in this field. I am fininding problem in starting the j2ee server.I have downloaded and installed C:\j2sdkee1.3.1 , c:\jdk1.3.1_03 , c:\j2eetutorial and c:\antroot\jakarta-ant-1.3. I am using windows 2000 professional OS and set the environment variables like JAVA_HOME : c:\jdk1.3.1_03, J2EE_HOME:C:\j2sdkee1.3.1 and ANT_HOME:c:\antroot\jakarta-ant-1.3.
    set the path to %J2EE_HOME%\bin;%JAVA_HOME%\bin;%ANT_HOME%\bin; as per the instruction given in the J2EE tutorial preface.
    When I type j2ee on the command prompt it says "j2ee is not recognized as an internal or external command, operable program or batch file".
    Can any one plese guide how I can start and go ahead with this tutorial. Is there any other setting i need to set or change.
    Thanks,
    ansp

    Hi,
    If you're running j2ee on windows platform and you have outlook also loaded, close the outlook and try running j2ee again.
    also set your class path to the jar file under $J2EE_HOME/lib/j2ee.jar:. before rest of your classpath
    I have the same problem (with different message) on solaris.
    Regards,
    S+

  • URGENT : J2ee server start up Error : .NoClassDefFoundError:

    i have installed j2ee1.3 server in my machine (XP professional / jdk1.5 /JRE 1.5 ).
    have set all env variables jAVA_HOME,J2EE_HOME ans PATH.
    But when i start the server using j2ee -verbose command i get the following error.
    C:\J2EE\bin>j2ee.bat -verbose
    J2EE server listen port: 1050
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/inte
    rnal/util/IdentityHashtable
    at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.<clinit>(Util.java:87)
    at com.sun.corba.ee.internal.POA.POAImpl.activate(POAImpl.java:935)
    at com.sun.corba.ee.internal.POA.POAImpl.activate_object(POAImpl.java:89
    5)
    at com.sun.corba.ee.internal.CosNaming.TransientNameService.initialize(T
    ransientNameService.java:117)
    at com.sun.corba.ee.internal.CosNaming.TransientNameService.<init>(Trans
    ientNameService.java:70)
    at com.sun.enterprise.iiop.POAProtocolMgr.initializeNaming(POAProtocolMg
    r.java:103)
    at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:226)
    at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
    Also i have set the classpath to <<installdir>>\lib\j2ee.jar
    since iam practising for scbcd xam i need j2e1.3 to practise.
    Is this related to any version conflict ? please help me ...
    Thanks.

    Hi All,
    I was able to figure out the problem and i hope that there must be version conflicts since i had j2ee1.3 and jdk1.5.
    I unistalled jdk1.5 and installed jdk1.3 and everything went on fine.
    Also avoid installing in directories having spaces in the names EX: Program Files.

  • Another J2EE server start-up problem.

    Hi:
    For many days, I have being having trouble starting the J2EE server... When I try to start the server, the starting process terminates mysteriously. Finally, I identified this error in my log:
    "Failed to create RMI-IIOP server because: null"
    I still have no idea what this error says though... somebody plz help me out here... it's quite frustrating trying to self-learn J2EE late in the night after a long work day and stuck with a broken server for days... Thanx...

    Hi!
    I had the same problem and I installed again the j2sdkee and the problem was solved.

  • Problem with J2EE server start

    hello,
    I install J2EE SDK sever and I want to start this. So I have typed this line:
    J2ee -verbose and I have this error:
    Logging for J2EE Server Version: 1.3.1-b17 started at: Wed Mar 29 15:24:15 CEST 2006..
    Using the Java HotSpot(TM) Client VM and the version number 1.5.0_06 from Sun Microsystems Inc..
    VM is using the classpath: C:\j2sdkee1.3.1\lib\system\cloudscape.jar;C:\j2sdkee1.3.1\lib\system\tools.jar;C:\j2sdkee1.3.1\lib\cloudscape\RmiJdbc.jar;C:\j2sdkee1.3.1\lib\cloudscape\cloudclient.jar;C:\j2sdkee1.3.1\lib\classes;C:\j2sdkee1.3.1\classes;C:\j2sdkee1.3.1\lib\j2ee.jar;C:\j2sdkee1.3.1\lib\toolclasses;C:\j2sdkee1.3.1\lib\j2eetools.jar;C:\j2sdkee1.3.1\lib\locale;;C:\jdk1.5.0_06\lib\tools.jar;C:\j2sdkee1.3.1\lib\jhall.jar .
    J2EE Home Directory has been set to: C:\j2sdkee1.3.1.
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/IdentityHashtable
         at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.<clinit>(Util.java:87)
         at com.sun.corba.ee.internal.POA.POAImpl.activate(POAImpl.java:935)
         at com.sun.corba.ee.internal.POA.POAImpl.activate_object(POAImpl.java:895)
         at com.sun.corba.ee.internal.CosNaming.TransientNameService.initialize(TransientNameService.java:117)
         at com.sun.corba.ee.internal.CosNaming.TransientNameService.<init>(TransientNameService.java:70)
         at com.sun.enterprise.iiop.POAProtocolMgr.initializeNaming(POAProtocolMgr.java:103)
         at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:226)
         at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)I have the JDK 1.5.0_06 and the J2sdkee1.3.1.
    Have an idea what is the problem, and what I must modify in order to do working my server?
    thank you for your help
    Antitrust1982

    Hello
    I use this version because I try to execute the tutorial of JMS, but I can't working it. The version porpose are these one : http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/client.html#1025256
    Thank you for your help.

  • J2ee server start problem

    For some reason, I cannot start the J2EE server properly.
    I am using JDK1.3.1 and J2SDKEE1.2.1 on WIN NT. After
    running
    cloudscape.bat -start
    I type from another prompt,
    j2ee.bat -verbose
    and get the following output,
    prg.com.CORBA.INITIALIZE: Could not find the POA-to-id mapper. Please ensure orbd has been started. minor code: 0 completed: No
    Any ideas why this is happening?
    THanks,
    Antoine

    Hi chernali,
    I do not know what happen to your PC but we have the same situation but it runs well....
    I think you should care about the classpath and where is your jdk location is...
    may foward futher question....
    regards,
    kurt

  • Executing a program when the server starts

    I have developed a chat program and to run it I have type "java ChatManager".
    Is there a way where this program can start automatically when I start the tomcat.
    Regards,
    Sharad

    The chat application is a java file. I need to keep it running so that I can use it in my applet. The problem is after I start the tomcat, I have start the chat application and for this I open a new window and type "java ChatManager". Once this is done I can start using the chat applet. Is there a way, where the chat application starts automatically when the tomcat starts. Do I need to add something in the server.xml file for this.
    Regards,
    Sharad

  • When Application server started

    Hi,
    in Tools 8.50 on Windows 2003, in which log file can I see the start time of Application server ?
    I looked in APPSRV_0804.LOG and TUXLOG.080411 but did not see.
    Thanks.

    Has it been started today ? What about ?
    grep "Server started" $PS_HOME/appserv/<domain_name>/LOGS/APPSRV_*Nicolas.

  • Permission error when WebLogic Server starts up

    Dear WebLogic gurus
    When I try to startup WebLogic server with 80 listening port in Solaris 2.6,
    it did not startup due to permission problem.
    The error log said that
    Sat Dec 11 06:11:02 GMT 1999:<E> <ListenThread> **** Unable to create server
    socket. Perhaps another process is using port 80.
    Sat Dec 11 06:11:02 GMT 1999:<E> <ListenThread> java.net.BindException:
    Permission denied
    To solve this problem, I just tried to startup WebLogic with root user
    because I was sure that another process did not run with port 80.
    It works now but with only super user. This kind of problems did not happen
    with 7001 port.
    What's the reason of this ?
    Thanks in advance

    Hi there.. Looking at your error, it appears that you there is a web server
    already running and bound to port 80. Check with your system admins to see if
    you have a web server installed on port 80. Another easy way to figure out
    would be a simple telnet to your server name at port 80. Try this:
    $ telnet localhost (or servername) 80
    GET / HTTP/1.0
    If that works any returns any data, you've got a webserver running at port 80.
    Work with your system admin's to turn off that running webserver and picking
    another port for WebLogic.
    Under UNIX, anything under port 1024 is considered a privileged port and root
    would have to start the server to be able to bind to port 80. You'll also want
    to enable the setUID program in weblogic.properties. Look for the following
    lines in your weblogic.properties and see if they apply.
    # UNIX only: If running on port 80 on UNIX, enable the setUID program
    #weblogic.system.enableSetUID=false
    # UNIX only: Unprivileged user to setUID to after starting up
    # WebLogic Server on port 80
    #weblogic.system.nonPrivUser=nobody
    Hope this helps.
    --Vinny
    Changyong wrote:
    Dear WebLogic gurus
    When I try to startup WebLogic server with 80 listening port in Solaris 2.6,
    it did not startup due to permission problem.
    The error log said that
    Sat Dec 11 06:11:02 GMT 1999:<E> <ListenThread> **** Unable to create server
    socket. Perhaps another process is using port 80.
    Sat Dec 11 06:11:02 GMT 1999:<E> <ListenThread> java.net.BindException:
    Permission denied
    To solve this problem, I just tried to startup WebLogic with root user
    because I was sure that another process did not run with port 80.
    It works now but with only super user. This kind of problems did not happen
    with 7001 port.
    What's the reason of this ?
    Thanks in advance

  • Initializing classes when the application starts?

    Hi all,
    I tried to figure this out myself but after loads of searching I found nothing, perhaps I haven't got the right search terms.
    I have a web server written in Java with a BasePage class which is extended for each page in the application. What I would like to do is have each subclass automatically register itself with a static PageProcess class. The PageProcessor keeps a list of all registered pages, and can then check incoming requests against that list to decide which subclass should respond.
    The problem is that constructors seem to only run when the class is first accessed, so the PageProcessor is never notified of these other pages. I used to have a hard-coded function that checked the requested url and then manually called a static boolean canHandle( String url ) function per-subclass, but as I get more pages this becomes a chore to update with more else if blocks.
    Is there some kind of pattern or something I can apply to get this working? I'd like to avoid having a hard-coded list of pages to use in the application, but if that's the only real solution then I can go back to doing it that way.
    Thanks,
    Michael

    Thanks for the reply. I had a look at doing that (via ClassLoader) as well as just checking for what .class files are present, this seems like a decent way of doing it. I had hoped that there would be a way to force the JVM to initialize classes right away rather than on first-access, but as it is I think the easiest solution will be to go back to having my static PageProcessor class have a list of all pages hard-coded.

Maybe you are looking for

  • Printing out of order in iphoto 11

    I recently upgraded from Iphoto 8 to Iphoto 11.For my work I need to create contact sheets of up to 100 photos that would be in a specific order. I put the photos that I want to use into a folder and change the view to Maunual. This allows me to add

  • I moved a lot of messages from different profiles into a new profile and obviously that did not work. Help.

    The messages i moved from different profiles show up in Thunderbird below folders I have set up. Here is an example: !%26!AAAAAAAAAAAYAAAAAAAAAEar6xxG3IpIp77Cdd9KJ%2FjCgAAAEAAAAMR3mYqi1U1OmSpmool4dwEBAAAAAA%3D%3D%40graphicadd.com.wdseml Can anyone un

  • IPod not recognised in iTunes, Camera in Vista

    Alright, things have changed again. My iPod doesn't show up in My Computer unless I take a screenshot, at which point it shows up as a camera. In Safe Mode iTunes tells me the iPod cannot be used because it's safemode. Fine. At least it knows there's

  • Backup method in OLTP environment

    Which one of backup strategy would be best for 24/7 OLTP 9i/10g databases with no standby servers on unix clustered machines? Suggestions/comments?

  • Error while creating Asset Mastere Record

    Hi Gurus, When I am creating the AMR by using the transaction code AS01, below metioned error is poping up; Serial number already exists for asset number INTERN-00001 Message no. ZFI_FA_VAL000 Could you please let me know, what is the INTERN, and I a