Auto-Run Code on OC4J start

Hi,
Is is possible to Auto-Run a piece of code, either by
calling a method on a Session bean or calling a Servlet,
when OC4J is started up?
Cheers,
Ro

Hi
You can also use a servlet that implements ServletContextListener - this fires before the application server opens up for user requests. Great for loading lookup codes, etc....

Similar Messages

  • Run logic AFTER oc4j started

    My J2EE requires a lot of initialization action for data caching and resources preload. Typically, this initialization action takes 5 mins to finish. I execute this action in my servlet's init() function, which is invoked during OC4J. However, in my oc4j, I need to run 5 J2EE applications of this kind. It means my OC4J takes 25 mins to start. It makes my oc4j 'seems to be' failed to start for most of the time.
    Apart from servlet's init() and startup class, is there any way I can execute my initialization actions AFTER oc4j startup? It can at least make my oc4j start normally and timely. Thx

    There's no inherent functionality in OC4J that can do this for you. I think you need to look at your architecture -- if this was me, I'd be offloading the work to a MDB or something of that manner so it can be executed asynchronously and in parallel. The tricky bit there is to work out how to stop the corresponding applications from being used until there cache initialization is completed, and perhaps also sharing the cache between the worker and the consumer. You could synchronize the application aliveness on a file, or perhaps use an MBean in which an active attribute is checked by the application and updated from the end result of the MDB processing.
    -steve-

  • Auto run jregistry

    I've been messing around with JMF quite a bit lately and am really liking, there are a few things I am stumpped on and can't find much on the subject.
    I don't like how I have to run the jregistry to find new capture devices, is there anyway that you can auto run it when you start your app, so the user won't have to manually open it and run it?
    Thanks in advance

    You can search in the source code of JMFRegistry class

  • Issue while running page OC4J start up failed.

    Hi,
    I am working on two instances one is Local and another is in abroad.
    Now when I am running simple Hello World Page by giving Local Instance connections The page is loading quickly and running fine.
    Now when I am running the same Hello World Page by giving Abroad Instance connections The page load is taking almost 9-10 mins and running fine.
    In the above cases what might be the issue with Abroad Instances for loading page.
    1) Is it the Network Issue?
    2) Is it the OC4J Issue?
    Can anyone breif this senario and how to over come this issue.
    And one more Issue is
    Took the remote desktop of the Abroad Machine Installed JDeveloper in it and while running the Hello World page the Message OC4J start up failed is getting popedup in the Message.
    In which cases we will get OC4J start up failed error.
    Thanks,
    Krishna
    Edited by: user1000 on Feb 7, 2011 5:29 AM

    I am working on two instances one is Local and another is in abroad.What is your application release?
    In the above cases what might be the issue with Abroad Instances for loading page.
    1) Is it the Network Issue?Could be one or more.
    Can you reproduce the issue with other Self-Service pages? Any performance issues with forms?
    2) Is it the OC4J Issue?What about local users who access the same page from the same network, do they encounter the same performance issues?
    Can anyone breif this senario and how to over come this issue.Before investigating the performance issues with the instance/server (which are discussed many times in the forum, so just search old threads for performance tuning and you will get many hits), I would suggest you answer the above two questions to determine whether this is a network issue or an instance/server issue.
    And one more Issue is
    Took the remote desktop of the Abroad Machine Installed JDeveloper in it and while running the Hello World page the Message OC4J start up failed is getting popedup in the Message.
    In which cases we will get OC4J start up failed error.What is the error?
    Thanks,
    Hussein

  • Auto-Run/Start Doesn't show up on iTunes

    Hi, I'm having a difficult problem about the Auto-Run/Start thingy for my iPod touch that doesn't show up on iTunes on my MacBook Pro 13". Just because I want to remove my pictures from my iPod touch so I can transfer into the MacBook Pro as Picture folders.
    So how come it didn't show up like the Auto-run/start pop-up thingy? I did it before (like last week). Why like that? How come I didn't see that one on Finder folder on my MacBook Pro?

    ah thanks... i already saw it on iPhotos.
    i always thought the device didnt show up on Finder but only can show up on iPhoto when i sync it on my Macbook Pro from my iPod touch.

  • Auto running applications at start up...

    Hi...
    I'm reasonably new to macs. I've got a couple of small 'menu bar' apps that I would like Mac OS X to auto-run whenever I boot my MBP up.
    How do I get OS X to do this...?
    Thanks

    System prefs - -> Accounts - Login items.
    Click the + sign at the bottom to add a new start up app.

  • I,ve got a retail box CS6 design, it will not auto run or start set-upexe, help.

    I,ve got a retail box CS6 design, it will not auto run or start set-upexe, help.

    are you using a window's system?  if yes, which version?
    and, attach a screenshot of your disc's contents.

  • Why i insert a CD to install a camera, but the auto run doesnt start???

    Why i insert a CD to install a camera, but the auto run doesnt start???

    Mac software typically does not run installers on inserting the optical media (CD or DVD.) You have to go inside it and find for the installer application - if you can't find it look through the documentation that came with the camera.
    Best of luck.

  • Flash Builder 4.5 Auto-Gen Code For PHP Data Service Produces Errors

    Hello
    I'm currently running a fresh install of MAMP on my Mac and when I start a new flex project, add a php data service that pulls from a mysql database I have. Everything works fine until I try to compile. The error I'm getting is 'uid' being the primary key which is a bigint(20). The file _Super_Users.as (auto-gen based on the user table below) reports 2 errors: [Managed] requires uid to be of type 'String'. (same error on 2 lines of code) Now the MySQL table wants it to be a int, the auto gen code seems to want it to be an int as well but for some reason its putting in these requires for String on the getter and setters for 'uid'. The is before I even add any of my own code, just auto-gen then compile.
         * data/source property getters
    [Bindable(event="propertyChange")]
        public function get uid() : int /*error line*/
            return _internal_uid;
         * data/source property setters
        public function set uid(value:int) : void /*error line*/
            var oldValue:int = _internal_uid;
            if (oldValue !== value)
                _internal_uid = value;
    This is what my database looks when I export it:
    CREATE TABLE `users` (
      `uid` bigint(20) unsigned NOT NULL,
      `name` varchar(150) NOT NULL,
      `first_name` varchar(50) NOT NULL,
      `middle_name` varchar(50) NOT NULL,
      `last_name` varchar(50) NOT NULL,
      `gender` tinyint(1) NOT NULL,
      `locale` varchar(5) NOT NULL,
      `link` varchar(255) NOT NULL,
      `username` varchar(50) NOT NULL,
      `email` varchar(255) NOT NULL,
      `picture` varchar(255) NOT NULL,
      `friends` text NOT NULL,
      `created` datetime NOT NULL,
      `updated` datetime NOT NULL,
      PRIMARY KEY (`uid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    It's empty right now...
    Apache 2.0.64
    MySQL 5.5.9
    PHP 5.2.17 & 5.3.5
    APC 3.1.7
    eAccelerator 0.9.6.1
    XCache 1.2.2 & 1.3.1
    phpMyAdmin 3.3.9.2
    Zend Optimizer 3.3.9
    SQLiteManager 1.2.4
    Freetype 2.4.4
    t1lib 5.1.2
    curl 7.21.3
    jpeg 8c
    libpng-1.5.0
    gd 2.0.34
    libxml 2.7.6
    libxslt 1.1.26
    gettext 0.18.1.1
    libidn 1.17
    iconv 1.13
    mcrypt 2.5.8
    YAZ 4.0.1 & PHP/YAZ 1.0.14
    I tried to give as much info as possible, if you need more let me know...

    I discovered my problem was uid seems to be a built in global or something and was filling in that data field with a bunch of letters and number, like the device id. Because of the letters flex was throwing a fit. So if you're using Facebook API in flex be sure to not go with uid for the user id, which is was facebook api calls it.

  • Auto run - HTML5 - set post publish

    I just noticed that out of a large library of lessons in HTML5, that some of my older lessons have the start screen with the forward arrow to start and the later ones auto-run. I'm not sure when or how the preference changed (it slipped by me over time - possibly in an upgrade?) but I would like to know if anyone out there knows an html 5 edit to change this from the start button format to the auto run format. It would be far easier to get one of our programmers to write a script to replace the code in the .index file for each lesson than go through the enormous effort of republishing in Captivate.
    Best, Steve

    The difference is in the CPM.js:
    autoplay:false
    or
    autoplay:true

  • Auto run Servlet

    I want to develop a Servlet application that auto run on the server everyday.
    The application should be satisfy the following requirement:
    1. auto run on scheduled time
    2. immediately run when the server restart
    Any idea to do this ? Plse help
    Also, any sample code or example is helpful.
    Thanks

    First, very thanks to all of you.
    To sum up the idea, I have 2 ways
    1. Use "crontab" to schedule application to run. (I'm using Linux with Tomcat)
    2. Place the application in thread.
    Which one is better ? And, I'm new to crontab. Is this possible to set the CLASSPATH and run application by using crontab. Now, i'm trying set CLASSPATH in crontab, but still not success.
    If I use 2, place the application in thread. How to auto run application after the server restart ?
    Thank you. I really want to know which one is a good solution before I start to write my program.
    P.S. I not sure my question is a Servlet Technology question or not. So, I also place my question in Forum - New to Java Technology

  • Auto run application

    I want to develop a application that auto run on the server everyday.
    The application should be satisfy the following requirement:
    1. auto run on scheduled time
    2. immediately run after the server restart
    I suppose to use Servlet. plse give me any idea.
    sample code or example is helpful, Thank a lot !

    hi,
    if you use the solution with the crontab your java program is monitored. if the program crashes the cron starts it again. put you have to write a shellscript to start the javaprogram and to check out the program already runs.
    here a little script to start
    #=====================================
    CLASSPATH=**your CLASSPATH**
    JAVA_HOME=**your JAVA_HOME**
    PATH=$PATH:$JAVA_HOME/bin
    **your environment**
    export CLASSPATH JAVA_HOME PATH **your environment**
    #is the program running? (not the best solution but it should work ;-))
    a=`ps -ef | grep **your programm**`
    if [ "$a" == "" ]
    then
    nohup java **your program** 1>**your logfile** 2>&1
    fi
    #=====================================
    the crontab entry:
    */10 * * * * your program
    the 5 starts mean:
    minute,hour, day,month,day of week -> look at the man page (man 5 crontab)
    to edit the crontab use the command crontab -e under the useraccount where the program should run.
    to write a startscript (rc-Script) you can look at the skeleton-file. normaly it is in /etc/rc.d. name skeleton.
    copy that file and edit it. after that link the file to the runlevel-directory.
    hope it helps
    carsten

  • Unable to run code analysis with WDK 9926

    Hi,
    I am trying to run code analysis with WDK 9926 and seeing below issue? can anybody help me to resolve this ?
    Error:
    ====
    C:\sw\dev\T4\windows\Src\kernel\vbd>msbuild.exe cht4vbd.vcxproj /p:Configuration="Windows 8.1 Debug" /P:Platform=x64 /P:RunCodeAnalysisOnce=True
    Microsoft (R) Build Engine version 12.0.21005.1
    [Microsoft .NET Framework, version 4.0.30319.33440]
    Copyright (C) Microsoft Corporation. All rights reserved.
    Build started 4/7/2015 12:08:30 AM.
    Project "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" on node 1 (defaul
    t targets).
    DriverBuildNotifications:
      Building 'cht4vbd' with toolset 'WindowsKernelModeDriver10.0' and the 'Deskto
      p' target platform.
      Using KMDF 1.11.
    PrepareForBuild:
      Creating directory "x64\Windows8.1Debug\".
      Creating directory "C:\sw\dev\T4\windows\Src\kernel\vbd\x64\Windows8.1Debug\c
      hk\x64\".
      Creating directory "x64\Windows8.1Debug\cht4vbd.tlog\".
    InitializeBuildStatus:
      Creating "x64\Windows8.1Debug\cht4vbd.tlog\unsuccessfulbuild" because "Always
      Create" was specified.
    StampInf:
      c:\Program Files (x86)\Windows Kits\10\bin\x86\stampinf.exe -d "*" -a "amd64"
       -k "1.11" -f x64\Windows8.1Debug\chvbdx64.inf
      Copying "C:\sw\dev\T4\windows\Src\kernel\vbd\chvbdx64.inf" to "x64\Windows8.1
      Debug\chvbdx64.inf" for stamping
      Using version information from c:\Program Files (x86)\Windows Kits\10\Include
      \shared\\ntverp.h
      Could not open version header file c:\Program Files (x86)\Windows Kits\10\Inc
      lude\shared\\bldnump.h. (0x00000002)
      Could not determine version information.  Please specify using -v option.
      Updates common INF file directives
            USAGE:
            stampinf -f filename [-s section] [-d <xx/yy/zzzz> | *]
                     -a architecture -n [-c catalogfile]
                                 [-v <w.x.y.z> | *]
                                 [-k nnnnn] [-u nnnnn]
                                 [-i path]
            -f  specifies the INF file to process
            -s  specifies the INF section to place the DriverVer= directive.  By
                default this directive is placed in the [Version] section.
            -d  specifies the date written in the DriverVer= directive.  Note that
                a '*' given for a date value means for stampinf to write the
                current date. If the date is not specified, the date is taken
                from the STAMPINF_DATE environment variable.
            -v  specifies the version written in the DriverVer= directive. Note
                that a '*' given for a version value means for stampinf to write
                the current time (h.m.s.ms).  This is useful during development
                in order to get increasing version numbers. If the version is not
                specified, its value is taken from the STAMPINF_VERSION
                environment variable.
            -a  specifies the architecture string to replace the $ARCH$ keyword.
                The $ARCH$ keyword is used to tailor a TargetOSVersion decoration
                in a [Manufacturer] section, as well as its respective section
                name, to a specific platform. If no value is specified, stampinf
                takes its value from the _BuildArch environment variable.
            -c  specifies the value to be written in the CatalogFile= directive
                in the [Version] section. By default, this directive is not
                written.
            -k  specifies the version of KMDF that this driver depends on.  This
                is used to tailor the KmdfLibraryVersion & KMDF co-installer name
                in the INF. This will replace the $KMDFVERSION$ and
                $KMDFCOINSTALLERVERSION$ keywords in the INF.  The string is of
                the format:
                    <major_version>.<minor_version>
                As an example, supplying 1.5 as the version string will result in
                values of 1.5 and 01005 for the two keywords (respectively).
            -u  specifies the version of UMDF that this driver depends on.  This
                is used to tailor the UmdfLibraryVersion & UMDF co-installer name
                in the INF. This will replace the $UMDFVERSION$ and
                $UMDFCOINSTALLERVERSION$ keywords in the INF.  The string is of
                the format:
                    <major_version>.<minor_version>.<service_version>
                (where service_version is generally zero)
                As an example, supplying 1.5.0 as the version string will result
                in values of 1.5.0 and 01005 for the two keywords (respectively).
            -i  specifies the location of ntverp.h file.
                path represent the fully qualified
                location of the directory containing ntverp.h.
            -n  noisy mode shows verbose stampinf output
              -x  removes the coinstaller tag from the file and replaces the line w
      ith a ";"
            NOTES:
            The environment variable PRIVATE_DRIVER_PACKAGE can be set to
            enable stampinf's 'developer mode' behavior. When this is
            set, the date and version used for DriverVer is set to the
            current date and time, regardless of the command line
            settings. Also, 'CatalogFile=delta.cat' is written to the
            version section, unless a catalog was already specified
            with '-c'.
    c:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(355,5
    ): error MSB6006: "stampinf.exe" exited with code 1. [C:\sw\dev\T4\windows\Src\
    kernel\vbd\cht4vbd.vcxproj]
    Done Building Project "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" (de
    fault targets) -- FAILED.
    Build FAILED.
    "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" (default target) (1) ->
    (StampInf target) ->
      c:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(355
    ,5): error MSB6006: "stampinf.exe" exited with code 1. [C:\sw\dev\T4\windows\Sr
    c\kernel\vbd\cht4vbd.vcxproj]
        0 Warning(s)
        1 Error(s)
    Time Elapsed 00:00:04.07
    Thanks, Krishna

    Hi,
    I am trying to run code analysis with WDK 9926 and seeing below issue? can anybody help me to resolve this ?
    Error:
    ====
    C:\sw\dev\T4\windows\Src\kernel\vbd>msbuild.exe cht4vbd.vcxproj /p:Configuration="Windows 8.1 Debug" /P:Platform=x64 /P:RunCodeAnalysisOnce=True
    Microsoft (R) Build Engine version 12.0.21005.1
    [Microsoft .NET Framework, version 4.0.30319.33440]
    Copyright (C) Microsoft Corporation. All rights reserved.
    Build started 4/7/2015 12:08:30 AM.
    Project "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" on node 1 (defaul
    t targets).
    DriverBuildNotifications:
      Building 'cht4vbd' with toolset 'WindowsKernelModeDriver10.0' and the 'Deskto
      p' target platform.
      Using KMDF 1.11.
    PrepareForBuild:
      Creating directory "x64\Windows8.1Debug\".
      Creating directory "C:\sw\dev\T4\windows\Src\kernel\vbd\x64\Windows8.1Debug\c
      hk\x64\".
      Creating directory "x64\Windows8.1Debug\cht4vbd.tlog\".
    InitializeBuildStatus:
      Creating "x64\Windows8.1Debug\cht4vbd.tlog\unsuccessfulbuild" because "Always
      Create" was specified.
    StampInf:
      c:\Program Files (x86)\Windows Kits\10\bin\x86\stampinf.exe -d "*" -a "amd64"
       -k "1.11" -f x64\Windows8.1Debug\chvbdx64.inf
      Copying "C:\sw\dev\T4\windows\Src\kernel\vbd\chvbdx64.inf" to "x64\Windows8.1
      Debug\chvbdx64.inf" for stamping
      Using version information from c:\Program Files (x86)\Windows Kits\10\Include
      \shared\\ntverp.h
      Could not open version header file c:\Program Files (x86)\Windows Kits\10\Inc
      lude\shared\\bldnump.h. (0x00000002)
      Could not determine version information.  Please specify using -v option.
      Updates common INF file directives
            USAGE:
            stampinf -f filename [-s section] [-d <xx/yy/zzzz> | *]
                     -a architecture -n [-c catalogfile]
                                 [-v <w.x.y.z> | *]
                                 [-k nnnnn] [-u nnnnn]
                                 [-i path]
            -f  specifies the INF file to process
            -s  specifies the INF section to place the DriverVer= directive.  By
                default this directive is placed in the [Version] section.
            -d  specifies the date written in the DriverVer= directive.  Note that
                a '*' given for a date value means for stampinf to write the
                current date. If the date is not specified, the date is taken
                from the STAMPINF_DATE environment variable.
            -v  specifies the version written in the DriverVer= directive. Note
                that a '*' given for a version value means for stampinf to write
                the current time (h.m.s.ms).  This is useful during development
                in order to get increasing version numbers. If the version is not
                specified, its value is taken from the STAMPINF_VERSION
                environment variable.
            -a  specifies the architecture string to replace the $ARCH$ keyword.
                The $ARCH$ keyword is used to tailor a TargetOSVersion decoration
                in a [Manufacturer] section, as well as its respective section
                name, to a specific platform. If no value is specified, stampinf
                takes its value from the _BuildArch environment variable.
            -c  specifies the value to be written in the CatalogFile= directive
                in the [Version] section. By default, this directive is not
                written.
            -k  specifies the version of KMDF that this driver depends on.  This
                is used to tailor the KmdfLibraryVersion & KMDF co-installer name
                in the INF. This will replace the $KMDFVERSION$ and
                $KMDFCOINSTALLERVERSION$ keywords in the INF.  The string is of
                the format:
                    <major_version>.<minor_version>
                As an example, supplying 1.5 as the version string will result in
                values of 1.5 and 01005 for the two keywords (respectively).
            -u  specifies the version of UMDF that this driver depends on.  This
                is used to tailor the UmdfLibraryVersion & UMDF co-installer name
                in the INF. This will replace the $UMDFVERSION$ and
                $UMDFCOINSTALLERVERSION$ keywords in the INF.  The string is of
                the format:
                    <major_version>.<minor_version>.<service_version>
                (where service_version is generally zero)
                As an example, supplying 1.5.0 as the version string will result
                in values of 1.5.0 and 01005 for the two keywords (respectively).
            -i  specifies the location of ntverp.h file.
                path represent the fully qualified
                location of the directory containing ntverp.h.
            -n  noisy mode shows verbose stampinf output
              -x  removes the coinstaller tag from the file and replaces the line w
      ith a ";"
            NOTES:
            The environment variable PRIVATE_DRIVER_PACKAGE can be set to
            enable stampinf's 'developer mode' behavior. When this is
            set, the date and version used for DriverVer is set to the
            current date and time, regardless of the command line
            settings. Also, 'CatalogFile=delta.cat' is written to the
            version section, unless a catalog was already specified
            with '-c'.
    c:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(355,5
    ): error MSB6006: "stampinf.exe" exited with code 1. [C:\sw\dev\T4\windows\Src\
    kernel\vbd\cht4vbd.vcxproj]
    Done Building Project "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" (de
    fault targets) -- FAILED.
    Build FAILED.
    "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" (default target) (1) ->
    (StampInf target) ->
      c:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(355
    ,5): error MSB6006: "stampinf.exe" exited with code 1. [C:\sw\dev\T4\windows\Sr
    c\kernel\vbd\cht4vbd.vcxproj]
        0 Warning(s)
        1 Error(s)
    Time Elapsed 00:00:04.07
    Thanks, Krishna

  • Auto generated code in makefile

    For our product we have a TCL script that reads a series of text files and generates C++ classes for easy access to database records. Our code has been in use for make years and works very well. We have always used a solaris command prompt dmake to compile, which first generates the C++ files then complies them. It uses a series of enviroment variables which a user must set before compilation.
    I recently tried to create a Sun Studio Express based on NetBeans 6.5.rc1 project from a make file. This has worked for every other makefile except for this one. The others do not have any auto generated code.
    To run sun studio I in a command prompt source in the environments then run netbeans. Then I choose to build the product but I get an error. I then try to copy the command it is running into telnet window and it works fine. Does anyone have an idea on why in the sun studio I get and error while the telnet window works fine.

    I think the problem is that the SunStudio IDE runs the build command in a wrong directory.
    Can you verify that the working directory is correct?
    (it is in project properties: Build > Make)
    Also you can find this directory in the message in the output, when you try to build the project.
    That's the message, that you copied to the terminal window.
    Thanks,
    Nik

  • When i run report through OC4J Application i get a exception message

    When i run report through OC4J Application i get a exception message saying Server returning invalid xml and the exception number is JBO -29000. The Reports Server is installed on machine having IP 10.191.99.254.
    Below is the exception message:
    (oracle.jbo.JboException) JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: java.io.IOException, msg=Server returned HTTP response code: 500 for URL: http://10.191.99.254:8888/reports/rwservlet/showjobidnull
    Anybody Please help me out with this issue.....because I am really fed up with this problem....want some urgent help.....
    One possible workaround which I could make out is there needs change to be made in the .rdf files in Report Builder and then inside the User Parameters we change the Initial Value to * from % because the Reports Server encodes every value as %Initial_Value% and hence if the initial value for the parameter is % then it does not get a valid value and hence it returns as an invalid xml
    But unfortunately it seems this workaround does not work.Please help as soon as possible.

    Hi,
    you said that some changes were made in the .xml files but i had said that all the files present in Reports Developer or Reports Builder are .rdf files and I had made changes in the .rdf files for this articular report and then compiled it thereitself and then ran a paper layout of the report but the report did not comprise any data.
    There was sufficient data also to populate the report. So this may not be a database issue. Please help if you can ASAP.

Maybe you are looking for