Monday, December 31, 2007
Thursday, December 27, 2007
Liquid XML Studio is awesome!
Anyway, after some digging to find a better XML editor that wouldn't cost a lot (XML Spy is $500 and oXygen is $200+) I found Liquid XML Studio. It's a great program and has a free version. Very easy to use and you can't beat the price! I was able to create an xml schema and validate the original doc in about an hour (with a little help from online tutorials).
Getting to this point has cause a LOT of headaches but it was worth the trip. Now others will be able to edit the doc and validate it without paying a penny for an editor...
Check it out>
Wednesday, December 26, 2007
Coldfusion caches IP addresses -- so watch out when you change DNS!
1. Some time ago we built an admin tool that used an CFHTTP tag to retrieve a .cfm page and then save the resulting .html to the server. This allowed us to flatten the .cfm pages for serving through Apache. (BTW--This lowered our use of Coldfusion to a minimum and improved our server stability dramatically).
2. Some time later we moved our sites to a new server and had to change DNS to reflect the new IP address of the box.
3. The admin tool was only used sporadically so the next time we used it none of pages would save new content. All of a sudden our admin tool wouldn't work at all!
4. As luck would have it we remembered that we had changed the IP address a week or so before and after some debugging found that CF was still going to the old IP to build the files.
5. Thanks to Google we found some posts that documented that CF caches DNS entries internally so in order to fix the problem you need to restart CF!
Here is one post that explains it (from here):
I just ran across this issue again, CFHTTP requests to a hostname work from one Coldfusion server but not from another. The JVM caches hostname-to-IP address resolution for infinity, by default. This means that if you have a local DNS server with a host name mytest.mydomain.com and it is set to resolve to 127.0.0.1 each CFHTTP request (or CFFTP, CFLDAP, CFINVOKE) to mytest.mydomain.com after the first call will resolve to the IP 127.0.0.1. If you change the DNS entry at some point to resolve to a different IP, Coldfusion never picks up on this change, but instead continues to try and resolve to the old IP address, unless you restart Coldfusion.
You can change the caching policy by editing the networkaddress.cache.ttl
value in the cf_root\runtime\jre\lib\security\java.security
config file.
In the cool category
Subversion conflicts
The worst part is that the issue went away without my knowing exactly what solved it.....
....I hate that!
Cold Fusion not parsing xml \ Dreamweaver adding characters
If you have an xml file that you edit and upload to a server, there are cases where hidden characters will prevent the code from being parsed using the XMLParse() method. It seems that some editors will place hidden characters in the beginning of the xml -- i think its because the encoding is incorrect. The xml will look fine in Dreamweaver and even notepad but will crash and burn in some parsers. For instance I had done the xml for www.bahaullah.org and stored it on a server. I then did:
XMLContent = XMLParse(XMLContent);
and instead of parsing the xml it threw this error:
An error occured while Parsing an XML document. Content is not allowed in prolog
To fix it I had to edit the file directly on the server using vi and removed the characters that appears just before the opening root node.
AND then it appears that the errors can also be introduced in Dreamweaver CS3 for .cfm files too!! While I was trying to modify a .cfm file and change the path to the file, it apparently added odd characters along with the "_" -- even if I tried to remove the "_" again.
I also had to fix this by editing the .cfm file using vi in unix.
This is very frustrating as I have spent hours debugging errors that I can't even see...
UPDATE-- It's a short time later but I just found the main gremlin. I had also tried opening the file in Microsoft XML Notepad 2007 and this is what added the special characters! I should have known that it would be caused by Microsoft and not Adobe Dreamweaver ;-)
Although I'm still not sure what caused the issue with the config.cfm edit too -- but i'm sure it CAN'T be adobe!
First post
Since its not designed for anyone else than me, if you happen on this by accident, accept my apologies -- it will probably be like opening up somebody else's closet just to find the stuff they hid before you arrived ;-)