ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 3rd, 2005, 11:19 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
Caching XML in cfcs MX 7 problem?

Hi,

We're running quite a few large applications under Mach-II. Some of our objects are using xml to hold specific settings, the xml is read in and parsed to an xml document which is then saved in the objects variables scope.

Then throughout the objects life some of the methods perform xml searches etc. on this xml document as part of their action.

This has all being working fine. However when switching to MX 7 we're having problems, sometimes exceptions are thrown with no message, detail or extended info and sometime exceptions with "Element XMLATTRIBUTES. ... is undefined in a Java object of type class coldfusion.xml.XmlNodeMap referenced as " within the methods that perform actions on the cached xml document.

However this does not happen consistantly (we're having a hard time re-creating on our development environment) and everything seems to be fine for a while until suddenly it all goes pear shaped.

I'm thinking it could be some sort of thread safe issue with some of the xml functions we're using, but I'm not sure as the inconsistancy of it is making it hard to debug.

Does anyone have any ideas/experience with a problem like this.

If you need any more information/clarification please tell me as this issue is beginning to kill me.

-D

Reply With Quote
  #2  
Old October 3rd, 2005, 05:02 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
Can you confirm that the Mach-II app in question is in PRODUCTION mode and not development mode?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old October 4th, 2005, 03:36 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
Quote:
Originally Posted by kiteless
Can you confirm that the Mach-II app in question is in PRODUCTION mode and not development mode?


Yes it is in production mode, with reload config set to dynamic (whenever the mach-ii file changes).

The mach-ii isn't reloading.
A rough example of our main problem file is, I'll just leave in the important bits with some comments describing any strange behaviour we are seeing in MX7 :

Code:
<cfcomponent displayname="Client Side Include Schema" extends="MachII.Framework.Listener">

	<cfscript>
		variables.cssSchemaObj = "";
		variables.schemaPath = "";
		// etc.
	</cfscript>
	
	<cffunction name="configure" access="public" returntype="void" output="false">
		<cfset var xmlString = '' />
		<!---
			In the configure we pickup all the params etc and set them in the variables scope where applicable.
		--->
			
		<cffile action="read" file="#variables.schemaPath#" variable="xmlString" />
		<!--- create the xml object --->
		<cfset variables.cssSchemaObj = xmlParse(xmlString) />
	</cffunction>

	<cffunction name="getIncludes" access="public" returntype="struct" output="true">
		<cfargument name="event" type="MachII.framework.Event" required="yes" />
		<cfscript>
			var includes = structNew();
			var pageName = lcase(arguments.event.getArg("pageID"));
			// etc.
				
			includes.styles = arrayNew(1);
			includes.scripts = arrayNew(1);
				
			// set the stylesheet paths
			node = xmlSearch(variables.cssSchemaObj, "//page[@name='#pageName#']");
			if(not arrayIsEmpty(node) AND isArray(node[1].xmlChildren)){
			for(i=1; i LTE arrayLen(node[1].xmlChildren); i=i+1){
				if(node[1].xmlChildren[i].xmlName is "stylesheets"){
					style = structNew();
					style.media = node[1].xmlChildren[i].xmlAttributes.media;
					style.stylesheets = arrayNew(1);
					/*
						NOTE : node[1].xmlChildren[i].xmlChildren contains the expected
						nodes etc. when added to the debug of the exception email notices
					*/
							
					for(x=1; x LTE arrayLen(node[1].xmlChildren[i].xmlChildren); x=x+1){
						
						/*
							Loop through all the children and do stuff with them, this is where we have problems.
							
							Although in the debug of the exception email node[1].xmlChildren[i].xmlChildren has the expected nodes and attributes this next part falls over (sometimes with a blank exception, sometime not).
							
							If I try adding node[1].xmlChildren[i].xmlChildren[x] to
							the exception debug then I usually get 'undefined array index'.
						*/
						row = node[1].xmlChildren[i].xmlChildren[x].xmlAttributes.path;
						
					}
				}
				
			}
			
			return includes;
		</cfscript>
	</cffunction>
</cfcomponent>


Someone on the Macromedia forum suggested that the variable settings in the pseudo constructor could be an issue - but I don't think that's it.

-D

Reply With Quote
  #4  
Old October 4th, 2005, 08:26 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
No that's not it because the pseudoconstructor area is only executed on object instantiation. Also, the configure method is only run when the listener is instantiated, so after that point the xml data should always be available in variables.cssSchemaObject.

I would try wrapping the section of code that seems to be generating the error with a try/catch block and then email or log additional information to yourself to help diagnose. For example, is the entire XML document object empty, or is it just one particular element that is blowing up? Etc. You might also try using cflog or the Mach-II trace plugin to ensure that the configure method is only running once, etc.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Caching XML in cfcs MX 7 problem?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT