• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

A struct in the application scope will be lost / damaged

New Here ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

Hello,

we have a strange problem with our CFMX 7,0,2, perhaps somebody can help?

In the application.cfm a xml-file will be loaded, parsed and saved as a struct in an application variable. This will take place only if the struct isn't defined. We set the application variable exclusive by cflock. After some times, the struct or an element of the struct will be lost. At this time, we get "Null Pointer Exceptions".
--
java.lang.NullPointerException
at coldfusion.xml.XmlNodeMap.size(XmlNodeMap.java:656)
at coldfusion.runtime.Struct.StructCount(Struct.java:172)
at coldfusion.runtime.CFPage.StructCount(CFPage.java:4133)
...
---

Some questions:
- Why is the struct / the elements in the application scope are lost? The application timeout is set to 2days, and other application variables aren't lost.
- Why will cftry / cfcatch not work in this case?

What can we do?

Kind regards
Karl-Heinz
TOPICS
Advanced techniques

Views

348

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

you can use the isDefined function in the onRequestStart function in Application.cfc

I have never had an application scoped variable / object get lost or damaged in the way that you're describing.

are you loading it in the onApplicationStart function of Application.cfc ? that would be a good place to do it.

oh, actually, I did have a contractor who assigned the application name dynamically, I think the name contained the current date so each time the date would change the application would change - you might want to make sure that is not happening to you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 20, 2007 May 20, 2007

Copy link to clipboard

Copied

IsDefined won't work. The Null Pointer Exception will appear in both cfc und cfm pages. The variables will be filled in the application.cfm.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 28, 2007 May 28, 2007

Copy link to clipboard

Copied

LATEST
I don't suppose you are using StructCopy() to get a copy of the structure instead of a pointer to the structure, then when the pointer gets erased by ... then your APPLICATION.struct will be undefined too.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation