OnApplicationEnd() - are all server resources available?

Hi all
I need to use onApplicationEnd() as part of Application.cfc to execute a call on a 3rd party Java object to close a connection to another device on the network.
The code I have worked perfectly if I call it as a normal request, but when I place it in the onApplicationEnd() method I'm running into some errors. These errors suggest that CF might in fact be shutting down already to the point where I cannot access these 3rd party Java classes. Not good, but also unexpected.
I then decided I'd create a parallel thread in the onApplicationEnd() and then rejoin to the main thread when I had closed by connection, but I get an obscure null pointer exception trying to create this thread from this function. Again, the same code works well if I use it in a normal request.
Is there restrictions to what I can do in onApplicationEnd() and if so is there any work around?
I am using CF 8 (8,0,1,195765) Developer Edition on a Windows XP machine.
Many thanks in advance!
Ciaran Archer

Thanks for the replies so far. Here is the code:
<cffunction name="onApplicationEnd" returnType="void">
        <cfargument name="appScope" required="true" />
        <cfset var logLocation = "test" />
        <cflog file="#logLocation#" text="*** [Application.cfc]  - **** START RUN ****" />
        <cflog file="#logLocation#" text="*** [Application.cfc]  - #timeformat(now(),'HH:mm:ss' )# - onApplicationEnd() called " />
        <cftry>
                <cfif structKeyExists(ARGUMENTS, "appScope")>
                        <cflog file="#logLocation#" text="*** [Application.cfc]  - #timeformat(now(),'HH:mm:ss' )# - ARGUMENTS.appScope is defined" />
                <cfelse>
                        <cflog file="#logLocation#" text="*** [Application.cfc]  - #timeformat(now(),'HH:mm:ss' )# - ARGUMENTS.appScope is undefined! " />
                </cfif>
                <!--- Check if we have a test crypto object in scope, and if so close it's connection --->
                <cfif structKeyExists(ARGUMENTS.appScope, "testCrypto")>
                        <cflog file="#logLocation#" text="*** [Application.cfc]  - #timeformat(now(),'HH:mm:ss' )# - onApplicationEnd() - crypto object exists in app scope" />
                        <cfset ARGUMENTS.appScope.testCrypto.closeConnection() />
                        <<cflog file="#logLocation#" text="*** [Application.cfc]  - #timeformat(now(),'HH:mm:ss' )# - onApplicationEnd() - closed crypto server connection" />
                <cfelse>
                        <cflog file="#logLocation#" text="*** [Application.cfc]  - #timeformat(now(),'HH:mm:ss' )# - onApplicationEnd() - NO crypto server connection present to close" />
                </cfif>
                        <cfcatch type="any">
                                <cflog file="#logLocation#" text="*** [Application.cfc]  - #timeformat(now(),'HH:mm:ss' )# - onApplicationEnd() - Error - #cfcatch.message#" />
                        </cfcatch>
                </cftry>
        <cflog file="#logLocation#" text="*** [Application.cfc]  - #timeformat(now(),'HH:mm:ss' )# - onApplicationEnd() ended " />
</cffunction>
The line to close the connection on my object is failing with the message: 'java.lang.IllegalStateException: Shutdown in progress'.
Here are the full logs for one run:
"Information","Thread-8","10/23/09","09:05:54",,"*** [Application.cfc]  - **** START RUN
"Information","Thread-8","10/23/09","09:05:54",,"*** [Application.cfc]  - 09:05:54 - onApplicationEnd() called "
"Information","Thread-8","10/23/09","09:05:54",,"*** [Application.cfc]  - 09:05:54 - ARGUMENTS.appScope is defined"
"Information","Thread-8","10/23/09","09:05:54",,"*** [Application.cfc]  - 09:05:54 - onApplicationEnd() - crypto object exists in app scope"
"Information","Thread-8","10/23/09","09:05:54",,"*** [Application.cfc]  - 09:05:54 - onApplicationEnd() - Error - Shutdown in progress"
"Information","Thread-8","10/23/09","09:05:55",,"*** [Application.cfc]  - 09:05:55 - onApplicationEnd() ended "
I really hope there is a work-around. The same issue occurs when I run CF as a console window and stop it with CTRL-C or if I run cfstop.
Cheers,
Ciaran

Similar Messages

  • How are all the Components available in CCMS

    All,
    I am new to MI, I have one question: Once we register all the components in MCD, Are all these components required to be enabled/made available in CCMS? If so how will that be done?
    Regards
    Sudh

    Hi
    It is not necessary to make an entry of your components in CCMS. It is an optional configuration unless you want to be alerted on some updates. These steps will be defined clearly in your configuration docs.
    regards
    Arun

  • Server resources availability while executing a query

    hi,
    lets say we have a query that requires XX MB to be executed.
    the needed memory is available, and while the query is getting memory, another threads jump on the database, and the memory needed to execute the query is not available.
    under those circunstances, can the query change the memory requirements to execute the query (i.e. page out to temp objects), or the query will NEED the XX MB to be executed?
    can the execution plan change the resources requirements based on database recourses availability ?
    Thank you,
    Eladio

    The Execution Plan is determined before the query begins executing.
    The query cannot stop and restart with a new execution plan.
    However, if the same query is executed more than once, even inside a loop
    in a PLSQL block, it may get re-parsed and may acquire a different Execution
    Plan.
    PGA_AGGREGATE_TARGET is a "guide" for Oracle to dtermine the available
    memory for an SQL (it looks at PGA memory currently used by other concurrently
    executing SQLs). However, considering the dynamics of multiple processes
    co-existing on a server, this is not and cannot be a hard limit so the actual
    PGA in use at any time can fluctuate.
    (consider, for example that other, Non-Oracle, processess might start up and
    take memory and Oracle isn't aware of those processes "stealing" available
    memory. Or consider a bug in sort / hash algorithms which cause an Oracle
    process to take (or request from the OS) much more memory than it "should",
    resulting in ORA-4030s !)
    However, as a general rule, Oracle uses PGA_AGGREGATE_TARGET
    and also provides an advisory view that you can query. (Oracle periodically
    collects statistics about PGA usage and SGA usage and updates the
    respective advisory views).

  • How to know what are all the Webservices available in P6V7

    Hi All,
    How to know what are the webservices available for integration in P6V7?
    Thanks,
    RR

    Information on Web Services for P6 are available in the Reference Manual that get installed along with P6 Web Service software. you will find the complete list there.
    Sachin

  • Where the hell are all the products available to me as a member?

    What is the link to the page with ALL the applications to download?

    And what exactly is your problem? If apps are not available it means that your system does not meet the requirements. There is no way to circumvent them or enforce anything. Verify the Tech Specs on the product pages.
    Mylenium

  • What are all the commands available in BI 7 WAD?

    Hi all,
    I am new to BI 7 Wad appln with respective to the commands to be used and how it can be used. Can anyone let me know know the commands that can be used in bi 7 wad?
    thanks
    pooja

    http://help.sap.com/saphelp_nw70/helpdata/en/2a/2da2394fbf4e6ae10000000a11402f/content.htm

  • HT4539 Why are all these apps only available for everything but my MacBook Pro?

    Why are all apps only available for phones or pads??I only want to use them on my MacBook Pro???

    Itunes does not sell any apps at all for computers.
    Itunes ONLY sells apps for iphone/ipod/ipad.
    If you want an app for your Mac, tehn shop in th Mac App Store

  • Is Media Encoder capable of utilising all hardware resources?

    I have recently built a new workstation for video editing and I am wondering about Adobe Media Encoders ability to use all resources. The system has:
    Intel Xeon E5-2680 v3 2.5Ghz with 12 cores
    128GB DDR 4 RAM
    Nvidia Quadro K6000
    Nvidia Tesla K40m
    A network connection to a SAN capable of over 200 MBps (yes that is bytes)
    Samsung SSD as the OS and application disk
    I have the Quadro and Tesla setup with Nvidia Maximus, compute tasks are off loaded to the Tesla while the Quadro handles graphics. As you would expect the machine is exceptionally quick.
    However when using Adobe Media Encoder it just doesn't seem to use all the resources available to it. When I am transcoding a tonne of files it uses a fraction of the resources available to it. This does mean I can keep editing and doing other things without any slow down, but in some instances I would prefer if it just ploughed through the files as fast as possible. Watching utilisation on CPU, RAM, GPU, and I/O; none of them max out. CPU never really goes above 20% total usage over all cores, it easily has 50% of the RAM free, the Nvidia control panel shows between 10% and 14% usage on just the Tesla and the network I/O is between 350 and 450 Mbps. I have seen all resources more heavily used when editing in PP, especially the network I/O to the storage.
    Are some of the codecs more efficient than others or is AME just not that great at using the resources of such a powerful machine?

    Sometimes a project can be weird/corrupted and do strange things. Then you need to outsmart the computer. For example, try an audio-only export. Create a .wav file and import back into project, and if all tracks are properly represented in that mix, add .wav to timeline, mute all other audio tracks, and do your final AV export using that new audio.
    Thanks
    Jeff Pulera
    Safe Harbor Computers

  • How to get users provisioned / enabled with all OIM Resources.

    Looking for help on java / sql query on how to get all the users in OIM (9102 BP 13) provisioned/enabled status only,
    with all OIM Resources available in System.
    Edited by: 907571 on Apr 18, 2012 4:12 AM

    select usr.usr_login, usr.usr_status, obj.obj_name, ost.ost_status, act.act_name
    from oiu, usr, ost, obj, usg, act
    where oiu.usr_key=usr.usr_key
    and oiu.ost_key=ost.ost_key
    and ost.obj_key=obj.obj_key
    and usr.act_key=act.act_key
    --and obj.obj_name in ('Resource Name')
    --and usr.usr_status = 'Active'
    and ost.ost_status in ('Enabled','Provisioned')
    -Kevin

  • Are all features available in Power BI for office 365 available in On-Premise Excel, SQL server etc

    Are all features available in Power BI for office 365 available in On-Premise Excel, SQL server etc
    Thanks
    Nate

    No. The tools used to create Power BI reports are available in the on premises versions:
    Power Query
    Power Pivot
    Power Map
    Power View
    To take advantage of these in a PowerBI site, or to use Q&A you need a subscription to Office365 with a PowerBI license.

  • Project server 2010. Troubles with resource availability

    A problem occurred while checking resource usage using PWA. 
    Using the PS 2010 
    the total number of projects about 2000, about 1600 resources (for 5 years) 
    We have a project - project1 and resource involved in it - res1 
    In the project, each week for the resource specified work (20 - 30 hours), the project is saved and published. (When publishing a project there are no errors.) 
    In MS Project and PWA in Project center values ​ per weeks are the same. Go to the resource center, choose res1 and check its work in resource availability and see that for some weeks value of work is 0, at some 1.75. some 0.462 etc. 
    For other projects work of this resource displayed normally. Moreover, for all other resources is displayed correctly in this project. 
    When re-saving project data and republishing it the situation is same. 
    This issue takes place to be for some other projects. 
    questions: 
    1 - what database of PS take the data for plotting in resource availability? 
    2 - than similar behavior can be caused? 
    3 - how possible to solve this problem? 
    Thanks for help!

    Hi,
    The resource availability in PWA-resource center is based on the Published DB data.
    In order to trouble shoot, can you check in the data grid under the resource availability graph the capacity of the resource? Indeed the availability is calculated based on work versus capacity. The capacity might vary with calendar exceptions (holidays)
    and non-working administrative time in the resource timesheet. I'd suggest that you check in detail the periods where you have this unexpected behavior and see the resource calendar and timesheets.
    Also what you can do is to open a blank project plan (be sure to check the option "load summary resources assignments when starting MS Project Pro), insert the resource, go to the resource usage and add the remaining availability and work availability.
    Then you could confirm if the data are correct or not.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Critical error All management server resource pool

    I just receive critical error: All management server resource pool in scom 2012 management console.
    Alert detail:
    Alert subscription data source module encountered errors while running: Alert subscription data source module was unable to find alerts that match the subscription because of database errors.
    The following error(s) were encountered:
    Exception Message: ExecuteScalar requires an open and available Connection. The connection's current state is closed.
    One or more workflows were affected by this.
    Workflow name: Subscription3f818422_f4a1_42aa_b1b3_8bc14eb54cd8
    Instance name: Alert Notification Subscription Server
    Instance ID: {E07E3FAB-53BC-BC14-1634-5A6E949F9230}
    Management group: SCOM_2012
    What is problem and how to fix it ? I haven't changed any setting in scom !!

    Only found some of error and warning in operation manager event log.
    Error:
    Source: Health Service Modules
    Event ID: 22406
    Task Category: NOne
    The PowerShell script failed with below exception
    System.Management.Automation.CmdletInvocationException: The following error occurred while loading the extended type data file:
    Microsoft.PowerShell, C:\Program Files\System Center Operations Manager 2012\Powershell\OperationsManager\.\OM10.CoreCommands\Microsoft.EnterpriseManagement.Core.Cmdlets.Types.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
    At line:8 char:66
    +               if (!(Get-Module OperationsManager)) {Import-module <<<<  $SCOMModulePath}
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
       at System.Management.Automation.PipelineNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
       at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
    Script Name: Discover Agent Versions
    One or more workflows were affected by this. 
    Workflow name: ManagementGroupDiscoveryAgentVersions
    Instance name: Operations Manager Management Group
    Instance ID: {6B1D1BE8-EBB4-B425-08DC-2385C5930B04}
    Management group: SCOM_2012
    Error:
    Source: HealthService
    Event ID: 15002
    Task Category: Pool Manager
    The pool member cannot send a lease request to acquire ownership of managed objects assigned to the pool because half
    or fewer members of the pool acknowledged the most recent initialization check request. The pool member will continue
    to send an initialization check request.
    Management Group: SCOM_2012
    Management Group ID: {56D0B0FE-FB03-2A6C-E3F6-54287D96855D}
    Pool Name: AD Assignment Resource Pool
    Pool ID: {529CF61E-A357-5AED-73CC-81D48E4327CA}
    Pool Version: 7607127134982980644
    Number of Pool Members: 2
    Number of Observer Only Pool Members: 1
    Number of Instances: 1
    Error:
    Source: HealthService
    Event ID: 15002
    Task Category: Pool Manager
    The pool member cannot send a lease request to acquire ownership of managed objects assigned to the pool because half
    or fewer members of the pool acknowledged the most recent initialization check request. The pool member will continue
    to send an initialization check request.
    Management Group: SCOM_2012
    Management Group ID: {56D0B0FE-FB03-2A6C-E3F6-54287D96855D}
    Pool Name: Notifications Resource Pool
    Pool ID: {3F9F97EA-E584-B0EE-A4C9-78A86FB4F21F}
    Pool Version: 7607127134982980644
    Number of Pool Members: 2
    Number of Observer Only Pool Members: 1
    Number of Instances: 1
    Error:
    Source: HealthService
    Event ID: 15002
    Task Category: Pool Manager
    The pool member cannot send a lease request to acquire ownership of managed objects assigned to the pool because half
    or fewer members of the pool acknowledged the most recent initialization check request. The pool member will continue
    to send an initialization check request.
    Management Group: SCOM_2012
    Management Group ID: {56D0B0FE-FB03-2A6C-E3F6-54287D96855D}
    Pool Name: All Management Servers Resource Pool
    Pool ID: {4932D8F0-C8E2-2F4B-288E-3ED98A340B9F}
    Pool Version: 7607127134982980644
    Number of Pool Members: 2
    Number of Observer Only Pool Members: 1
    Number of Instances: 116
    Warning:
    Source: Health Service Modules
    Event ID: 10103
    Task Category: None
    The Windows Event Log Provider has resumed processing the Operations Manager event log on computer 'HKWOMM01.ap.zurich.com' after recovering from errors.
    One or more workflows were affected by this. 
    Workflow name: Microsoft.SystemCenter.CM.AEM.Modules.EventCollection
    Instance name: HKWOMM01.ap.zurich.com
    Instance ID: {BF86169C-4A71-C728-9649-338260E86093}
    Management group: SCOM_2012
    Warning:
    Source: Health Service Modules
    Event ID: 10103
    Task Category: None
    In PerfDataSource, could not resolve counter instance OpsMgr DW Writer Module, Avg. Batch Processing Time, ms, All Instances. Module will not be unloaded.
    One or more workflows were affected by this. 
    Workflow name: Microsoft.SystemCenter.DataWarehouse.CollectionRule.Performance.Writer.AvgBatchProcessingTime
    Instance name: HKWOMM01.ap.zurich.com
    Instance ID: {BF86169C-4A71-C728-9649-338260E86093}
    Management group: SCOM_2012
    Warning:
    Source: Health Service Modules
    Event ID: 10103
    Task Category: None
    In PerfDataSource, could not resolve counter instance OpsMgr DW Writer Module, Batches/sec, All Instances. Module will not be unloaded.
    One or more workflows were affected by this. 
    Workflow name: Microsoft.SystemCenter.DataWarehouse.CollectionRule.Performance.Writer.BatchesPerSecond
    Instance name: HKWOMM01.ap.zurich.com
    Instance ID: {BF86169C-4A71-C728-9649-338260E86093}
    Management group: SCOM_2012
    Warning:
    Source: Health Service Modules
    Event ID: 10103
    Task Category: None
    In PerfDataSource, could not resolve counter instance LogicalDisk, Current Disk Queue Length,
    \\?\Volume{9470dbf8-09e8-11e1-887f-806e6f6e6963}. Module will not be unloaded.
    One or more workflows were affected by this. 
    Workflow name: Microsoft.Windows.Server.2008.LogicalDisk.CurrentDiskQueueLength.Collection
    Instance name:
    \\?\Volume{9470dbf8-09e8-11e1-887f-806e6f6e6963}
    Instance ID: {80A7A920-B571-987C-9B3B-DE2164998AB9}
    Management group: SCOM_2012
    Warning:
    Source: Health Service Modules
    Event ID: 10103
    Task Category: None
    In PerfDataSource, could not resolve counter instance OpsMgr DW Synchronization Module, Avg. Batch Processing Time, ms, All Instances. Module will not be unloaded.
    One or more workflows were affected by this. 
    Workflow name: Microsoft.SystemCenter.DataWarehouse.CollectionRule.Performance.Synchronization.AvgBatchProcessingTime
    Instance name: b9e5cd4c-1b78-4530-b93f-69806d14d7f3
    Instance ID: {E6A569EF-6527-2B26-8345-2E16F0979064}
    Management group: SCOM_2012

  • Project Server - Projects does not show up in the detail section of the resource availability view!!!

    Hi,
    I click resource center in PWA 2010 and select a resource; then click resource assignments and a list of projects along with the task which the selected resource is assign is listed. I then click on resource availability and set the date
    option and units for the selected resource and the resource availability and capacity is visible in the details section but not the list of projects that the resource is assign.
    How can I get the list of projects to show up in the details section under the resource name?   
    A. Williams

    Hi A. Williams,
    Could you post a screenshot of BOTH upper (graph) and lower (detailed grid) parts of our resource availability page?
    It would be very weird that you can see workload in the upper part but not in the detailed grid. This is what we need to know to help you:
    Are you not seeing at all the assignments in both graph and detail grid of the resource availability page? In this case the issue comes from your assignment, not from the resource availability page.
    Are you seeing the assignment in the graph but not in the detail grid?
    In case this is an assignment issue, some reasons could be:
    you're not looking at the right period
    date range selection has not been applied clicking on the button "apply"
    the assignments are proposed (versus committed)
    the assignment has not been publish (column publish to "yes" in MS Project Pro)
    the assignment owner is not the resource
    Here is (sorry, it is in french) my upper part (graph) with 1 resource selected, 3 weeks and a 7hrs assignment on the 2nd week (note that you have to apply the date range once selected) :
    Then the lower part (detailed grid) where is have exactly the same information (same assignments, same resources, same date range):
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • How can I print to my HP OfficeJet 6500 Wireless Printer from my iPhone 4S which used to work before AirPrint printers were even available? (running Mac Lion OS, all software and HP sw updates are all performed)

    How can I print to my HP OfficeJet 6500 Wireless Printer from my iPhone 4S which used to work (on prior iPhones) before AirPrint printers were even available? (running Mac Lion OS, all software and HP sw updates are all performed)
    I don't get it, I read one post about why would we have to buy an AirPrint Printer when we have used the "print to a wifi printer" just fine in the past?  Yes I feel that's exactly what's happening to me now too. I want to print from my iPhone and iPad to my WiFi Printer which is also now connected to my Airport Express WiFi network just fine. No problems.

    Very glad you added that bit of information because I see different problems similar to this.  I want to share with them what you did and hopefully you not only fixed your specific problem but you can lend some more advice to others with problems like this. Thanks!
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • Just installed CC on my PC, Windows 7, 64 bit system. Not seeing any applications on the desktop or installation folder. However, all the resource files are present in the installation folder. What am I doing wrong?

    Just installed CC on my PC, Windows 7, 64 bit system. Not seeing any applications on the desktop or installation folder. However, all the resource files are present in the installation folder. What am I doing wrong?
    I've installed three times with no luck. I downloaded the Creative Cloud Packager off the licensing site: https://licensing.adobe.com. I unpacked and choose my applications. The install seemed to be successful, but I don't so any of the applications anywhere.

    Hi,
    Creating package doesn't mean it will install the product,
    You will need to install the package now. Please follow the instructions mentioned in the below articles
    Creative Cloud Help | Creating or editing packages
    Creative Cloud Help | Deploying packages
    Please let me know if it doesn't help.
    Regards,
    Devendra

Maybe you are looking for

  • How can i set up a new imap folder on my own domain

    I have my own personal domain on my own server and I am wondering if the only way to set up a new folder is via cPanel direct on my server - or can it be done through Mail?

  • Error in PREPARE with MS-SQL Server

    I'm doing a upgrade to ECC 6.0 SR2. I'm following the instructions of Upgrade Guide SAP ECC 6.0 SR2. My Operating System is Windows 2003 Server, database is MS-SQL Server and SAP system source is R3 4.7 Ext 200 non-Unicode I updated SAPup and include

  • Importing video from sony handy-cam?

    I have an older sony handy-cam, model DCR-HC20, that I wanted to transfer video from to my imac for editing/storage...also, I have a new project I am working on. So, the handy-cam has usb and fire-wire, but my imac doesnt recognize it when plugged in

  • How can I extend to a second monitor

    I have a Macbook Pro  OSX 10.9.3(13D65)    17 inc early 2008    I have the ability to Mirror but can I upgrade to be able to add a monitor so I can work on an extended monitor instead of using mirror?Can I also open Garageband in both of those window

  • USB drive confusion

    I have 2 USB drive connected to the hub and both mount. Airport disk utility lists only item, and that is named after the base station, not the hard drive. Should not 2 drives be listed under the same name as is seen on the desktop? The disk utility